34 lines
516 B
Go
34 lines
516 B
Go
package metric
|
|
|
|
import (
|
|
"math/rand"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestName(t *testing.T) {
|
|
c := NewConfg()
|
|
c.Address = "http://14.22.116.197:9305"
|
|
c.Interval = 1
|
|
Init(c)
|
|
for i := 0; i < 100; i++ {
|
|
Metric("test.test.b", 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",
|
|
})
|
|
|
|
}
|