From c5d31e75270c1a48a967d766e07083e340fd5804 Mon Sep 17 00:00:00 2001 From: Maksadbek Date: Thu, 3 Mar 2016 02:58:08 +0500 Subject: [PATCH] statics that lack on MySQL 5.5 is turned off by default --- plugins/inputs/mysql/mysql.go | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/plugins/inputs/mysql/mysql.go b/plugins/inputs/mysql/mysql.go index 2e8e70a1a..23f8e4762 100644 --- a/plugins/inputs/mysql/mysql.go +++ b/plugins/inputs/mysql/mysql.go @@ -25,6 +25,8 @@ type Mysql struct { GatherTableIOWaits bool GatherIndexIOWaits bool GatherTableSchema bool + GatherFileEventsStats bool + GatherPerfEventsStatements bool } var sampleConfig = ` @@ -46,6 +48,8 @@ var sampleConfig = ` GatherTableIOWaits = false GatherIndexIOWaits = false GatherTableSchema = false + GatherFileEventsStats = false + GatherPerfEventsStatements = false ` var defaultTimeout = time.Second * time.Duration(5) @@ -372,6 +376,7 @@ const ( table_name FROM information_schema.tables WHERE table_schema = 'performance_schema' AND table_name = ? + ` ) @@ -446,14 +451,18 @@ func (m *Mysql) gatherServer(serv string, acc telegraf.Accumulator) error { return err } - err = m.gatherPerfFileEventsStatuses(db, serv, acc) - if err != nil { - return err + if m.GatherFileEventsStats { + err = m.gatherPerfFileEventsStatuses(db, serv, acc) + if err != nil { + return err + } } - err = m.gatherPerfEventsStatements(db, serv, acc) - if err != nil { - return err + if m.GatherPerfEventsStatements { + err = m.gatherPerfEventsStatements(db, serv, acc) + if err != nil { + return err + } } if m.GatherTableSchema {