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
46f670f8
Commit
46f670f8
authored
Aug 03, 2017
by
Soham Sinha
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
concurrent connections are created in timing-based mode. Some safety asserts added.
parent
4b44362b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
6 deletions
+22
-6
src/h2load.cc
src/h2load.cc
+22
-6
No files found.
src/h2load.cc
View file @
46f670f8
...
@@ -239,19 +239,26 @@ void rate_period_timeout_w_cb(struct ev_loop *loop, ev_timer *w, int revents) {
...
@@ -239,19 +239,26 @@ void rate_period_timeout_w_cb(struct ev_loop *loop, ev_timer *w, int revents) {
make_unique
<
Client
>
(
worker
->
next_client_id
++
,
worker
,
req_todo
);
make_unique
<
Client
>
(
worker
->
next_client_id
++
,
worker
,
req_todo
);
++
worker
->
nconns_made
;
++
worker
->
nconns_made
;
worker
->
clients
.
push_back
(
client
.
get
());
if
(
client
->
connect
()
!=
0
)
{
if
(
client
->
connect
()
!=
0
)
{
std
::
cerr
<<
"client could not connect to host"
<<
std
::
endl
;
std
::
cerr
<<
"client could not connect to host"
<<
std
::
endl
;
client
->
fail
();
client
->
fail
();
}
else
{
}
else
{
if
(
worker
->
config
->
is_timing_based_mode
())
{
worker
->
clients
.
push_back
(
client
.
get
());
}
client
.
release
();
client
.
release
();
}
}
worker
->
report_rate_progress
();
worker
->
report_rate_progress
();
}
}
if
(
!
worker
->
config
->
is_timing_based_mode
())
{
if
(
worker
->
nconns_made
>=
worker
->
nclients
)
{
if
(
worker
->
nconns_made
>=
worker
->
nclients
)
{
ev_timer_stop
(
worker
->
loop
,
w
);
ev_timer_stop
(
worker
->
loop
,
w
);
}
}
}
else
{
// To check whether all created clients are pushed correctly
assert
(
worker
->
nclients
==
worker
->
clients
.
size
());
}
}
}
}
// namespace
}
// namespace
...
@@ -845,6 +852,8 @@ void Client::on_stream_close(int32_t stream_id, bool success, bool final) {
...
@@ -845,6 +852,8 @@ void Client::on_stream_close(int32_t stream_id, bool success, bool final) {
++
worker
->
stats
.
req_failed
;
++
worker
->
stats
.
req_failed
;
++
worker
->
stats
.
req_error
;
++
worker
->
stats
.
req_error
;
}
}
// To avoid overflow error
assert
(
worker
->
stats
.
req_done
<=
worker
->
max_samples
);
++
worker
->
stats
.
req_done
;
++
worker
->
stats
.
req_done
;
++
req_done
;
++
req_done
;
}
}
...
@@ -974,7 +983,9 @@ int Client::connection_made() {
...
@@ -974,7 +983,9 @@ int Client::connection_made() {
record_connect_time
();
record_connect_time
();
if
(
!
config
.
timing_script
)
{
if
(
!
config
.
timing_script
)
{
auto
nreq
=
std
::
min
(
req_left
,
session
->
max_concurrent_streams
());
auto
nreq
=
config
.
is_timing_based_mode
()
?
std
::
max
(
req_left
,
session
->
max_concurrent_streams
())
:
std
::
min
(
req_left
,
session
->
max_concurrent_streams
());
for
(;
nreq
>
0
;
--
nreq
)
{
for
(;
nreq
>
0
;
--
nreq
)
{
if
(
submit_request
()
!=
0
)
{
if
(
submit_request
()
!=
0
)
{
process_request_failure
();
process_request_failure
();
...
@@ -1299,8 +1310,13 @@ Worker::Worker(uint32_t id, SSL_CTX *ssl_ctx, size_t req_todo, size_t nclients,
...
@@ -1299,8 +1310,13 @@ Worker::Worker(uint32_t id, SSL_CTX *ssl_ctx, size_t req_todo, size_t nclients,
config
->
rate_period
);
config
->
rate_period
);
timeout_watcher
.
data
=
this
;
timeout_watcher
.
data
=
this
;
if
(
config
->
is_timing_based_mode
())
{
stats
.
req_stats
.
reserve
(
std
::
max
(
req_todo
,
max_samples
));
stats
.
client_stats
.
reserve
(
std
::
max
(
nclients
,
max_samples
));
}
else
{
stats
.
req_stats
.
reserve
(
std
::
min
(
req_todo
,
max_samples
));
stats
.
req_stats
.
reserve
(
std
::
min
(
req_todo
,
max_samples
));
stats
.
client_stats
.
reserve
(
std
::
min
(
nclients
,
max_samples
));
stats
.
client_stats
.
reserve
(
std
::
min
(
nclients
,
max_samples
));
}
sampling_init
(
request_times_smp
,
req_todo
,
max_samples
);
sampling_init
(
request_times_smp
,
req_todo
,
max_samples
);
sampling_init
(
client_smp
,
nclients
,
max_samples
);
sampling_init
(
client_smp
,
nclients
,
max_samples
);
...
...
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