Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
nghttp2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
nghttp2
Commits
23ac0429
Commit
23ac0429
authored
Jan 05, 2016
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h2load: Show progress in rate mode
parent
7ed26afe
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
12 deletions
+27
-12
src/h2load.cc
src/h2load.cc
+25
-11
src/h2load.h
src/h2load.h
+2
-1
No files found.
src/h2load.cc
View file @
23ac0429
...
...
@@ -173,6 +173,7 @@ void rate_period_timeout_w_cb(struct ev_loop *loop, ev_timer *w, int revents) {
}
else
{
client
.
release
();
}
worker
->
report_rate_progress
();
}
if
(
worker
->
nconns_made
>=
worker
->
nclients
)
{
ev_timer_stop
(
worker
->
loop
,
w
);
...
...
@@ -484,15 +485,6 @@ void Client::process_request_failure() {
}
}
void
Client
::
report_progress
()
{
if
(
!
worker
->
config
->
is_rate_mode
()
&&
worker
->
id
==
0
&&
worker
->
stats
.
req_done
%
worker
->
progress_interval
==
0
)
{
std
::
cout
<<
"progress: "
<<
worker
->
stats
.
req_done
*
100
/
worker
->
stats
.
req_todo
<<
"% done"
<<
std
::
endl
;
}
}
namespace
{
void
print_server_tmp_key
(
SSL
*
ssl
)
{
// libressl does not have SSL_get_server_tmp_key
...
...
@@ -647,7 +639,7 @@ void Client::on_stream_close(int32_t stream_id, bool success, bool final) {
worker
->
sample_req_stat
(
req_stat
);
}
report_progress
();
worker
->
report_progress
();
streams
.
erase
(
stream_id
);
if
(
req_done
==
req_todo
)
{
terminate_session
();
...
...
@@ -1070,7 +1062,11 @@ Worker::Worker(uint32_t id, SSL_CTX *ssl_ctx, size_t req_todo, size_t nclients,
nreqs_per_client
(
req_todo
/
nclients
),
nreqs_rem
(
req_todo
%
nclients
),
rate
(
rate
),
next_client_id
(
0
)
{
stats
.
req_todo
=
req_todo
;
progress_interval
=
std
::
max
(
static_cast
<
size_t
>
(
1
),
req_todo
/
10
);
if
(
!
config
->
is_rate_mode
())
{
progress_interval
=
std
::
max
(
static_cast
<
size_t
>
(
1
),
req_todo
/
10
);
}
else
{
progress_interval
=
std
::
max
(
static_cast
<
size_t
>
(
1
),
nclients
/
10
);
}
// create timer that will go off every rate_period
ev_timer_init
(
&
timeout_watcher
,
rate_period_timeout_w_cb
,
0.
,
...
...
@@ -1117,6 +1113,24 @@ void Worker::sample_req_stat(RequestStat *req_stat) {
assert
(
stats
.
req_stats
.
size
()
<=
MAX_STATS
);
}
void
Worker
::
report_progress
()
{
if
(
id
!=
0
||
config
->
is_rate_mode
()
||
stats
.
req_done
%
progress_interval
)
{
return
;
}
std
::
cout
<<
"progress: "
<<
stats
.
req_done
*
100
/
stats
.
req_todo
<<
"% done"
<<
std
::
endl
;
}
void
Worker
::
report_rate_progress
()
{
if
(
id
!=
0
||
nconns_made
%
progress_interval
)
{
return
;
}
std
::
cout
<<
"progress: "
<<
nconns_made
*
100
/
nclients
<<
"% of clients started"
<<
std
::
endl
;
}
namespace
{
// Returns percentage of number of samples within mean +/- sd.
double
within_sd
(
const
std
::
vector
<
double
>
&
samples
,
double
mean
,
double
sd
)
{
...
...
src/h2load.h
View file @
23ac0429
...
...
@@ -238,6 +238,8 @@ struct Worker {
Worker
(
Worker
&&
o
)
=
default
;
void
run
();
void
sample_req_stat
(
RequestStat
*
req_stat
);
void
report_progress
();
void
report_rate_progress
();
};
struct
Stream
{
...
...
@@ -292,7 +294,6 @@ struct Client {
void
process_request_failure
();
void
process_timedout_streams
();
void
process_abandoned_streams
();
void
report_progress
();
void
report_tls_info
();
void
report_app_info
();
void
terminate_session
();
...
...
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