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
7cb28e88
Commit
7cb28e88
authored
Jun 06, 2014
by
Tatsuhiro Tsujikawa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
h2load: Return Stats rather than Worker from std::future
parent
aea4001d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
src/h2load.cc
src/h2load.cc
+4
-5
No files found.
src/h2load.cc
View file @
7cb28e88
...
@@ -551,11 +551,11 @@ std::string get_reqline(const char *uri, const http_parser_url& u)
...
@@ -551,11 +551,11 @@ std::string get_reqline(const char *uri, const http_parser_url& u)
}
// namespace
}
// namespace
namespace
{
namespace
{
std
::
unique_ptr
<
Worker
>
run
(
std
::
unique_ptr
<
Worker
>
worker
)
Stats
run
(
std
::
unique_ptr
<
Worker
>
worker
)
{
{
worker
->
run
();
worker
->
run
();
return
worker
;
return
worker
->
stats
;
}
}
}
// namespace
}
// namespace
...
@@ -898,7 +898,7 @@ int main(int argc, char **argv)
...
@@ -898,7 +898,7 @@ int main(int argc, char **argv)
std
::
cout
<<
"starting benchmark..."
<<
std
::
endl
;
std
::
cout
<<
"starting benchmark..."
<<
std
::
endl
;
std
::
vector
<
std
::
future
<
std
::
unique_ptr
<
Worker
>
>>
futures
;
std
::
vector
<
std
::
future
<
Stats
>>
futures
;
auto
start
=
std
::
chrono
::
steady_clock
::
now
();
auto
start
=
std
::
chrono
::
steady_clock
::
now
();
std
::
vector
<
std
::
unique_ptr
<
Worker
>>
workers
;
std
::
vector
<
std
::
unique_ptr
<
Worker
>>
workers
;
...
@@ -924,8 +924,7 @@ int main(int argc, char **argv)
...
@@ -924,8 +924,7 @@ int main(int argc, char **argv)
worker
.
run
();
worker
.
run
();
for
(
auto
&
fut
:
futures
)
{
for
(
auto
&
fut
:
futures
)
{
auto
subworker
=
fut
.
get
();
auto
stats
=
fut
.
get
();
auto
&
stats
=
subworker
->
stats
;
worker
.
stats
.
req_todo
+=
stats
.
req_todo
;
worker
.
stats
.
req_todo
+=
stats
.
req_todo
;
worker
.
stats
.
req_started
+=
stats
.
req_started
;
worker
.
stats
.
req_started
+=
stats
.
req_started
;
...
...
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