Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
pve-manager
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
pve-manager
Commits
51215f02
Commit
51215f02
authored
Mar 28, 2013
by
Dietmar Maurer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup performance test
parent
9a98a0f2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
7 deletions
+8
-7
perftest1.pl
bin/test/perftest1.pl
+4
-4
perftest2.pl
bin/test/perftest2.pl
+0
-1
perftest3.pl
bin/test/perftest3.pl
+4
-2
No files found.
bin/test/perftest1.pl
View file @
51215f02
#!/usr/bin/perl -w
#!/usr/bin/perl -w
use
lib
'
../../
';
use
strict
;
use
strict
;
use
Time::
HiRes
qw( usleep ualarm gettimeofday tv_interval )
;
use
Time::
HiRes
qw( usleep ualarm gettimeofday tv_interval )
;
use
PVE::
API2Client
;
use
PVE::
API2Client
;
...
@@ -14,8 +14,8 @@ my $hostname = PVE::INotify::read_file("hostname");
...
@@ -14,8 +14,8 @@ 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
=
4
;
my
$wcount
=
1
;
my
$qcount
=
5
00
;
my
$qcount
=
1
00
;
sub
test_rpc
{
sub
test_rpc
{
my
(
$host
)
=
@_
;
my
(
$host
)
=
@_
;
...
@@ -68,7 +68,7 @@ sub run_tests {
...
@@ -68,7 +68,7 @@ sub run_tests {
print
"
$host
:
$tpq
ms per query
\n
";
print
"
$host
:
$tpq
ms per query
\n
";
}
}
# TODO: Apache is much slower, why?
# TODO: Apache is much slower, why?
(SSL?)
run_tests
("
localhost
");
# test 'pvedaemon'
run_tests
("
localhost
");
# test 'pvedaemon'
...
...
bin/test/perftest2.pl
View file @
51215f02
...
@@ -12,7 +12,6 @@ my $hostname = PVE::INotify::read_file("hostname");
...
@@ -12,7 +12,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 2 -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
";
bin/test/perftest3.pl
View file @
51215f02
...
@@ -15,7 +15,7 @@ my $hostname = PVE::INotify::read_file("hostname");
...
@@ -15,7 +15,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
=
2
;
my
$wcount
=
1
;
my
$qcount
=
100
;
my
$qcount
=
100
;
sub
test_rpc
{
sub
test_rpc
{
...
@@ -24,7 +24,7 @@ sub test_rpc {
...
@@ -24,7 +24,7 @@ sub test_rpc {
for
(
my
$i
=
0
;
$i
<
$qcount
;
$i
++
)
{
for
(
my
$i
=
0
;
$i
<
$qcount
;
$i
++
)
{
eval
{
eval
{
my
(
$page
,
$response
,
%
reply_headers
)
my
(
$page
,
$response
,
%
reply_headers
)
=
get_https
(
$host
name
,
8006
,
'
/api2/json
',
=
get_https
(
$host
,
8006
,
'
/api2/json
',
make_headers
(
Cookie
=>
"
PVEAuthCookie=
$ticket
"));
make_headers
(
Cookie
=>
"
PVEAuthCookie=
$ticket
"));
die
"
$response
\n
"
if
$response
!~
m/200 OK/
;
die
"
$response
\n
"
if
$response
!~
m/200 OK/
;
};
};
...
@@ -65,4 +65,6 @@ sub run_tests {
...
@@ -65,4 +65,6 @@ 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 'apache'
run_tests
(
$hostname
);
# test 'apache'
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment