As the subject states, I've tried to use derived tables in a query for CPU usage metrics generation but received the error that "LEM" the name I gave one of the derived tables in the query does not exist.
I assume this is because SolarWinds DPA simply does not support derived tables for Sybase ASE (maybe for MSSQL where you can use a "with" clause and then the derived table's code comes before the columns).
Code: (I don't know how to insert this as code)
set arithabort off
select
convert(numeric(5,2),avg((LEM.UserCPUTime - PEM.UserCPUTime)*100.0/((LEM.CPUTime - PEM.CPUTime)*1.0))) as 'UserCPU'
from
(
select
EngineNumber,
CPUTime,
SystemCPUTime,
UserCPUTime,
IdleCPUTime,
CPUTime - SystemCPUTime - UserCPUTime - IdleCPUTime as 'IOCPUTime'
from
mda_repository..mdaEngine
where
MeasureID = (select max(MeasureID) from mda_repository..mdaEngine)
and Status='online'
) as LEM
join (
select
EngineNumber,
CPUTime,
SystemCPUTime,
UserCPUTime,
IdleCPUTime,
CPUTime - SystemCPUTime - UserCPUTime - IdleCPUTime as 'IOCPUTime'
from
mda_repository..mdaEngine
where
MeasureID = (select max(MeasureID) from mda_repository..mdaEngine where MeasureID < (select max(MeasureID) from mda_repository..mdaEngine))
and Status='online'
) PEM
on LEM.EngineNumber = PEM.EngineNumber
set arithabort on
-- END OF CODE
mda_repository..mdaEngine simply contains samples taken and stored from master..monEngine .
The code was originally written to fetch all CPU times, but for this metric the rest were removed.
Of course, the code was ran on an ASE ISQL client with no errors and returned the expected result.
I intended to introduce this code, for the the IO CPU usage, which is absent (at least from my version), and specifically for one site, introduce the "User" CPU usage metric like this, as the built in one stopped working for that site, for some reason.
If you're wondering, PEM = Previous Engine Measurement, LEM = Last Engine Measurement.
Has anyone run in to this problem? Is this a known bug? Something SolarWinds intends to amend in a future version?
My version is 11.0.378
Thanks in advance,
Shay.