Unverified Commit 691b1e5f authored by Matt Joiner's avatar Matt Joiner Committed by GitHub

Expose metrics views in a slice (#327)

* Expose metrics views in a slice

* Rename Views to DefaultViews

This communicates that these aren't the only views that are possible, or that they should be considered mandatory.
parent 080cd526
......@@ -41,56 +41,55 @@ var (
SentBytes = stats.Int64("libp2p.io/dht/kad/sent_bytes", "Total sent bytes per RPC", stats.UnitBytes)
)
// Views
var (
ReceivedMessagesView = &view.View{
var DefaultViews = []*view.View{
&view.View{
Measure: ReceivedMessages,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: view.Count(),
}
ReceivedMessageErrorsView = &view.View{
},
&view.View{
Measure: ReceivedMessageErrors,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: view.Count(),
}
ReceivedBytesView = &view.View{
},
&view.View{
Measure: ReceivedBytes,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: defaultBytesDistribution,
}
InboundRequestLatencyView = &view.View{
},
&view.View{
Measure: InboundRequestLatency,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: defaultMillisecondsDistribution,
}
OutboundRequestLatencyView = &view.View{
},
&view.View{
Measure: OutboundRequestLatency,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: defaultMillisecondsDistribution,
}
SentMessagesView = &view.View{
},
&view.View{
Measure: SentMessages,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: view.Count(),
}
SentMessageErrorsView = &view.View{
},
&view.View{
Measure: SentMessageErrors,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: view.Count(),
}
SentRequestsView = &view.View{
},
&view.View{
Measure: SentRequests,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: view.Count(),
}
SentRequestErrorsView = &view.View{
},
&view.View{
Measure: SentRequestErrors,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: view.Count(),
}
SentBytesView = &view.View{
},
&view.View{
Measure: SentBytes,
TagKeys: []tag.Key{KeyMessageType, KeyPeerID, KeyInstanceID},
Aggregation: defaultBytesDistribution,
}
)
},
}
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