From 41fe11c12f14a015d934db015edafde7b99d2e07 Mon Sep 17 00:00:00 2001 From: Joseph Lawson Date: Wed, 23 Apr 2014 16:06:29 -0400 Subject: [PATCH] added output_tcp queue stats --- output_http.go | 2 +- output_tcp.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/output_http.go b/output_http.go index b05af82..bd729b9 100644 --- a/output_http.go +++ b/output_http.go @@ -65,7 +65,7 @@ func NewHTTPOutput(options string, headers HTTPHeaders, methods HTTPMethods, ela o.methods = methods o.buf = make(chan []byte, 100) - o.bufStats = NewGorStat("OUTPUT_HTTP") + o.bufStats = NewGorStat("output_http") if elasticSearchAddr != "" { o.elasticSearch = new(es.ESPlugin) diff --git a/output_tcp.go b/output_tcp.go index 17e5c90..48e2a87 100644 --- a/output_tcp.go +++ b/output_tcp.go @@ -13,6 +13,7 @@ type TCPOutput struct { address string limit int buf chan []byte + bufStats *GorStat } func NewTCPOutput(options string) io.Writer { @@ -22,6 +23,7 @@ func NewTCPOutput(options string) io.Writer { o.address = optionsArr[0] o.buf = make(chan []byte, 100) + o.bufStats = NewGorStat("output_tcp") if len(optionsArr) > 1 { o.limit, _ = strconv.Atoi(optionsArr[1]) @@ -52,6 +54,7 @@ func (o *TCPOutput) Write(data []byte) (n int, err error) { data = append(data,[]byte("ΒΆ")...) copy(new_buf, data) o.buf <- new_buf + o.bufStats.Write(len(o.buf)) return len(data), nil }