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

Add redis_version field to redis input #3054

Merged
merged 1 commit into from
Jul 26, 2017
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
1 change: 1 addition & 0 deletions plugins/inputs/redis/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ Additionally the plugin also calculates the hit/miss ratio (keyspace\_hitrate) a
**Server**
- uptime(int, seconds)
- lru_clock(int, number)
- redis_version(string)

**Clients**
- clients(int, number)
Expand Down
2 changes: 1 addition & 1 deletion plugins/inputs/redis/redis.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func gatherInfoOutput(
name := string(parts[0])

if section == "Server" {
if name != "lru_clock" && name != "uptime_in_seconds" {
if name != "lru_clock" && name != "uptime_in_seconds" && name != "redis_version" {
continue
}
}
Expand Down
1 change: 1 addition & 0 deletions plugins/inputs/redis/redis_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ func TestRedis_ParseMetrics(t *testing.T) {
"used_cpu_sys_children": float64(0.00),
"used_cpu_user_children": float64(0.00),
"keyspace_hitrate": float64(0.50),
"redis_version": "2.8.9",
}

// We have to test rdb_last_save_time_offset manually because the value is based on the time when gathered
Expand Down