Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Counter ¶
type Counter struct {
// contains filtered or unexported fields
}
Counter implements Counter, via a Prometheus CounterVec.
func NewCounter ¶
func NewCounter(cv *prometheus.CounterVec) *Counter
NewCounter wraps the CounterVec and returns a usable Counter object.
func NewCounterFrom ¶
func NewCounterFrom(opts prometheus.CounterOpts, labelNames []string) *Counter
NewCounterFrom constructs and registers a Prometheus CounterVec, and returns a usable Counter object.
type Histogram ¶
type Histogram struct {
// contains filtered or unexported fields
}
Histogram implements Histogram via a Prometheus HistogramVec. The difference between a Histogram and a Summary is that Histograms require predefined quantile buckets, and can be statistically aggregated.
func NewHistogram ¶
func NewHistogram(hv *prometheus.HistogramVec) *Histogram
NewHistogram wraps the HistogramVec and returns a usable Histogram object.
func NewHistogramFrom ¶
func NewHistogramFrom(opts prometheus.HistogramOpts, labelNames []string) *Histogram
NewHistogramFrom constructs and registers a Prometheus HistogramVec, and returns a usable Histogram object.
func (*Histogram) With ¶
func (h *Histogram) With(labelValues ...string) IHistogram
With implements Histogram.
type ICounter ¶
Counter describes a metric that accumulates values monotonically. An example of a counter is the number of received HTTP requests.
type IHistogram ¶
type IHistogram interface { With(labelValues ...string) IHistogram Observe(value float64) }
Histogram describes a metric that takes repeated observations of the same kind of thing, and produces a statistical summary of those observations, typically expressed as quantiles or buckets. An example of a histogram is HTTP request latencies.
type LabelValues ¶
type LabelValues []string
func (LabelValues) With ¶
func (lvs LabelValues) With(labelValues ...string) LabelValues
type Metrics ¶
type Metrics struct { Counter ICounter Latency IHistogram }
func NewMetrics ¶
func NewMetrics(s *ghttp.Server, counter ICounter, latency IHistogram) *Metrics
func (*Metrics) MiddlewareServerTracing ¶
type Summary ¶
type Summary struct {
// contains filtered or unexported fields
}
Summary implements Histogram, via a Prometheus SummaryVec. The difference between a Summary and a Histogram is that Summaries don't require predefined quantile buckets, but cannot be statistically aggregated.
func NewSummary ¶
func NewSummary(sv *prometheus.SummaryVec) *Summary
NewSummary wraps the SummaryVec and returns a usable Summary object.
func NewSummaryFrom ¶
func NewSummaryFrom(opts prometheus.SummaryOpts, labelNames []string) *Summary
NewSummaryFrom constructs and registers a Prometheus SummaryVec, and returns a usable Summary object.
func (*Summary) With ¶
func (s *Summary) With(labelValues ...string) IHistogram
With implements Histogram.