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
eb3505af
Commit
eb3505af
authored
Oct 13, 2015
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'h2load-subsecond-rate-period'
parents
3f4b6f2b
47f1d17a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
26 deletions
+23
-26
src/h2load.cc
src/h2load.cc
+19
-23
src/util.h
src/util.h
+4
-3
No files found.
src/h2load.cc
View file @
eb3505af
...
...
@@ -1261,7 +1261,7 @@ std::unique_ptr<Worker> create_worker(uint32_t id, SSL_CTX *ssl_ctx,
std
::
stringstream
rate_report
;
if
(
config
.
is_rate_mode
()
&&
nclients
>
rate
)
{
rate_report
<<
"Up to "
<<
rate
<<
" client(s) will be created every "
<<
std
::
setprecision
(
3
)
<<
config
.
rate_period
<<
" seconds.
"
;
<<
util
::
duration_str
(
config
.
rate_period
)
<<
"
"
;
}
std
::
cout
<<
"spawning thread #"
<<
id
<<
": "
<<
nclients
...
...
@@ -1379,12 +1379,12 @@ Options:
will run as it normally does, creating connections at
whatever variable rate it wants. The default value for
this option is 0.
--rate-period=<N>
Specifies the time
period
between creating connections.
The
period must be a positive number greater than or
equal to 1.0, representing the length of the period in
seconds. This option is ignored if the rate option
is
not used. The default value for this option is 1.0
.
--rate-period=<
DURATIO
N>
Specifies the time
period
between creating connections.
The
period must be a positive number, representing the
length of the period in time. This option is ignored if
the rate option is not used. The default value for th
is
option is 1s
.
-T, --connection-active-timeout=<N>
Specifies the maximum time that h2load is willing to
keep a connection open, regardless of the activity on
...
...
@@ -1434,7 +1434,14 @@ Options:
-v, --verbose
Output debug information.
--version Display version information and exit.
-h, --help Display this help and exit.)"
<<
std
::
endl
;
-h, --help Display this help and exit.
--
The <DURATION> argument is an integer and an optional unit (e.g., 1s
is 1 second and 500ms is 500 milliseconds). Units are h, m, s or ms
(hours, minutes, seconds and milliseconds, respectively). If a unit
is omitted, a second is used as unit.)"
<<
std
::
endl
;
}
}
// namespace
...
...
@@ -1629,26 +1636,15 @@ int main(int argc, char **argv) {
// npn-list option
config
.
npn_list
=
util
::
parse_config_str_list
(
optarg
);
break
;
case
5
:
{
case
5
:
// rate-period
const
char
*
start
=
optarg
;
char
*
end
;
errno
=
0
;
auto
v
=
std
::
strtod
(
start
,
&
end
);
if
(
v
<
1.0
||
!
std
::
isfinite
(
v
)
||
end
==
start
||
errno
!=
0
)
{
auto
error
=
errno
;
std
::
cerr
<<
"Rate period value error "
<<
optarg
<<
std
::
endl
;
if
(
error
!=
0
)
{
std
::
cerr
<<
"
\n\t
"
<<
strerror
(
error
)
<<
std
::
endl
;
}
config
.
rate_period
=
util
::
parse_duration_with_unit
(
optarg
);
if
(
!
std
::
isfinite
(
config
.
rate_period
))
{
std
::
cerr
<<
"--rate-period: value error "
<<
optarg
<<
std
::
endl
;
exit
(
EXIT_FAILURE
);
}
config
.
rate_period
=
v
;
break
;
}
}
break
;
default:
break
;
...
...
src/util.h
View file @
eb3505af
...
...
@@ -659,9 +659,10 @@ int64_t parse_uint(const std::string &s);
// Parses NULL terminated string |s| as unsigned integer and returns
// the parsed integer casted to double. If |s| ends with "s", the
// parsed value's unit is a second. If |s| ends with "ms", the unit
// is millisecond. If none of them are given, the unit is second.
// This function returns std::numeric_limits<double>::infinity() if
// error occurs.
// is millisecond. Similarly, it also supports 'm' and 'h' for
// minutes and hours respectively. If none of them are given, the
// unit is second. This function returns
// std::numeric_limits<double>::infinity() if error occurs.
double
parse_duration_with_unit
(
const
char
*
s
);
// Returns string representation of time duration |t|. If t has
...
...
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