Skip to content

Commit

Permalink
Add convenient methods
Browse files Browse the repository at this point in the history
  • Loading branch information
alpinskiy committed Dec 12, 2024
1 parent 682adf0 commit d61f293
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions statshouse.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ func Unique(name string, tags Tags, value int64) {
globalClient.Unique(name, tags, value)
}

func Uniques(name string, tags Tags, values []int64) {
globalClient.Uniques(name, tags, values)
}

func UniqueHistoric(name string, tags Tags, value int64, tsUnixSec uint32) {
globalClient.UniqueHistoric(name, tags, value, tsUnixSec)
}
Expand Down Expand Up @@ -960,6 +964,14 @@ type bucket struct {
emptySendCount int
}

func (m *MetricRef) IsValid() bool {
return m.bucket != nil
}

func (m *MetricRef) IsNil() bool {
return m.bucket == nil
}

// Count records the number of events or observations.
func (m *MetricRef) Count(n float64) {
m.CountHistoric(n, 0)
Expand Down

0 comments on commit d61f293

Please sign in to comment.