# InfluxDB query SUM for diskio (writes + reads) = total

**URL:** <https://community.influxdata.com/t/influxdb-query-sum-for-diskio-writes-reads-total/3806>\
**Category:** Dashboards\
**Tags:** influxdb, grafana\
**Created:** [January 28, 2018, 12:13am UTC](https://community.influxdata.com/t/influxdb-query-sum-for-diskio-writes-reads-total/3806 "2018-01-28T00:13:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![fchiorascu](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/fchiorascu/32/995_2.png) [@fchiorascu](https://community.influxdata.com/u/fchiorascu)\
**Post date:** [January 28, 2018, 12:13am UTC](https://community.influxdata.com/t/influxdb-query-sum-for-diskio-writes-reads-total/3806/1 "2018-01-28T00:13:17Z")

</div>

Do you have any suggestion regarding how to make an easy math for diskio writes + diskio reads = and to have a total iops?

![image](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex023/uploads/influxdata/original/1X/e2ac61d21759953a56a8657ba3c80854475daeb8.png)

---

<div class="post-metadata">

**Author:** ![fchiorascu](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/fchiorascu/32/995_2.png) [@fchiorascu](https://community.influxdata.com/u/fchiorascu)\
**Post date:** [January 28, 2018, 8:54am UTC](https://community.influxdata.com/t/influxdb-query-sum-for-diskio-writes-reads-total/3806/2 "2018-01-28T08:54:51Z")

</div>

It seems that there will be a progress.

> <https://github.com/grafana/grafana/issues/4710>
>
> Currently, Grafana (2.6) supports math functionality with the field on the left …side within the InfluxDB query builder. I.e. it can build queries like
> 
> \`\`\`
> SELECT mean("field") / 100 AS "field" FROM "measurement" WHERE "tag" = 'value' AND $timeFilter GROUP BY time($interval) fill(null)
> \`\`\`
> 
> It would be nice to also have support for math with fields on both sides, for example something like
> 
> \`\`\`
> SELECT mean("field1") + mean("field2") + mean("field3") AS "field" FROM "measurement" WHERE "tag" = 'value' AND $timeFilter GROUP BY time($interval) fill(null)
> \`\`\`

SELECT MEAN(usage\_system) + MEAN(usage\_user) AS avg  
FROM cpu  
WHERE time \> now() - 10s  
GROUP BY host;  
It’s not supported by Grafana GUI editor yet (but you can write it in manual mode).

---

<div class="post-metadata">

**Author:** ![fchiorascu](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/fchiorascu/32/995_2.png) [@fchiorascu](https://community.influxdata.com/u/fchiorascu)\
**Post date:** [January 28, 2018, 8:58am UTC](https://community.influxdata.com/t/influxdb-query-sum-for-diskio-writes-reads-total/3806/3 "2018-01-28T08:58:51Z")

</div>

![image](https://us1.discourse-cdn.com/flex023/uploads/influxdata/original/1X/79d19aa70d314c0a60bb30019a9252af578470d1.png)

What I’ve tried to achieve is that the:

- Total IOPs per reads;
- Total IOPs per writes;
- Sum of Total IOPs (reads) + Total IOPs (writes) = Total IOPs per that VM.
