Skip to content

Commit

Permalink
comments fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Vamsi-Mundra committed May 8, 2024
1 parent e7f1ea2 commit c849ede
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions go-kit/metrics/testmetrics/metrics.go
Expand Up @@ -104,7 +104,8 @@ func (h *Histogram) With(labelValues ...string) metrics.Histogram {
return h.p.newHistogram(h.name, lvs...)
}

// Counter accumulates a value based on Add calls.
// CardinalityCounter provides a wrapper around a HyperLogLog probabalistic
// counter. It implements CardinalityCounter Interface.
type CardinalityCounter struct {
Name string
lvs []string
Expand All @@ -114,8 +115,7 @@ type CardinalityCounter struct {
sync.RWMutex
}

// With returns a new UniqueCounter with the passed in label values merged
// with the previous label values. The counter's values are copied.
// With implements xmetrics.CardinalityCounter interface. It returns a CardinalityCounter based on the labelValues.
func (c *CardinalityCounter) With(labelValues ...string) xmetrics.CardinalityCounter {
lvs := append(append([]string(nil), c.lvs...), labelValues...)
return c.p.newCardinalityCounter(c.Name, lvs...)
Expand Down
2 changes: 1 addition & 1 deletion go-kit/metrics/testmetrics/provider.go
Expand Up @@ -332,7 +332,7 @@ func (p *Provider) CheckCardinalityCounter(name string, estimate uint64, labelVa
p.t.Fatalf("no counter named %s out of available cardinality counters: \n%s", k, available)
}
actualEstimate := cc.Estimate()
if cc.Estimate() != actualEstimate {
if estimate != actualEstimate {
p.t.Fatalf("%v = %v, want %v", name, actualEstimate, estimate)
}

Expand Down

0 comments on commit c849ede

Please sign in to comment.