summaryrefslogtreecommitdiff
path: root/service/metrics/rpc.go
diff options
context:
space:
mode:
authorWolfy-J <[email protected]>2019-06-27 14:42:39 +0300
committerWolfy-J <[email protected]>2019-06-27 14:42:39 +0300
commit39a2eac13074a209d17f03930223542ff0af8766 (patch)
treef74d5912e38351db09b4d69fec6a4e316d96100a /service/metrics/rpc.go
parent7606e1cfddd26d2848923dc1079d9fb2858e84f1 (diff)
more tests
Diffstat (limited to 'service/metrics/rpc.go')
-rw-r--r--service/metrics/rpc.go21
1 files changed, 2 insertions, 19 deletions
diff --git a/service/metrics/rpc.go b/service/metrics/rpc.go
index ca99d4ac..ee8ef984 100644
--- a/service/metrics/rpc.go
+++ b/service/metrics/rpc.go
@@ -53,25 +53,8 @@ func (rpc *rpcServer) Add(m *Metric, ok *bool) (err error) {
c.(*prometheus.CounterVec).WithLabelValues(m.Labels...).Add(m.Value)
- case prometheus.Summary:
- c.(prometheus.Counter).Add(m.Value)
-
- case *prometheus.SummaryVec:
- if len(m.Labels) == 0 {
- return fmt.Errorf("required labels for collector `%s`", m.Name)
- }
-
- c.(*prometheus.SummaryVec).WithLabelValues(m.Labels...).Observe(m.Value)
-
- case prometheus.Histogram:
- c.(prometheus.Histogram).Observe(m.Value)
-
- case *prometheus.HistogramVec:
- if len(m.Labels) == 0 {
- return fmt.Errorf("required labels for collector `%s`", m.Name)
- }
-
- c.(*prometheus.HistogramVec).WithLabelValues(m.Labels...).Observe(m.Value)
+ default:
+ return fmt.Errorf("collector `%s` does not support method `Add`", m.Name)
}
*ok = true