Creating time series from events

hi,

we have a server that has multiple pools for php-fpm. we would like to visualise the occupation op those pools over time. I have enabled process metrics, so I can do a query like :

SELECT count(commandLine) FROM ProcessSample FACET commandLine WHERE commandLine like 'php-fpm: pool %' 

and that kinda works, but gives me an aggregate count over a lot of processSamples. If I limit the query to a 20 second interval, I can get the counts from one sample, it seems, but I have no idea how to get a time series from that.

does anybody have an idea ?

Hi, @rik3: What if you add TIMESERIES to your query?

SELECT count(*) 
FROM ProcessSample 
FACET commandLine 
WHERE commandLine like 'php-fpm: pool %'  
TIMESERIES
1 Like

wow… I thought I’d already tried that, but it seems that I’d only done that when also including something like

SINCE 30 MINUTES AGO

but it seems adding that clause is unnecessary (and also screws up the result). thanks :slight_smile: still trying to get a hang of nrql and the whole events/metrics thing/

having said that, on some interval settings for the graph something goes wrong. in those cases I get a graph like

every spike seems to count all processes twice (so exactly doubled). I can’t really explain that…

It may be your time interval for timeseries. Show your nrql.

SELECT count(*) 
FROM ProcessSample 
FACET commandLine 
WHERE commandLine like 'php-fpm: pool %' 
TIMESERIES

the spikes only appear if the chart is set to a period of 3 hours or longer. anything shorter, they don’t show.

It may be you don’t have very many. That would result in the metrics rendering what looks like spikes in the charts. You might want to look at the raw events to validate.

Welcome to the community @rik3 - looks like you are getting some great advice from @6MM. Let us know if you need anything else.