I’d like to get ‘success rate’, so number of successful requests (RC==200) divided by number of all requests. I’d like to get a graph of such success rate in grafana (f.e. every 10 seconds).
Is it possible to get it in Influx? I have trouble to create such query (is it possible to divide values from two 'subqueries?)
When I run:
select DERIVATIVE(sum(value),10s) as all from request_count where time >= ‘2017-08-02T10:17:00Z’ AND time <= ‘2017-08-02T10:19:00Z’ GROUP BY time(10s) fill(null)
select DERIVATIVE(sum(value),10s) from request_count where response_code=‘200’ AND time >= ‘2017-08-02T10:17:00Z’ AND time <= ‘2017-08-02T10:19:00Z’ GROUP BY time(10s) fill(null)
name: request_count
time derivative
select value/sum from (sum(value) from request_count where time >= ‘2017-08-02T10:17:00Z’ AND time <= ‘2017-08-02T10:19:00Z’ GROUP BY time(10s)) where response_code=200 and time >= ‘2017-08-02T10:17:00Z’ AND time <= ‘2017-08-02T10:19:00Z’ GROUP BY time(10s)
The above should give you the data for “response_code=200” (ratio of success)
If you would like to see it for all the response codes:
select value/sum from (sum(value) from request_count where time >= ‘2017-08-02T10:17:00Z’ AND time <= ‘2017-08-02T10:19:00Z’ GROUP BY time(10s)) where time >= ‘2017-08-02T10:17:00Z’ AND time <= ‘2017-08-02T10:19:00Z’ GROUP BY time(10s),response_code
Hello,
I have similar question.
I’m not sure if this is a feature request or if this kind of functionality already exists.
I looked at #3976 and #4081 (influxdb github).
First what I’m trying to accomplish: create a dashboard in chronograf showing different groupings of requests/s hitting our servers. I’m using SELECT sum("count") / 60 AS "requests per second" FROM "mydb"."autogen"."queries" WHERE time > :dashboardTime: GROUP BY time(1m), "server" FILL(0).
However this query gets slower and slower when showing large timespans because it returns data with 1 second (or lower) resolution. Usually in queries there is GROUP BY :interval: but it cannot be used here for some reason.
My question is, can I somehow use :interval: template variable to group data again for the display?