예제 #1
0
func (t *ATestSuite) TestSetNamespace(c *C) {
	var g *godspeed.AsyncGodspeed
	g, err := godspeed.NewDefaultAsync()
	c.Assert(err, IsNil)
	c.Check(g.Godspeed.Namespace, Equals, "")
	g.SetNamespace("heckman")
	c.Check(g.Godspeed.Namespace, Equals, "heckman")
}
예제 #2
0
func testAsyncBasicFunc(t *ATestSuite, c *C, g *godspeed.AsyncGodspeed) {
	g.AddTag("test0")
	g.SetNamespace("godspeed")

	g.W.Add(1)
	go g.Send("test.metric", "c", 1, 1, []string{"test1", "test2"}, g.W)

	a, ok := <-t.o
	c.Assert(ok, Equals, true)

	b := []byte("godspeed.test.metric:1|c|#test0,test1,test2")
	c.Check(string(a), Equals, string(b))
	c.Check(len(g.Godspeed.Tags), Equals, 1)
	c.Check(g.Godspeed.Namespace, Equals, "godspeed")
}