Until fully nested functions are implemented (not a 1.0 feature), you can
use a continuous query to calculate and store the totals per server, and
then later query the SUM() of those stored fields. E.g.

CREATE CQ...
 SELECT derivative("bytes_recv")/(1024*1024*1024) AS total_bytes INTO
net_totals FROM "net" WHERE ...
END

Later, you would run the SUM() query against the pre-calculated fields in
the new measurement:

SELECT sum(total_bytes) FROM net_totals WHERE ...

On Sat, Aug 6, 2016 at 2:28 AM, <[email protected]> wrote:

> Hi,
>
> I am trying to figure out how many bytes were received from a certain
> server over a period of time (e.g. this month).
>
> I've got derivates (bytes/sec) or differences (total per slice of time) to
> work, e.g.:
> SELECT derivative("bytes_recv")/(1024*1024*1024) FROM "net" WHERE ...
> or
> SELECT difference("bytes_recv")/(1024*1024*1024) FROM "net" WHERE ...
>
> but I what I would like would be (maybe?) something like:
> SELECT sum(difference("bytes_recv"))/(1024*1024*1024) FROM "net" WHERE ...
> which does not work
>
> Any other suggestion to retrieve a simple total number of bytes? :-)
> Thank you.
>
> Best regards,
> Eurico
>
> --
> Remember to include the InfluxDB version number with all issue reports
> ---
> You received this message because you are subscribed to the Google Groups
> "InfluxDB" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/influxdb.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/influxdb/c2674c13-ee36-483d-92b7-771c12316dec%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Sean Beckett
Director of Support and Professional Services
InfluxDB

-- 
Remember to include the InfluxDB version number with all issue reports
--- 
You received this message because you are subscribed to the Google Groups 
"InfluxDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/influxdb.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/influxdb/CALGqCvPN831QFfUn7%3DOM3H8mBxtXG-_ueSzb18u57t9i2-X9aA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to