]> git.proxmox.com Git - pve-manager.git/commitdiff
add simply perf test using 'ab'
authorDietmar Maurer <dietmar@proxmox.com>
Thu, 28 Mar 2013 08:20:02 +0000 (09:20 +0100)
committerDietmar Maurer <dietmar@proxmox.com>
Thu, 28 Mar 2013 08:47:51 +0000 (09:47 +0100)
bin/test/perftest2.pl [new file with mode: 0755]

diff --git a/bin/test/perftest2.pl b/bin/test/perftest2.pl
new file mode 100755 (executable)
index 0000000..0981459
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/perl -w
+
+use lib '../../';
+use strict;
+use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
+use PVE::INotify;
+use PVE::AccessControl;
+
+my $hostname = PVE::INotify::read_file("hostname");
+
+# normally you use username/password,
+# but we can simply create a ticket if we are root
+my $ticket = PVE::AccessControl::assemble_ticket('root@pam');
+
+
+my $cmd = "ab -c 2 -n 1000 -C 'PVEAuthCookie=$ticket'  https://$hostname:8006/api2/json";
+print "$cmd\n";
+system($cmd) == 0 || die "command failed - $!\n";