good morning!!!!
Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
bor
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Harbor Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
open
bor
Commits
c42d1390
Unverified
Commit
c42d1390
authored
Jun 24, 2020
by
Péter Szilágyi
Committed by
GitHub
Jun 24, 2020
Browse files
Options
Downloads
Plain Diff
Merge pull request #21256 from karalabe/p2p-packet-metrics
p2p: measure packet throughput too, not just bandwidth
parents
dce533c2
42ccb2fd
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
p2p/peer.go
+1
-0
1 addition, 0 deletions
p2p/peer.go
p2p/rlpx.go
+1
-0
1 addition, 0 deletions
p2p/rlpx.go
with
2 additions
and
0 deletions
p2p/peer.go
+
1
−
0
View file @
c42d1390
...
...
@@ -304,6 +304,7 @@ func (p *Peer) handle(msg Msg) error {
if
metrics
.
Enabled
{
m
:=
fmt
.
Sprintf
(
"%s/%s/%d/%#02x"
,
ingressMeterName
,
proto
.
Name
,
proto
.
Version
,
msg
.
Code
-
proto
.
offset
)
metrics
.
GetOrRegisterMeter
(
m
,
nil
)
.
Mark
(
int64
(
msg
.
meterSize
))
metrics
.
GetOrRegisterMeter
(
m
+
"/packets"
,
nil
)
.
Mark
(
1
)
}
select
{
case
proto
.
in
<-
msg
:
...
...
This diff is collapsed.
Click to expand it.
p2p/rlpx.go
+
1
−
0
View file @
c42d1390
...
...
@@ -597,6 +597,7 @@ func (rw *rlpxFrameRW) WriteMsg(msg Msg) error {
if
metrics
.
Enabled
&&
msg
.
meterCap
.
Name
!=
""
{
// don't meter non-subprotocol messages
m
:=
fmt
.
Sprintf
(
"%s/%s/%d/%#02x"
,
egressMeterName
,
msg
.
meterCap
.
Name
,
msg
.
meterCap
.
Version
,
msg
.
meterCode
)
metrics
.
GetOrRegisterMeter
(
m
,
nil
)
.
Mark
(
int64
(
msg
.
meterSize
))
metrics
.
GetOrRegisterMeter
(
m
+
"/packets"
,
nil
)
.
Mark
(
1
)
}
// write header
headbuf
:=
make
([]
byte
,
32
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment