2013-04-03 20:33:32 +04:00
|
|
|
// Copyright (c) 2013, Prometheus Team
|
2013-01-19 17:48:30 +04:00
|
|
|
// All rights reserved.
|
|
|
|
//
|
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
2012-05-24 22:02:44 +04:00
|
|
|
|
2013-04-03 20:33:32 +04:00
|
|
|
package prometheus
|
2012-05-24 22:02:44 +04:00
|
|
|
|
2013-06-27 20:46:16 +04:00
|
|
|
import (
|
|
|
|
"encoding/json"
|
|
|
|
|
|
|
|
dto "github.com/prometheus/client_model/go"
|
|
|
|
)
|
2013-04-19 16:11:01 +04:00
|
|
|
|
2013-01-19 17:48:30 +04:00
|
|
|
// A Metric is something that can be exposed via the registry framework.
|
2012-05-24 22:02:44 +04:00
|
|
|
type Metric interface {
|
2013-04-19 16:11:01 +04:00
|
|
|
// Produce a JSON representation of the metric.
|
|
|
|
json.Marshaler
|
2014-02-19 17:53:34 +04:00
|
|
|
// Reset removes any stored values associated with a given labelset.
|
|
|
|
Reset(labels map[string]string)
|
2013-01-19 17:48:30 +04:00
|
|
|
// Reset the parent metrics and delete all child metrics.
|
|
|
|
ResetAll()
|
|
|
|
// Produce a human-consumable representation of the metric.
|
2012-12-19 14:10:09 +04:00
|
|
|
String() string
|
2013-06-27 20:46:16 +04:00
|
|
|
// dumpChildren populates the child metrics of the given family.
|
|
|
|
dumpChildren(*dto.MetricFamily)
|
2012-05-24 22:02:44 +04:00
|
|
|
}
|