Skip to content

Commit

Permalink
added some tests and docs
Browse files Browse the repository at this point in the history
Added tests for:
 - monitoring/counter
Also added a little docs for monitoring/counter

Pull Request resolved: #131
  • Loading branch information
JustSkiv authored and oke11o committed Nov 2, 2023
1 parent afd5191 commit 61a99ee
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/monitoring/counter.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ func (c *Counter) String() string {
return strconv.FormatInt(c.i.Load(), 10)
}

// Add adds given delta to a counter value
func (c *Counter) Add(delta int64) {
c.i.Add(delta)
}

// Set sets given value as counter value
func (c *Counter) Set(value int64) {
c.i.Store(value)
}

// Get returns counter value
func (c *Counter) Get() int64 {
return c.i.Load()
}
Expand Down

0 comments on commit 61a99ee

Please sign in to comment.