reporter

package
v3.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 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

func (pr *PrometheusReporter) ReportHit()

ReportHit reports a cache hit

func (*PrometheusReporter) ReportMiss

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