reporter

package
v2.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewPrometheusCounter

func NewPrometheusCounter(
	serviceName string,
	cacheName string,
	counterType string,
) prometheus.Counter

NewPrometheusCounter creates a new prometheus counter serviceName: the name of the service cacheName: the name of the cache counterType: the type of the counter build the counter name as: serviceName_counterType_total

Types

type Default

type Default struct{}

func (*Default) ReportHit

func (d *Default) ReportHit()

func (*Default) ReportMiss

func (d *Default) ReportMiss()

type PrometheusReporter

type PrometheusReporter struct {
	// contains filtered or unexported fields
}

PrometheusReporter is a reporter that reports to prometheus

func NewPrometheusReporter

func NewPrometheusReporter(
	serviceName string,
	cacheName string,
) *PrometheusReporter

NewPrometheusReporter creates a new prometheus reporter using NewPrometheusCounter to create the counters

func (*PrometheusReporter) ReportHit added in v2.4.2

func (pr *PrometheusReporter) ReportHit()

ReportHit reports a cache hit

func (*PrometheusReporter) ReportMiss added in v2.4.2

func (pr *PrometheusReporter) ReportMiss()

ReportMiss reports a cache miss

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL