mirror of
https://github.com/fluencelabs/go-libp2p-kad-dht
synced 2025-04-25 14:52:14 +00:00
Merge pull request #474 from libp2p/feat/log-names
give views names again
This commit is contained in:
commit
cf1c489d50
@ -41,55 +41,70 @@ var (
|
|||||||
SentBytes = stats.Int64("libp2p.io/dht/kad/sent_bytes", "Total sent bytes per RPC", stats.UnitBytes)
|
SentBytes = stats.Int64("libp2p.io/dht/kad/sent_bytes", "Total sent bytes per RPC", stats.UnitBytes)
|
||||||
)
|
)
|
||||||
|
|
||||||
var DefaultViews = []*view.View{
|
// Views
|
||||||
&view.View{
|
var (
|
||||||
|
ReceivedMessagesView = &view.View{
|
||||||
Measure: ReceivedMessages,
|
Measure: ReceivedMessages,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: view.Count(),
|
Aggregation: view.Count(),
|
||||||
},
|
}
|
||||||
&view.View{
|
ReceivedMessageErrorsView = &view.View{
|
||||||
Measure: ReceivedMessageErrors,
|
Measure: ReceivedMessageErrors,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: view.Count(),
|
Aggregation: view.Count(),
|
||||||
},
|
}
|
||||||
&view.View{
|
ReceivedBytesView = &view.View{
|
||||||
Measure: ReceivedBytes,
|
Measure: ReceivedBytes,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: defaultBytesDistribution,
|
Aggregation: defaultBytesDistribution,
|
||||||
},
|
}
|
||||||
&view.View{
|
InboundRequestLatencyView = &view.View{
|
||||||
Measure: InboundRequestLatency,
|
Measure: InboundRequestLatency,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: defaultMillisecondsDistribution,
|
Aggregation: defaultMillisecondsDistribution,
|
||||||
},
|
}
|
||||||
&view.View{
|
OutboundRequestLatencyView = &view.View{
|
||||||
Measure: OutboundRequestLatency,
|
Measure: OutboundRequestLatency,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: defaultMillisecondsDistribution,
|
Aggregation: defaultMillisecondsDistribution,
|
||||||
},
|
}
|
||||||
&view.View{
|
SentMessagesView = &view.View{
|
||||||
Measure: SentMessages,
|
Measure: SentMessages,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: view.Count(),
|
Aggregation: view.Count(),
|
||||||
},
|
}
|
||||||
&view.View{
|
SentMessageErrorsView = &view.View{
|
||||||
Measure: SentMessageErrors,
|
Measure: SentMessageErrors,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: view.Count(),
|
Aggregation: view.Count(),
|
||||||
},
|
}
|
||||||
&view.View{
|
SentRequestsView = &view.View{
|
||||||
Measure: SentRequests,
|
Measure: SentRequests,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: view.Count(),
|
Aggregation: view.Count(),
|
||||||
},
|
}
|
||||||
&view.View{
|
SentRequestErrorsView = &view.View{
|
||||||
Measure: SentRequestErrors,
|
Measure: SentRequestErrors,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: view.Count(),
|
Aggregation: view.Count(),
|
||||||
},
|
}
|
||||||
&view.View{
|
SentBytesView = &view.View{
|
||||||
Measure: SentBytes,
|
Measure: SentBytes,
|
||||||
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
|
||||||
Aggregation: defaultBytesDistribution,
|
Aggregation: defaultBytesDistribution,
|
||||||
},
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// DefaultViews with all views in it.
|
||||||
|
var DefaultViews = []*view.View{
|
||||||
|
ReceivedMessagesView,
|
||||||
|
ReceivedMessageErrorsView,
|
||||||
|
ReceivedBytesView,
|
||||||
|
InboundRequestLatencyView,
|
||||||
|
OutboundRequestLatencyView,
|
||||||
|
SentMessagesView,
|
||||||
|
SentMessageErrorsView,
|
||||||
|
SentRequestsView,
|
||||||
|
SentRequestErrorsView,
|
||||||
|
SentBytesView,
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user