Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
p2p
go-p2p-kad-dht
Commits
cf1c489d
Unverified
Commit
cf1c489d
authored
Mar 03, 2020
by
Steven Allen
Committed by
GitHub
Mar 03, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #474 from libp2p/feat/log-names
give views names again
parents
c2631d95
315dea5b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
21 deletions
+36
-21
metrics/metrics.go
metrics/metrics.go
+36
-21
No files found.
metrics/metrics.go
View file @
cf1c489d
...
...
@@ -41,55 +41,70 @@ var (
SentBytes
=
stats
.
Int64
(
"libp2p.io/dht/kad/sent_bytes"
,
"Total sent bytes per RPC"
,
stats
.
UnitBytes
)
)
var
DefaultViews
=
[]
*
view
.
View
{
&
view
.
View
{
// Views
var
(
ReceivedMessagesView
=
&
view
.
View
{
Measure
:
ReceivedMessages
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
view
.
Count
(),
}
,
&
view
.
View
{
}
ReceivedMessageErrorsView
=
&
view
.
View
{
Measure
:
ReceivedMessageErrors
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
view
.
Count
(),
}
,
&
view
.
View
{
}
ReceivedBytesView
=
&
view
.
View
{
Measure
:
ReceivedBytes
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
defaultBytesDistribution
,
}
,
&
view
.
View
{
}
InboundRequestLatencyView
=
&
view
.
View
{
Measure
:
InboundRequestLatency
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
defaultMillisecondsDistribution
,
}
,
&
view
.
View
{
}
OutboundRequestLatencyView
=
&
view
.
View
{
Measure
:
OutboundRequestLatency
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
defaultMillisecondsDistribution
,
}
,
&
view
.
View
{
}
SentMessagesView
=
&
view
.
View
{
Measure
:
SentMessages
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
view
.
Count
(),
}
,
&
view
.
View
{
}
SentMessageErrorsView
=
&
view
.
View
{
Measure
:
SentMessageErrors
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
view
.
Count
(),
}
,
&
view
.
View
{
}
SentRequestsView
=
&
view
.
View
{
Measure
:
SentRequests
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
view
.
Count
(),
}
,
&
view
.
View
{
}
SentRequestErrorsView
=
&
view
.
View
{
Measure
:
SentRequestErrors
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
view
.
Count
(),
}
,
&
view
.
View
{
}
SentBytesView
=
&
view
.
View
{
Measure
:
SentBytes
,
TagKeys
:
[]
tag
.
Key
{
KeyMessageType
,
KeyPeerID
,
KeyInstanceID
},
Aggregation
:
defaultBytesDistribution
,
},
}
)
// DefaultViews with all views in it.
var
DefaultViews
=
[]
*
view
.
View
{
ReceivedMessagesView
,
ReceivedMessageErrorsView
,
ReceivedBytesView
,
InboundRequestLatencyView
,
OutboundRequestLatencyView
,
SentMessagesView
,
SentMessageErrorsView
,
SentRequestsView
,
SentRequestErrorsView
,
SentBytesView
,
}
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