{"modulePath":"github.com/eric-erki/https-hyperledger.org","version":"v1.4.4","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package metrics\n\n## Types\n\n```go\ntype Counter interface {\n\t// With is used to provide label values when updating a Counter. This must be\n\t// used to provide values for all LabelNames provided to CounterOpts.\n\tWith(labelValues ...string) Counter\n\n\t// Add increments a counter value.\n\tAdd(delta float64)\n}\n```\nA Counter represents a monotonically increasing value.\n\n```go\ntype CounterOpts struct {\n\t// Namespace, Subsystem, and Name are components of the fully-qualified name\n\t// of the Metric. The fully-qualified aneme is created by joining these\n\t// components with an appropriate separator. Only Name is mandatory, the\n\t// others merely help structuring the name.\n\tNamespace string\n\tSubsystem string\n\tName      string\n\n\t// Help provides information about this metric.\n\tHelp string\n\n\t// LabelNames provides the names of the labels that can be attached to this\n\t// metric. When a metric is recorded, label values must be provided for each\n\t// of these label names.\n\tLabelNames []string\n\n\t// StatsdFormat determines how the fully-qualified statsd bucket name is\n\t// constructed from Namespace, Subsystem, Name, and Labels. This is done by\n\t// including field references in `%{reference}` escape sequences.\n\t//\n\t// The following reference names are supported:\n\t// - #namespace   - the value of Namespace\n\t// - #subsystem   - the value of Subsystem\n\t// - #name        - the value of Name\n\t// - #fqname      - the fully-qualified metric name\n\t// - label_name   - the value associated with the named label\n\t//\n\t// The result of the formatting must be a valid statsd bucket name.\n\tStatsdFormat string\n}\n```\nCounterOpts is used to provide basic information about a counter to the metrics subsystem.\n\n```go\ntype Gauge interface {\n\t// With is used to provide label values when recording a Gauge value. This\n\t// must be used to provide values for all LabelNames provided to GaugeOpts.\n\tWith(labelValues ...string) Gauge\n\n\t// Add increments a Gauge value.\n\tAdd(delta float64) // TODO: consider removing\n\n\t// Set is used to update the current value associted with a Gauge.\n\tSet(value float64)\n}\n```\nA Gauge is a meter that expresses the current value of some metric.\n\n```go\ntype GaugeOpts struct {\n\t// Namespace, Subsystem, and Name are components of the fully-qualified name\n\t// of the Metric. The fully-qualified aneme is created by joining these\n\t// components with an appropriate separator. Only Name is mandatory, the\n\t// others merely help structuring the name.\n\tNamespace string\n\tSubsystem string\n\tName      string\n\n\t// Help provides information about this metric.\n\tHelp string\n\n\t// LabelNames provides the names of the labels that can be attached to this\n\t// metric. When a metric is recorded, label values must be provided for each\n\t// of these label names.\n\tLabelNames []string\n\n\t// StatsdFormat determines how the fully-qualified statsd bucket name is\n\t// constructed from Namespace, Subsystem, Name, and Labels. This is done by\n\t// including field references in `%{reference}` escape sequences.\n\t//\n\t// The following reference names are supported:\n\t// - #namespace   - the value of Namespace\n\t// - #subsystem   - the value of Subsystem\n\t// - #name        - the value of Name\n\t// - #fqname      - the fully-qualified metric name\n\t// - label_name   - the value associated with the named label\n\t//\n\t// The result of the formatting must be a valid statsd bucket name.\n\tStatsdFormat string\n}\n```\nGaugeOpts is used to provide basic information about a gauge to the metrics subsystem.\n\n```go\ntype Histogram interface {\n\t// With is used to provide label values when recording a Histogram\n\t// observation. This must be used to provide values for all LabelNames\n\t// provided to HistogramOpts.\n\tWith(labelValues ...string) Histogram\n\tObserve(value float64)\n}\n```\nA Histogram is a meter that records an observed value into quantized buckets.\n\n```go\ntype HistogramOpts struct {\n\t// Namespace, Subsystem, and Name are components of the fully-qualified name\n\t// of the Metric. The fully-qualified aneme is created by joining these\n\t// components with an appropriate separator. Only Name is mandatory, the\n\t// others merely help structuring the name.\n\tNamespace string\n\tSubsystem string\n\tName      string\n\n\t// Help provides information about this metric.\n\tHelp string\n\n\t// Buckets can be used to provide the bucket boundaries for Prometheus. When\n\t// omitted, the default Prometheus bucket values are used.\n\tBuckets []float64\n\n\t// LabelNames provides the names of the labels that can be attached to this\n\t// metric. When a metric is recorded, label values must be provided for each\n\t// of these label names.\n\tLabelNames []string\n\n\t// StatsdFormat determines how the fully-qualified statsd bucket name is\n\t// constructed from Namespace, Subsystem, Name, and Labels. This is done by\n\t// including field references in `%{reference}` escape sequences.\n\t//\n\t// The following reference names are supported:\n\t// - #namespace   - the value of Namespace\n\t// - #subsystem   - the value of Subsystem\n\t// - #name        - the value of Name\n\t// - #fqname      - the fully-qualified metric name\n\t// - label_name   - the value associated with the named label\n\t//\n\t// The result of the formatting must be a valid statsd bucket name.\n\tStatsdFormat string\n}\n```\nHistogramOpts is used to provide basic information about a histogram to the metrics subsystem.\n\n```go\ntype Provider interface {\n\t// NewCounter creates a new instance of a Counter.\n\tNewCounter(CounterOpts) Counter\n\t// NewGauge creates a new instance of a Gauge.\n\tNewGauge(GaugeOpts) Gauge\n\t// NewHistogram creates a new instance of a Histogram.\n\tNewHistogram(HistogramOpts) Histogram\n}\n```\nA Provider is an abstraction for a metrics provider. It is a factory for Counter, Gauge, and Histogram meters.\n\n","path":"github.com/eric-erki/https-hyperledger.org/common/metrics","name":"metrics","synopsis":"","isRedistributable":true}
