mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-09 17:06:16 +00:00
code cleanup
This commit is contained in:
parent
96bcc111fb
commit
90d226ab5d
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl
|
||||||
|
|
||||||
use lib '../../';
|
use lib '../../';
|
||||||
use strict;
|
use strict;
|
||||||
|
use warnings;
|
||||||
use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
|
use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
|
||||||
use PVE::INotify;
|
use PVE::INotify;
|
||||||
use PVE::AccessControl;
|
use PVE::AccessControl;
|
||||||
@ -12,6 +13,6 @@ my $hostname = PVE::INotify::read_file("hostname");
|
|||||||
# but we can simply create a ticket if we are root
|
# but we can simply create a ticket if we are root
|
||||||
my $ticket = PVE::AccessControl::assemble_ticket('root@pam');
|
my $ticket = PVE::AccessControl::assemble_ticket('root@pam');
|
||||||
|
|
||||||
my $cmd = "ab -c 2 -n 1000 -C 'PVEAuthCookie=$ticket' https://$hostname:8006/api2/json";
|
my $cmd = "ab -c 10 -n 1000 -C 'PVEAuthCookie=$ticket' https://$hostname:8006/api2/json";
|
||||||
print "$cmd\n";
|
print "$cmd\n";
|
||||||
system($cmd) == 0 || die "command failed - $!\n";
|
system($cmd) == 0 || die "command failed - $!\n";
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
#!/usr/bin/perl -w
|
#!/usr/bin/perl
|
||||||
|
|
||||||
use lib '../../';
|
use lib '../../';
|
||||||
use strict;
|
use strict;
|
||||||
|
use warnings;
|
||||||
use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
|
use Time::HiRes qw( usleep ualarm gettimeofday tv_interval );
|
||||||
use PVE::INotify;
|
use PVE::INotify;
|
||||||
use PVE::AccessControl;
|
use PVE::AccessControl;
|
||||||
@ -15,7 +16,7 @@ my $hostname = PVE::INotify::read_file("hostname");
|
|||||||
# but we can simply create a ticket if we are root
|
# but we can simply create a ticket if we are root
|
||||||
my $ticket = PVE::AccessControl::assemble_ticket('root@pam');
|
my $ticket = PVE::AccessControl::assemble_ticket('root@pam');
|
||||||
|
|
||||||
my $wcount = 1;
|
my $wcount = 10;
|
||||||
my $qcount = 100;
|
my $qcount = 100;
|
||||||
|
|
||||||
sub test_rpc {
|
sub test_rpc {
|
||||||
@ -65,6 +66,4 @@ sub run_tests {
|
|||||||
print "$host: $tpq ms per query\n";
|
print "$host: $tpq ms per query\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
# why is this faster than LWP::UserAgent?
|
run_tests($hostname); # test 'pveproxy'
|
||||||
|
|
||||||
run_tests($hostname); # test 'apache'
|
|
||||||
|
Loading…
Reference in New Issue
Block a user