From 61a99eee935eaad9e5ca4d0dd93e8e992c09e609 Mon Sep 17 00:00:00 2001 From: Nikolay Tuzov Date: Thu, 2 Nov 2023 18:04:07 +0300 Subject: [PATCH] added some tests and docs Added tests for: - monitoring/counter Also added a little docs for monitoring/counter Pull Request resolved: https://github.com/yandex/pandora/pull/131 --- lib/monitoring/counter.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/monitoring/counter.go b/lib/monitoring/counter.go index 17d4e8972..6c8744014 100644 --- a/lib/monitoring/counter.go +++ b/lib/monitoring/counter.go @@ -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() }