Commit 315dea5b authored by Adrian Lanzafame's avatar Adrian Lanzafame Committed by Steven Allen

give views names again

parent c2631d95
...@@ -41,55 +41,70 @@ var ( ...@@ -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,
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment