gosdk/metric/metric_test.go

33 lines
495 B
Go
Raw Normal View History

2024-01-21 18:12:39 +08:00
package metric
import (
"math/rand"
"testing"
"time"
)
func TestName(t *testing.T) {
c := NewConfg()
c.Address = "https://monitor.batiao8.com"
Init(c)
for i := 0; i < 100; i++ {
Metric("test", float64(rand.Int()%100), map[string]string{
"a": "b",
"c": "d",
})
time.Sleep(time.Second)
}
}
func TestMetric(t *testing.T) {
c := NewConfg()
c.Address = "https://monitor.batiao8.com"
Init(c)
Metric("test.test1.test2", 12, map[string]string{
"a": "b",
"c": "d",
})
}