SQLServer - Fixes sqlserver_process_cpu calculation#8549
SQLServer - Fixes sqlserver_process_cpu calculation#8549helenosheaa merged 2 commits intoinfluxdata:masterfrom
Conversation
|
I had a look at it but tbh I've never had problems with the values returned by the query, the sum has always been 100. (looks like all the servers I see have only one physical CPU tho, so I can't replicate this yet). as a note, |
|
Thanks for the feedback @Trovalo. I haven't seen it before either. Until I have added this bigger server to the monitoring. Regarding the calculation, I have removed the decimal part so we keep the same behaviour as before. We are also just getting integers. I think we are not risking to lose something. Per MS documentation: So, it seems to be always a multiple. |
|
@ClaudioESSilva I've run the query on some instances with more than one physical CPUs without issues.
(I've removed the TOP 1 to fetch older rows) I've tried it on SQL 2005, 2008R2, 2012, 2016, 2017 without issues. |
|
It is a 2016 enterprise. |
|
Maybe something's wrong with that instance then. |
|
I don't think so. But, I need to get (ou ask someone) another server with similar config. I found that Solarwinds also discovered this |
|
In any case, this is good to go and will fix this (hopefully) rare issue. |
|
@ClaudioESSilva What versions have you tested this on currently? |
|
Hi @helenosheaa |
helenosheaa
left a comment
There was a problem hiding this comment.
Ok thanks @ClaudioESSilva looks good.
(cherry picked from commit 9aaaf72)
|
This fails on SQL 2008 due to formatting in the https://github.com/influxdata/telegraf/blob/master/plugins/inputs/sqlserver/sqlqueriesV2.go file in the sqlServerCPUV2 string section. I suspect an inadvertent paste. The semi-colon need to move to after the last END - Refer to below as this works on both: |
|
It was fixed for the new queries in #9130 With new queries I mean |
(cherry picked from commit 9aaaf72)
I really don’t understand why it’s estimated this way. |

fixes #8548
Required for all PRs:
cc / @denzilribeiro @Trovalo