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