add ability to use prometheus compat histogram
Some checks failed
codeql / analyze (go) (push) Failing after 45s
build / test (push) Failing after 4m52s
build / lint (push) Successful in 9m31s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-11-09 19:49:45 +03:00
parent a239f86139
commit 4fef299e78
4 changed files with 33 additions and 7 deletions

View File

@@ -1,6 +1,7 @@
package victoriametrics
import (
"bytes"
"testing"
)
@@ -16,3 +17,13 @@ func TestBuildName(t *testing.T) {
cnt := m.Counter("counter", "key", "val")
cnt.Inc()
}
func TestPrometheusCompat(t *testing.T) {
m := NewMeter(PrometheusCompat(true))
m.Histogram("foo", "key", "val").Update(15)
buf := bytes.NewBuffer(nil)
_ = m.Write(buf)
t.Logf("\n%s", buf.Bytes())
}