]>
git.proxmox.com Git - pve-manager.git/blob - test/perftest3.pl
6 use Time
::HiRes
qw( usleep ualarm gettimeofday tv_interval );
8 use PVE
::AccessControl
;
9 use Net
::SSLeay
qw(get_https post_https sslcat make_headers make_form);
13 my $hostname = PVE
::INotify
::read_file
("hostname");
15 # normally you use username/password,
16 # but we can simply create a ticket if we are root
17 my $ticket = PVE
::AccessControl
::assemble_ticket
('root@pam');
25 for (my $i = 0; $i < $qcount; $i++) {
27 my ($page, $response, %reply_headers)
28 = get_https
($host, 8006, '/api2/json',
29 make_headers
(Cookie
=> "PVEAuthCookie=$ticket"));
30 die "$response\n" if $response !~ m/200 OK/;
37 print "ERROR: $err\n";
48 my $starttime = [gettimeofday
];
50 for (my $i = 0; $i < $wcount; $i++) {
51 if (my $pid = fork ()) {
62 my $elapsed = int(tv_interval
($starttime) * 1000);
64 my $tpq = $elapsed / ($wcount*$qcount);
66 print "$host: $tpq ms per query\n";
69 run_tests
($hostname); # test 'pveproxy'