MySQL Server Slow Query Percent

Microsoft.MySQLServer.ManagedServer.Unix.SlowQueryPct.Collection (Rule)

This rule collects the percent of slow queries

Knowledge Base article:

Summary

This rule collects performance data for the MySQL Server\ Slow Query Pct performance counter. The collected values are accessible in performance views. This metric exposes the total percentage of slow queries that are currently in use by the MySQL Server running on a Linux Server. The value returned by the agent is calculated by dividing the number of slow queries by the total number of queries.

Element properties:

TargetMicrosoft.MySQLServer.ManagedServer.Unix
CategoryPerformanceCollection
EnabledTrue
Alert GenerateFalse
RemotableTrue

Member Modules:

ID Module Type TypeId RunAs 
DS DataSource Microsoft.Oss.WSMan.PerfCounterProvider Default
WriteToDB WriteAction Microsoft.SystemCenter.CollectPerformanceData Default
WriteToDW WriteAction Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData Default

Source Code:

<Rule ID="Microsoft.MySQLServer.ManagedServer.Unix.SlowQueryPct.Collection" Target="Microsoft.MySQLServer.ManagedServer.Unix" Remotable="true" Enabled="onStandardMonitoring">
<Category>PerformanceCollection</Category>
<DataSources>
<DataSource ID="DS" TypeID="Oss!Microsoft.Oss.WSMan.PerfCounterProvider">
<Interval>300</Interval>
<TargetSystem>$Target/Host/Property[Type="Unix!Microsoft.Unix.Computer"]/NetworkName$</TargetSystem>
<Uri>http://schemas.microsoft.com/wbem/wscim/1/cim-schema/2/MySQL_ServerStatistics?__cimnamespace=root/mysql</Uri>
<Filter/>
<SplitItems>true</SplitItems>
<ObjectName>MySQL Server</ObjectName>
<CounterName>Slow Query Pct</CounterName>
<InstanceName>$Data/WsManData/*[local-name(.)='MySQL_ServerStatistics']/*[local-name(.)='InstanceID']$</InstanceName>
<Value>$Data/WsManData/*[local-name(.)='MySQL_ServerStatistics']/*[local-name(.)='SlowQueryPct']$</Value>
</DataSource>
</DataSources>
<WriteActions>
<WriteAction ID="WriteToDB" TypeID="SC!Microsoft.SystemCenter.CollectPerformanceData"/>
<WriteAction ID="WriteToDW" TypeID="SCDW!Microsoft.SystemCenter.DataWarehouse.PublishPerformanceData"/>
</WriteActions>
</Rule>