From a06ee58785173202e23fc336c7c447c72400426e Mon Sep 17 00:00:00 2001 From: erayaslan Date: Fri, 17 Nov 2017 03:49:51 +0300 Subject: [PATCH] Use MAX() instead of SUM() for latency measurements in sqlserver (#3471) --- plugins/inputs/sqlserver/sqlserver.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/inputs/sqlserver/sqlserver.go b/plugins/inputs/sqlserver/sqlserver.go index cdf8ef4f2..49f36b2cf 100644 --- a/plugins/inputs/sqlserver/sqlserver.go +++ b/plugins/inputs/sqlserver/sqlserver.go @@ -539,7 +539,7 @@ SELECT DatabaseName, ReadLatency FROM #baseline WHERE datafile_type = ''LOG'' ) as V -PIVOT(SUM(ReadLatency) FOR DatabaseName IN (' + @ColumnName + ')) AS PVTTable +PIVOT(MAX(ReadLatency) FOR DatabaseName IN (' + @ColumnName + ')) AS PVTTable UNION ALL @@ -550,7 +550,7 @@ SELECT DatabaseName, WriteLatency FROM #baseline WHERE datafile_type = ''LOG'' ) as V -PIVOT(SUM(WriteLatency) FOR DatabaseName IN (' + @ColumnName + ')) AS PVTTable +PIVOT(MAX(WriteLatency) FOR DatabaseName IN (' + @ColumnName + ')) AS PVTTable UNION ALL @@ -561,7 +561,7 @@ SELECT DatabaseName, ReadLatency FROM #baseline WHERE datafile_type = ''ROWS'' ) as V -PIVOT(SUM(ReadLatency) FOR DatabaseName IN (' + @ColumnName + ')) AS PVTTable +PIVOT(MAX(ReadLatency) FOR DatabaseName IN (' + @ColumnName + ')) AS PVTTable UNION ALL @@ -572,7 +572,7 @@ SELECT DatabaseName, WriteLatency FROM #baseline WHERE datafile_type = ''ROWS'' ) as V -PIVOT(SUM(WriteLatency) FOR DatabaseName IN (' + @ColumnName + ')) AS PVTTable +PIVOT(MAX(WriteLatency) FOR DatabaseName IN (' + @ColumnName + ')) AS PVTTable UNION ALL