pve-manager/test/perftest2.pl

19 lines
531 B
Perl
Raw Normal View History

2016-12-28 11:34:01 +01:00
#!/usr/bin/perl
2013-03-28 09:20:02 +01:00
use lib '../../';
use strict;
2016-12-28 11:34:01 +01:00
use warnings;
2013-03-28 09:20:02 +01:00
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";
2013-03-28 09:20:02 +01:00
print "$cmd\n";
system($cmd) == 0 || die "command failed - $!\n";