Skip to content

Commit

Permalink
add comments to functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Freddy committed Nov 29, 2023
1 parent a8f6efa commit d4c4c27
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions reporter/prometheus.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ import (
"github.com/prometheus/client_golang/prometheus/promauto"
)

// PrometheusReporter is a reporter that reports to prometheus
type PrometheusReporter struct {
missCounter prometheus.Counter
hitCounter prometheus.Counter
}

// NewPrometheusReporter creates a new prometheus reporter
// using NewPrometheusCounter to create the counters
func NewPrometheusReporter(
serviceName string,
cacheName string,
Expand All @@ -30,6 +33,11 @@ func NewPrometheusReporter(
}
}

// 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
func NewPrometheusCounter(
serviceName string,
cacheName string,
Expand Down

0 comments on commit d4c4c27

Please sign in to comment.