From e2cff9febed7ec074b163e9e580e388b70ea56b9 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Fri, 3 Jul 2015 09:17:53 -0300 Subject: [PATCH 1/2] Fix mysql plugin due to test accumulator refactor --- plugins/mysql/mysql_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql/mysql_test.go b/plugins/mysql/mysql_test.go index 33643861a..76cb28b0d 100644 --- a/plugins/mysql/mysql_test.go +++ b/plugins/mysql/mysql_test.go @@ -39,7 +39,7 @@ func TestMysqlGeneratesMetrics(t *testing.T) { var count int for _, p := range acc.Points { - if strings.HasPrefix(p.Name, prefix.prefix) { + if strings.HasPrefix(p.Measurement, prefix.prefix) { count++ } } From 5cbe15b676f534e2dde14e1a145d833410e0ba92 Mon Sep 17 00:00:00 2001 From: Marcos Lilljedahl Date: Fri, 3 Jul 2015 09:25:18 -0300 Subject: [PATCH 2/2] Return error when can't execute stats query --- plugins/mysql/mysql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/mysql/mysql.go b/plugins/mysql/mysql.go index 15b1af8c9..2e9e2cd22 100644 --- a/plugins/mysql/mysql.go +++ b/plugins/mysql/mysql.go @@ -91,7 +91,7 @@ func (m *Mysql) gatherServer(serv string, acc plugins.Accumulator) error { rows, err := db.Query(`SHOW /*!50002 GLOBAL */ STATUS`) if err != nil { - return nil + return err } for rows.Next() {