Class MetricsQueryImpl

    • Field Detail

      • DEFAULT_LIMIT_SELECT_INTERVAL

        public static final int DEFAULT_LIMIT_SELECT_INTERVAL
        See Also:
        Constant Field Values
      • DEFAULT_SELECT_INTERVAL

        public static final long DEFAULT_SELECT_INTERVAL
        See Also:
        Constant Field Values
      • name

        protected java.lang.String name
      • reporter

        protected java.lang.String reporter
      • startDate

        protected java.util.Date startDate
      • endDate

        protected java.util.Date endDate
      • startDateMilliseconds

        protected java.lang.Long startDateMilliseconds
      • endDateMilliseconds

        protected java.lang.Long endDateMilliseconds
      • interval

        protected java.lang.Long interval
      • aggregateByReporter

        protected java.lang.Boolean aggregateByReporter
      • callback

        protected Command<java.lang.Object> callback
        Contains the command implementation which should be executed either metric sum or select metric grouped by time interval. Note: this enables to quit with the enum distinction
    • Constructor Detail

      • MetricsQueryImpl

        public MetricsQueryImpl​(CommandExecutor commandExecutor)
    • Method Detail

      • name

        public MetricsQueryImpl name​(java.lang.String name)
        Specified by:
        name in interface MetricsQuery
        Parameters:
        name - The name of the metrics to query for
        See Also:
        in for a list of names which can be used here.
      • reporter

        public MetricsQuery reporter​(java.lang.String reporter)
        Description copied from interface: MetricsQuery
        Restrict to data collected by the reported with the given identifier
        Specified by:
        reporter in interface MetricsQuery
      • interval

        public java.util.List<MetricIntervalValue> interval()
        Description copied from interface: MetricsQuery
        Returns the metrics summed up and aggregated on a time interval. Default interval is 900 (15 minutes). The list size has a maximum of 200 the maximum can be decreased with the MetricsQuery#limit method. Paging is enabled with the help of the offset.
        Specified by:
        interval in interface MetricsQuery
        Returns:
        the aggregated metrics
      • interval

        public java.util.List<MetricIntervalValue> interval​(long interval)
        Description copied from interface: MetricsQuery
        Returns the metrics summed up and aggregated on a time interval. The size of the interval is given via parameter. The time unit is seconds! The list size has a maximum of 200 the maximum can be decreased with the MetricsQuery#limit method. Paging is enabled with the help of the offset.
        Specified by:
        interval in interface MetricsQuery
        Parameters:
        interval - The time interval on which the metrics should be aggregated. The time unit is seconds.
        Returns:
        the aggregated metrics
      • sum

        public long sum()
        Specified by:
        sum in interface MetricsQuery
        Returns:
        the aggregated sum
      • execute

        public java.lang.Object execute​(CommandContext commandContext)
        Specified by:
        execute in interface Command<java.lang.Object>
      • offset

        public MetricsQuery offset​(int offset)
        Description copied from interface: MetricsQuery
        Sets the offset of the returned results.
        Specified by:
        offset in interface MetricsQuery
        Parameters:
        offset - indicates after which row the result begins
        Returns:
        the adjusted MetricsQuery
      • limit

        public MetricsQuery limit​(int maxResults)
        Description copied from interface: MetricsQuery
        Sets the limit row count of the result. Can't be set larger than 200, since it is the maximum row count which should be returned.
        Specified by:
        limit in interface MetricsQuery
        Parameters:
        maxResults - the new row limit of the result
        Returns:
        the adjusted MetricsQuery
      • getStartDate

        public java.util.Date getStartDate()
      • getEndDate

        public java.util.Date getEndDate()
      • getStartDateMilliseconds

        public java.lang.Long getStartDateMilliseconds()
      • getEndDateMilliseconds

        public java.lang.Long getEndDateMilliseconds()
      • getName

        public java.lang.String getName()
      • getReporter

        public java.lang.String getReporter()
      • getInterval

        public java.lang.Long getInterval()