Created
July 10, 2015 09:41
-
-
Save lyonanderson/6140eced0dca514b3388 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT sum(cpu_seconds) FROM | |
( SELECT case when diff_raw < -10 then value else diff_raw end as cpu_seconds | |
FROM ( SELECT *, value - prevVal as diff_raw FROM ( SELECT ID, ProcessName, value, ( SELECT t2.value FROM PLProcessMonitorAgent_EventBackward_ProcessMonitor_Dynamic t2 where t2.ID < t1.ID and ProcessName == "kernel_task" order by t2.ID desc limit 1 ) as prevVal FROM PLProcessMonitorAgent_EventBackward_ProcessMonitor_Dynamic t1 WHERE ProcessName == "kernel_task" ) ) WHERE cpu_seconds IS NOT NULL ) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment