summaryrefslogtreecommitdiff
path: root/bin/svc_phone-bulk_insert-profile
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2013-09-09 00:37:14 -0700
committerIvan Kohler <ivan@freeside.biz>2013-09-09 00:37:14 -0700
commit5b5168d7ada7b6ca5375762837dc999cab0e8a9e (patch)
tree46b766992bb7d30b243f8e0d2c6939c23665e961 /bin/svc_phone-bulk_insert-profile
parent992f784a5f012c7a954f86c62d0977ec947a3170 (diff)
quick tools for profiling phone number insert/delete, RT#24767
Diffstat (limited to 'bin/svc_phone-bulk_insert-profile')
-rwxr-xr-xbin/svc_phone-bulk_insert-profile39
1 files changed, 39 insertions, 0 deletions
diff --git a/bin/svc_phone-bulk_insert-profile b/bin/svc_phone-bulk_insert-profile
new file mode 100755
index 000000000..b1ed89943
--- /dev/null
+++ b/bin/svc_phone-bulk_insert-profile
@@ -0,0 +1,39 @@
+#!/usr/bin/perl -w
+
+use strict;
+use DBIx::Profile;
+use FS::UID qw( adminsuidsetup );
+#use FS::Record qw( qsearchs );
+use FS::svc_phone;
+
+my $user = shift or die &usage;
+my $dbh = adminsuidsetup($user);
+
+my $pkgnum = shift or die &usage;
+my $svcpart = shift or die &usage;
+
+#$FS::cust_pkg::DEBUG = 3;
+$FS::cust_svc::ignore_quantity = 1;
+
+#for ( 1..50000 ) {
+for ( 1..5000 ) {
+ my $svc_phone = new FS::svc_phone {
+ 'countrycode' => 1,
+ 'phonenum' => '3125550000' + $_,
+ 'pkgnum' => $pkgnum,
+ 'svcpart' => $svcpart,
+ };
+ my $error = $svc_phone->insert;
+ die $error if $error;
+ print '.' unless $_ % 50 # % 1000;
+}
+
+print "\n";
+print $dbh->sprintProfile;
+#$dbh->printProfile;
+
+sub usage {
+ die "Usage:\n svc_phone-bulk_insert-profile user pkgnum svcpart\n";
+}
+
+1;