Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
B
brpc
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
brpc
Commits
189ea690
Unverified
Commit
189ea690
authored
Oct 10, 2018
by
Ge Jun
Committed by
GitHub
Oct 10, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #529 from zyearn/h2unsent_throughput
add H2UnsentReq profiler
parents
50958b80
5947fed8
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
Makefile
Makefile
+8
-0
brpc_h2_unsent_message_unittest.cpp
test/brpc_h2_unsent_message_unittest.cpp
+3
-0
No files found.
Makefile
View file @
189ea690
...
...
@@ -276,6 +276,14 @@ output/bin:protoc-gen-mcpack
@
echo
"Compiling
$@
"
@
$(CXX)
-c
$(HDRPATHS)
$(CXXFLAGS)
$<
-o
$@
%http2_rpc_protocol.dbg.o
:
%http2_rpc_protocol.cpp
@
echo
"Compiling
$@
with O2"
@
$(CXX)
-c
$(HDRPATHS)
-O2
$(DEBUG_CXXFLAGS)
$<
-o
$@
%hpack.dbg.o
:
%hpack.cpp
@
echo
"Compiling
$@
with O2"
@
$(CXX)
-c
$(HDRPATHS)
-O2
$(DEBUG_CXXFLAGS)
$<
-o
$@
%.dbg.o
:
%.cpp
@
echo
"Compiling
$@
"
@
$(CXX)
-c
$(HDRPATHS)
$(DEBUG_CXXFLAGS)
$<
-o
$@
...
...
test/brpc_h2_unsent_message_unittest.cpp
View file @
189ea690
...
...
@@ -9,6 +9,7 @@
#include "butil/atomicops.h"
#include "brpc/policy/http_rpc_protocol.h"
#include "brpc/policy/http2_rpc_protocol.h"
#include "butil/gperftools_profiler.h"
int
main
(
int
argc
,
char
*
argv
[])
{
testing
::
InitGoogleTest
(
&
argc
,
argv
);
...
...
@@ -44,11 +45,13 @@ TEST(H2UnsentMessage, request_throughput) {
req_msgs
[
i
]
=
brpc
::
policy
::
H2UnsentRequest
::
New
(
&
cntl
);
}
butil
::
IOBuf
dummy_buf
;
ProfilerStart
(
"h2_unsent_req.prof"
);
int64_t
start_us
=
butil
::
gettimeofday_us
();
for
(
int
i
=
0
;
i
<
ntotal
;
++
i
)
{
req_msgs
[
i
]
->
AppendAndDestroySelf
(
&
dummy_buf
,
h2_client_sock
.
get
());
}
int64_t
end_us
=
butil
::
gettimeofday_us
();
ProfilerStop
();
int64_t
elapsed
=
end_us
-
start_us
;
LOG
(
INFO
)
<<
"H2UnsentRequest average qps="
<<
(
ntotal
*
1000000L
)
/
elapsed
<<
"/s, data throughput="
...
...
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