Skip to content

Commit

Permalink
Add counter type to perfmon collector (#7712)
Browse files Browse the repository at this point in the history
  • Loading branch information
denzilribeiro authored Jun 23, 2020
1 parent da441cd commit dd3ff0e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion plugins/inputs/sqlserver/sqlserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -850,7 +850,9 @@ SELECT 'sqlserver_performance' AS [measurement],
pc.object_name AS [object],
pc.counter_name AS [counter],
CASE pc.instance_name WHEN '_Total' THEN 'Total' ELSE ISNULL(pc.instance_name,'') END AS [instance],
CAST(CASE WHEN pc.cntr_type = 537003264 AND pc1.cntr_value > 0 THEN (pc.cntr_value * 1.0) / (pc1.cntr_value * 1.0) * 100 ELSE pc.cntr_value END AS float(10)) AS [value]
CAST(CASE WHEN pc.cntr_type = 537003264 AND pc1.cntr_value > 0 THEN (pc.cntr_value * 1.0) / (pc1.cntr_value * 1.0) * 100 ELSE pc.cntr_value END AS float(10)) AS [value],
-- cast to string as TAG
cast(pc.cntr_type as varchar(25)) as [counter_type]
FROM @PCounters AS pc
LEFT OUTER JOIN @PCounters AS pc1
ON (
Expand Down

0 comments on commit dd3ff0e

Please sign in to comment.