File: opentsdb_test.go

package info (click to toggle)
golang-github-spacejam-loghisto 0.0~git20150819.0.3233097-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, buster, forky, sid, trixie
  • size: 120 kB
  • sloc: makefile: 4
file content (23 lines) | stat: -rw-r--r-- 403 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package loghisto

import (
	"testing"
	"time"
)

func TestOpenTSDB(t *testing.T) {
	ms := NewMetricSystem(time.Second, true)
	s := NewSubmitter(ms, OpenTSDBProtocol, "tcp", "localhost:7777")
	s.Start()

	metrics := &ProcessedMetricSet{
		Time: time.Now(),
		Metrics: map[string]float64{
			"test.1": 43.32,
			"test.2": 12.3,
		},
	}
	request := s.serializer(metrics)
	s.submit(request)
	s.Shutdown()
}