DefaultCounters to log 0 for counter stats
this makes sure that we can get metrics when things are not flowing through one of the consumers
This commit is contained in:
parent
b3d971e3ba
commit
5b91cd80da
1 changed files with 16 additions and 0 deletions
|
|
@ -8,6 +8,19 @@ import (
|
|||
|
||||
var log = logger.New("amazon-kinesis-client-go")
|
||||
|
||||
// DefaultCounters are core counters tracked by the batchconsumer
|
||||
// These are stats we want to report on every tick, even if the values are zero
|
||||
var DefaultCounters = []string{
|
||||
"batches-sent",
|
||||
"checkpoints-sent",
|
||||
"msg-batched",
|
||||
"batch-log-failures",
|
||||
"unknown-error",
|
||||
"processed-messages",
|
||||
"no-tags",
|
||||
"black-tag",
|
||||
}
|
||||
|
||||
type datum struct {
|
||||
name string
|
||||
value int
|
||||
|
|
@ -32,6 +45,9 @@ func init() {
|
|||
}
|
||||
case <-tick:
|
||||
tmp := logger.M{}
|
||||
for _, k := range DefaultCounters {
|
||||
tmp[k] = 0
|
||||
}
|
||||
for k, v := range data {
|
||||
tmp[k] = v
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue