Get top 5 RSS values of all Process

Hello,

I tried to display (in Grafana) top 5 values of a memory (RSS) per Process in a time series
My structure :

Process Fields
name rss
pid
cputime

I use InfluxDB 1.8 wtih InfluxQL.
I tried :

SELECT top("rss", 5) FROM "Process" WHERE $timeFilter GROUP BY time($__interval), "name"

But that does not displays the 5 top values, but all my Process. Do you have an idea ? Thanks

EDIT : I can have name and rss but in two differents table using this query :

SELECT "name", top("rss",5) FROM (SELECT mean("rss") as "rss" FROM "Process" WHERE $timeFilter GROUP BY "name") WHERE $timeFilter 

Now how can I “merged” to display in one table with | time | process_name | value (RSS)

Hello @gogui63,
I’m not sure that that’s possible with InfluxQL. You might have to enable flux and perform a join. Enable Flux | InfluxDB OSS 1.8 Documentation
join() function | Flux 0.x Documentation