pve-manager/test/perftest2.pl
Thomas Lamprecht 8f01459822 cleanup: move bin/test to toplevel
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2018-06-20 13:04:51 +02:00

19 lines
531 B
Perl
Executable File

#!/usr/bin/perl
use lib '../../';
use strict;
use warnings;
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 10 -n 1000 -k -C 'PVEAuthCookie=$ticket' https://$hostname:8006/api2/json";
print "$cmd\n";
system($cmd) == 0 || die "command failed - $!\n";