Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

record deferred_count as a guage instead of a counter in graphite #179

Merged
merged 1 commit into from
Apr 18, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions docs/production.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ In terms of topology, we recommend running `nsqd` co-located with services produ
`nsqd` can be configured to push data to [statsd][statsd] by specifying `--statsd-address`. By
turning this on, each `nsqd` instance will push to the following `statsd` paths:

nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.backend_depth
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.depth
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.backend_depth [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.depth [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.message_count
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.backend_depth
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.clients
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.deferred_count
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.depth
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.in_flight_count
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.backend_depth [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.clients [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.deferred_count [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.depth [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.in_flight_count [gauge]
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.message_count
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.requeue_count
nsq.<nsqd_host>_<nsqd_port>.topic.<topic_name>.channel.<channel_name>.timeout_count
Expand Down
2 changes: 1 addition & 1 deletion examples/nsq_stat/nsq_stat.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ func statLoop(interval time.Duration, topic string, channel string,
c := allChannelStats[channel]
log.SetOutput(os.Stdout)

if i % 25 == 0 {
if i%25 == 0 {
fmt.Printf("-----------depth------------+--------------metadata---------------\n")
fmt.Printf("%7s %7s %5s %5s | %7s %7s %12s %7s\n", "mem", "disk", "inflt", "def", "req", "t-o", "msgs", "clients")
}
Expand Down
2 changes: 1 addition & 1 deletion nsqadmin/graph_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ func (g *GraphOptions) Rate(gr GraphTarget) string {
func metricType(key string) string {
metricType := "counter"
switch key {
case "backend_depth", "depth", "clients", "in_flight_count":
case "backend_depth", "depth", "clients", "in_flight_count", "deferred_count":
metricType = "gauge"
}
return metricType
Expand Down
3 changes: 1 addition & 2 deletions nsqd/statsd.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,8 @@ func statsdLoop(addr string, prefix string, interval int) {
stat = fmt.Sprintf("topic.%s.channel.%s.in_flight_count", topic.TopicName, channel.ChannelName)
statsd.Gauge(stat, int(channel.InFlightCount))

diff = uint64(channel.DeferredCount - lastChannel.DeferredCount)
stat = fmt.Sprintf("topic.%s.channel.%s.deferred_count", topic.TopicName, channel.ChannelName)
statsd.Incr(stat, int(diff))
statsd.Gauge(stat, int(channel.DeferredCount))

diff = channel.RequeueCount - lastChannel.RequeueCount
stat = fmt.Sprintf("topic.%s.channel.%s.requeue_count", topic.TopicName, channel.ChannelName)
Expand Down