Enforce stat prefixing at the accumulator layer

This commit is contained in:
Evan Phoenix
2015-05-18 12:15:15 -07:00
parent 34e87e7026
commit f1e1204374
10 changed files with 439 additions and 314 deletions

View File

@@ -50,23 +50,23 @@ type mapping struct {
var mappings = []*mapping{
{
onServer: "Bytes_",
inExport: "mysql_bytes_",
inExport: "bytes_",
},
{
onServer: "Com_",
inExport: "mysql_commands_",
inExport: "commands_",
},
{
onServer: "Handler_",
inExport: "mysql_handler_",
inExport: "handler_",
},
{
onServer: "Innodb_",
inExport: "mysql_innodb_",
inExport: "innodb_",
},
{
onServer: "Threads_",
inExport: "mysql_threads_",
inExport: "threads_",
},
}
@@ -113,14 +113,14 @@ func (m *Mysql) gatherServer(serv *Server, acc plugins.Accumulator) error {
return err
}
acc.Add("mysql_queries", i, nil)
acc.Add("queries", i, nil)
case "Slow_queries":
i, err := strconv.ParseInt(string(val.([]byte)), 10, 64)
if err != nil {
return err
}
acc.Add("mysql_slow_queries", i, nil)
acc.Add("slow_queries", i, nil)
}
}