I want to measure if my node’s stats (GC, memory, event loop ticks), degrade over time.
Is it possible to automatically take a snapshot of those stats, like avg in the last 24 hours every day, to see if they increase over time? so I’ll be able to create sort of diagram in which each column is the avg of a specific date so I’ll be able to track on abnormal jumps or if it’s growing slowly. and so on
Hello @michael.solomon, welcome to the Explorers Hub!
Here is a query in NRQL that might get you moving forward:
SELECT average(newrelic.timeslice.value) * 1 FROM Metric WHERE appName = '' AND metricTimesliceName LIKE '%CPU%' OR metricTimesliceName LIKE '%Memory%' OR metricTimesliceName LIKE '%GC%' FACET metricTimesliceName SINCE 24 hours ago LIMIT MAX
Average and range included in this one:
SELECT average(newrelic.timeslice.value) as 'AVG',max(newrelic.timeslice.value) - min(newrelic.timeslice.value) as 'RANGE' FROM Metric WHERE appName = 'api-direqt-io-prod' AND metricTimesliceName LIKE '%CPU%' OR metricTimesliceName LIKE '%Memory%' OR metricTimesliceName LIKE '%GC%' FACET metricTimesliceName SINCE 30 minutes ago LIMIT MAX
To utilize these queries navigate to Insights in your account and update the appName.
You could view a range would be without max and min.
Here is the Data Dictionary which will show you all the queryable items and the shortcut to syntax assistance:
You can also export your data to CSV.
If you would like more visibility and utilizing the dashboards space in New Relic you should be able to build those:
Charts would require a query builder in order to facet and show multiple things if you go down that route. They seem to be best to view one at a time. Here is an example in one of your applications since we weren’t sure which one you were talking about here.
We hope this helps and let us know if you need more support from our dashboard experts here.
Thanks for the comprehensive answer!
Is it possible to query Node.js’
max CPU time per tick and
ticks per minute stats as well?