mirror of
https://github.com/linka-cloud/grpc.git
synced 2024-12-22 17:00:45 +00:00
metrics: add histogram support
Signed-off-by: Adphi <philippe.adrien.nousse@gmail.com>
This commit is contained in:
parent
d61f0e9d76
commit
8e490c0bae
@ -22,6 +22,7 @@ type ServerInterceptors interface {
|
||||
Registerer
|
||||
interceptors.ServerInterceptors
|
||||
prometheus.Collector
|
||||
EnableHandlingTimeHistogram(opts ...grpc_prometheus.HistogramOption)
|
||||
}
|
||||
|
||||
type ClientInterceptors interface {
|
||||
@ -33,6 +34,12 @@ type metrics struct {
|
||||
c *grpc_prometheus.ClientMetrics
|
||||
}
|
||||
|
||||
func (m *metrics) EnableHandlingTimeHistogram(opts ...grpc_prometheus.HistogramOption) {
|
||||
if m.s != nil {
|
||||
m.s.EnableHandlingTimeHistogram(opts...)
|
||||
}
|
||||
}
|
||||
|
||||
func (m *metrics) Describe(descs chan<- *prometheus.Desc) {
|
||||
if m.s != nil {
|
||||
m.s.Describe(descs)
|
||||
|
Loading…
Reference in New Issue
Block a user