Skip to content

Commit

Permalink
Fix typo in slowlog_length metric lenth -> length (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
xginn8 authored and oliver006 committed Jun 25, 2018
1 parent e09ba23 commit a8c01c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions exporter/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ func (e *Exporter) initGauges() {
Name: "command_call_duration_seconds_sum",
Help: "Total amount of time in seconds spent per command",
}, []string{"addr", "alias", "cmd"})
e.metrics["slowlog_lenth"] = prometheus.NewGaugeVec(prometheus.GaugeOpts{
e.metrics["slowlog_length"] = prometheus.NewGaugeVec(prometheus.GaugeOpts{
Namespace: e.namespace,
Name: "slowlog_lenth",
Name: "slowlog_length",
Help: "Total slowlog",
}, []string{"addr", "alias"})
}
Expand Down Expand Up @@ -751,7 +751,7 @@ func (e *Exporter) scrapeRedisHost(scrapes chan<- scrapeResult, addr string, idx

if reply, err := c.Do("SLOWLOG", "LEN"); err == nil {
e.metricsMtx.RLock()
e.metrics["slowlog_lenth"].WithLabelValues(addr, e.redis.Aliases[idx]).Set(float64(reply.(int64)))
e.metrics["slowlog_length"].WithLabelValues(addr, e.redis.Aliases[idx]).Set(float64(reply.(int64)))
e.metricsMtx.RUnlock()
}

Expand Down
2 changes: 1 addition & 1 deletion exporter/redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func TestExporterMetrics(t *testing.T) {
"loading_dump_file", // testing renames
"config_maxmemory", // testing config extraction
"config_maxclients", // testing config extraction
"slowlog_lenth",
"slowlog_length",
}

for _, k := range wantKeys {
Expand Down

0 comments on commit a8c01c5

Please sign in to comment.