opentsdb_test.go 438 B

123456789101112131415161718192021
  1. package metrics
  2. import (
  3. "net"
  4. "time"
  5. )
  6. func ExampleOpenTSDB() {
  7. addr, _ := net.ResolveTCPAddr("net", ":2003")
  8. go OpenTSDB(DefaultRegistry, 1*time.Second, "some.prefix", addr)
  9. }
  10. func ExampleOpenTSDBWithConfig() {
  11. addr, _ := net.ResolveTCPAddr("net", ":2003")
  12. go OpenTSDBWithConfig(OpenTSDBConfig{
  13. Addr: addr,
  14. Registry: DefaultRegistry,
  15. FlushInterval: 1 * time.Second,
  16. DurationUnit: time.Millisecond,
  17. })
  18. }