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
1ca64788
Commit
1ca64788
authored
Oct 10, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h2load: Use duration syntax for timeouts
parent
eb3505af
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
25 deletions
+25
-25
src/h2load.cc
src/h2load.cc
+23
-23
src/h2load.h
src/h2load.h
+2
-2
No files found.
src/h2load.cc
View file @
1ca64788
...
@@ -74,8 +74,8 @@ namespace h2load {
...
@@ -74,8 +74,8 @@ namespace h2load {
Config
::
Config
()
Config
::
Config
()
:
data_length
(
-
1
),
addrs
(
nullptr
),
nreqs
(
1
),
nclients
(
1
),
nthreads
(
1
),
:
data_length
(
-
1
),
addrs
(
nullptr
),
nreqs
(
1
),
nclients
(
1
),
nthreads
(
1
),
max_concurrent_streams
(
-
1
),
window_bits
(
30
),
connection_window_bits
(
30
),
max_concurrent_streams
(
-
1
),
window_bits
(
30
),
connection_window_bits
(
30
),
rate
(
0
),
rate_period
(
1.0
),
conn_active_timeout
(
0
),
rate
(
0
),
rate_period
(
1.0
),
conn_active_timeout
(
0
.
),
conn_inactivity_timeout
(
0
),
no_tls_proto
(
PROTO_HTTP2
),
data_fd
(
-
1
),
conn_inactivity_timeout
(
0
.
),
no_tls_proto
(
PROTO_HTTP2
),
data_fd
(
-
1
),
port
(
0
),
default_port
(
0
),
verbose
(
false
),
timing_script
(
false
)
{}
port
(
0
),
default_port
(
0
),
verbose
(
false
),
timing_script
(
false
)
{}
Config
::~
Config
()
{
Config
::~
Config
()
{
...
@@ -296,7 +296,7 @@ int Client::connect() {
...
@@ -296,7 +296,7 @@ int Client::connect() {
record_start_time
(
&
worker
->
stats
);
record_start_time
(
&
worker
->
stats
);
if
(
worker
->
config
->
conn_inactivity_timeout
>
0
)
{
if
(
worker
->
config
->
conn_inactivity_timeout
>
0
.
)
{
ev_timer_again
(
worker
->
loop
,
&
conn_inactivity_watcher
);
ev_timer_again
(
worker
->
loop
,
&
conn_inactivity_watcher
);
}
}
...
@@ -342,7 +342,7 @@ void Client::timeout() {
...
@@ -342,7 +342,7 @@ void Client::timeout() {
}
}
void
Client
::
restart_timeout
()
{
void
Client
::
restart_timeout
()
{
if
(
worker
->
config
->
conn_inactivity_timeout
>
0
)
{
if
(
worker
->
config
->
conn_inactivity_timeout
>
0
.
)
{
ev_timer_again
(
worker
->
loop
,
&
conn_inactivity_watcher
);
ev_timer_again
(
worker
->
loop
,
&
conn_inactivity_watcher
);
}
}
}
}
...
@@ -395,7 +395,7 @@ void Client::submit_request() {
...
@@ -395,7 +395,7 @@ void Client::submit_request() {
// if an active timeout is set and this is the last request to be submitted
// if an active timeout is set and this is the last request to be submitted
// on this connection, start the active timeout.
// on this connection, start the active timeout.
if
(
worker
->
config
->
conn_active_timeout
>
0
&&
req_started
>=
req_todo
)
{
if
(
worker
->
config
->
conn_active_timeout
>
0
.
&&
req_started
>=
req_todo
)
{
ev_timer_start
(
worker
->
loop
,
&
conn_active_watcher
);
ev_timer_start
(
worker
->
loop
,
&
conn_active_watcher
);
}
}
}
}
...
@@ -1385,20 +1385,20 @@ Options:
...
@@ -1385,20 +1385,20 @@ Options:
length of the period in time. This option is ignored if
length of the period in time. This option is ignored if
the rate option is not used. The default value for this
the rate option is not used. The default value for this
option is 1s.
option is 1s.
-T, --connection-active-timeout=<N>
-T, --connection-active-timeout=<
DURATIO
N>
Specifies the maximum time that h2load is willing to
Specifies the maximum time that h2load is willing to
keep a connection open, regardless of the activity on
keep a connection open, regardless of the activity on
said
connection. <N> must be a positive
integer,
said
connection. <DURATION> must be a positive
integer,
specifying
the number of seconds to wait. When no
specifying
the amount of time to wait. When no timeout
timeout value is set (either active or inactive), h2load
value is set (either active or inactive), h2load will
will keep a connection open indefinitely, waiting for
a
keep a connection open indefinitely, waiting for
a
response.
response.
-N, --connection-inactivity-timeout=<N>
-N, --connection-inactivity-timeout=<
DURATIO
N>
Specifies the amount of time that h2load is willing to
Specifies the amount of time that h2load is willing to
wait to see activity
on a given connection. <N> must be
wait to see activity
on a given connection. <DURATION>
a positive integer, specifying the number of seconds to
must be a positive integer, specifying the amount of
wait. When no timeout value is set (either active o
r
time to wait. When no timeout value is set (eithe
r
inactive), h2load will keep a connection
open
active or inactive), h2load will keep a connection
open
indefinitely, waiting for a response.
indefinitely, waiting for a response.
--timing-script-file=<PATH>
--timing-script-file=<PATH>
Path of a file containing one or more lines separated by
Path of a file containing one or more lines separated by
...
@@ -1586,18 +1586,18 @@ int main(int argc, char **argv) {
...
@@ -1586,18 +1586,18 @@ int main(int argc, char **argv) {
}
}
break
;
break
;
case
'T'
:
case
'T'
:
config
.
conn_active_timeout
=
strtoul
(
optarg
,
nullptr
,
10
);
config
.
conn_active_timeout
=
util
::
parse_duration_with_unit
(
optarg
);
if
(
config
.
conn_active_timeout
<=
0
)
{
if
(
!
std
::
isfinite
(
config
.
conn_active_timeout
)
)
{
std
::
cerr
<<
"-T:
the conn_active_timeout wait time
"
std
::
cerr
<<
"-T:
bad value for the conn_active_timeout wait time:
"
<<
"must be positive."
<<
std
::
endl
;
<<
optarg
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
break
;
break
;
case
'N'
:
case
'N'
:
config
.
conn_inactivity_timeout
=
strtoul
(
optarg
,
nullptr
,
10
);
config
.
conn_inactivity_timeout
=
util
::
parse_duration_with_unit
(
optarg
);
if
(
config
.
conn_inactivity_timeout
<=
0
)
{
if
(
!
std
::
isfinite
(
config
.
conn_inactivity_timeout
)
)
{
std
::
cerr
<<
"-N:
the conn_inactivity_timeout wait time
"
std
::
cerr
<<
"-N:
bad value for the conn_inactivity_timeout wait time:
"
<<
"must be positive."
<<
std
::
endl
;
<<
optarg
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
break
;
break
;
...
...
src/h2load.h
View file @
1ca64788
...
@@ -83,9 +83,9 @@ struct Config {
...
@@ -83,9 +83,9 @@ struct Config {
size_t
rate
;
size_t
rate
;
ev_tstamp
rate_period
;
ev_tstamp
rate_period
;
// amount of time to wait for activity on a given connection
// amount of time to wait for activity on a given connection
ssize_t
conn_active_timeout
;
ev_tstamp
conn_active_timeout
;
// amount of time to wait after the last request is made on a connection
// amount of time to wait after the last request is made on a connection
ssize_t
conn_inactivity_timeout
;
ev_tstamp
conn_inactivity_timeout
;
enum
{
enum
{
PROTO_HTTP2
,
PROTO_HTTP2
,
PROTO_SPDY2
,
PROTO_SPDY2
,
...
...
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