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
b564dd56
Commit
b564dd56
authored
Jun 19, 2019
by
zhujiashun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make RpcDumpMeta be member of SampledRequest
parent
231b35af
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
rpc_dump.cpp
src/brpc/rpc_dump.cpp
+2
-2
rpc_dump.h
src/brpc/rpc_dump.h
+2
-2
No files found.
src/brpc/rpc_dump.cpp
View file @
b564dd56
...
...
@@ -240,7 +240,7 @@ bool RpcDumpContext::Serialize(butil::IOBuf& buf, SampledRequest* sample) {
const
size_t
starting_size
=
buf
.
size
();
butil
::
IOBufAsZeroCopyOutputStream
buf_stream
(
&
buf
);
if
(
!
sample
->
SerializeToZeroCopyStream
(
&
buf_stream
))
{
if
(
!
sample
->
meta
.
SerializeToZeroCopyStream
(
&
buf_stream
))
{
LOG
(
ERROR
)
<<
"Fail to serialize"
;
return
false
;
}
...
...
@@ -349,7 +349,7 @@ SampledRequest* SampleIterator::Pop(butil::IOBuf& buf, bool* format_error) {
butil
::
IOBuf
meta_buf
;
buf
.
cutn
(
&
meta_buf
,
meta_size
);
std
::
unique_ptr
<
SampledRequest
>
req
(
new
SampledRequest
);
if
(
!
ParsePbFromIOBuf
(
req
.
get
()
,
meta_buf
))
{
if
(
!
ParsePbFromIOBuf
(
&
req
->
meta
,
meta_buf
))
{
LOG
(
ERROR
)
<<
"Fail to parse RpcDumpMeta"
;
*
format_error
=
true
;
return
NULL
;
...
...
src/brpc/rpc_dump.h
View file @
b564dd56
...
...
@@ -46,9 +46,9 @@ DECLARE_bool(rpc_dump);
// In practice, sampled requests are just small fraction of all requests.
// The overhead of sampling should be negligible for overall performance.
struct
SampledRequest
:
public
bvar
::
Collected
,
public
RpcDumpMeta
{
struct
SampledRequest
:
public
bvar
::
Collected
{
butil
::
IOBuf
request
;
RpcDumpMeta
meta
;
// Implement methods of Sampled.
void
dump_and_destroy
(
size_t
round
)
override
;
...
...
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