Initial commit

This commit is contained in:
Donny
2019-04-22 20:46:32 +08:00
commit 49ab8aadd1
25441 changed files with 4055000 additions and 0 deletions

17
library/log/agent_test.go Normal file
View File

@@ -0,0 +1,17 @@
package log
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestBatchSendSwitch(t *testing.T) {
agent := NewAgent(nil)
assert.Equal(t, true, agent.batchSend)
agent = NewAgent(&AgentConfig{TaskID: "000161", Proto: "unixpacket", Addr: "/var/run/lancer/collector_tcp.sock"})
assert.Equal(t, true, agent.batchSend)
agent = NewAgent(&AgentConfig{TaskID: "000161", Proto: "unixgram", Addr: "/var/run/lancer/collector.sock"})
assert.Equal(t, false, agent.batchSend)
}