I need to get cpu and memory usage on component level. Which table should I query or look for in orion apm database
Look in Orion.APM.CurrentStatistics, specifically the ComponentPercentCPU and ComponentPercentMemory columns. If you're working in SWQL, you can drill down from an Application as Application.Component.CurrentStatistics.ComponentPercentCPU and Application.Component.CurrentStatistics.ComponentPercentMemory.
Hi @anooppandey3
The join operations required are in several steps and several tables. As detailed data get aggregated into hourly, and into daily, the data is in several tables.
To only get the detailed info you do something like this:
SELECT C.Name ,CSD.TimeStamp ,PED.PercentCPU ,PED.PercentMemoryFROM APM_Component AS CINNER JOIN APM_ComponentStatus_Detail AS CSD ON C.ID=CSD.ComponentIDINNER JOIN APM_ProcessEvidence_Detail AS PED ON CSD.ID=PED.ComponentStatusIDWHERE C.id=62951 --ID of your component AND CSD.TimeStamp>Getdate()-2 --How many days back you want dataGO
To get data back even further in time there are a few more tables to look at but Orion has SQL Views created just for that, using that view the query can look like this:
SELECT C.Name ,PEC.TimeStamp ,PEC.AvgPercentCPU ,PEC.AvgPercentMemoryFROM APM_Component AS CINNER JOIN APM_ProcessEvidenceChart AS PEC ON C.ID=PEC.ComponentIDWHERE C.id=62951 AND PEC.TimeStamp>Getdate()-2
Hope above gets you on the right track. Mind that above examples is for SQL code and @m-milligan showed you table names for a SWQL query. the names are different.
Thanks for the response. I am looking today's complete data for CPU and Memory usage on component level. I think as per your answer it is giving current time data only.
Hi @Seashore,
Thanks for response. Could you please let me the unit type of memory and how can I get free space of memory. Please specify the unit with calculation of free space of memory
In my example it is percentage used.
In the view [dbo].[CPULoad] you have "PercentMemoryUsed" and also AVGMemoryUsed. With that you can count how much is free.
Is this work for component level as well? how can I get total of IO Operation at component level?
I suggest you take out "node free memory" as a separate query. It will be to complicated to have in the same query.
To get IOPS just add that columne in the output, like this:
SELECT C.Name ,PEC.TimeStamp ,PEC.AvgPercentCPU ,PEC.AvgPercentMemory ,PEC.AvgIOReadOperationsPerSecFROM APM_Component AS CINNER JOIN APM_ProcessEvidenceChart AS PEC ON C.ID=PEC.ComponentIDINNER JOIN APM_Application A ON C.ApplicationID=A.ID
WHERE C.id=62951 AND PEC.TimeStamp>Getdate()-2
There are several mode columns available. Check the view in SQL...