Class Query.Builder

  • Enclosing class:
    Query

    public static class Query.Builder
    extends java.lang.Object
    • Method Detail

      • build

        public Query build()
      • select

        public Query.Builder select​(java.lang.String select)
        SELECT clause. For example, mean('request_rate') or non_negative_derivative(max('value'), 1s). The select statement should select one single field/column (only the first field is handled in result processing). The selected field/column must be a numeric value. If not, errors will be raised during result processing.
        Parameters:
        select -
        Returns:
      • from

        public Query.Builder from​(java.lang.String from)
        FROM clause. Specifies the measurement to query for. For example, cpu/system.
        Parameters:
        from -
        Returns:
      • where

        public Query.Builder where​(java.lang.String where)
        WHERE clause. Used to filter data based on tags/field values. Avoid filtering on time in the WHERE clause, as selecting the approriate interval for which to fetch metrics will be handled by the InfluxdbMetricStreamer. Behavior is undefined if time filters are inclued.
        Parameters:
        where -
        Returns:
      • groupBy

        public Query.Builder groupBy​(java.lang.String groupBy)
        GROUP BY clause. Can be used to downsample data (if combined with an aggregation function in the SELECT clause), for example by specifying something like time(10s) fill(none).

        Note: do not group on tags, since that will create different series in the result (one per group) and the result handler will only process the first series (the order may not be deterministic). Use a WHERE clause to query for a particular combination of tags.

        Parameters:
        groupBy -
        Returns: