public class MetricsQueryImpl extends ListQueryParameterObject implements Serializable, Command<Object>, MetricsQuery
Modifier and Type | Field and Description |
---|---|
protected Boolean |
aggregateByReporter |
protected Command<Object> |
callback
Contains the command implementation which should be executed either
metric sum or select metric grouped by time interval.
|
protected CommandExecutor |
commandExecutor |
static int |
DEFAULT_LIMIT_SELECT_INTERVAL |
static long |
DEFAULT_SELECT_INTERVAL |
protected Date |
endDate |
protected Long |
endDateMilliseconds |
protected Long |
interval |
protected String |
name |
protected String |
reporter |
protected Date |
startDate |
protected Long |
startDateMilliseconds |
authCheck, databaseType, firstResult, maxResults, orderingProperties, parameter, tenantCheck
Constructor and Description |
---|
MetricsQueryImpl(CommandExecutor commandExecutor) |
Modifier and Type | Method and Description |
---|---|
MetricsQuery |
aggregateByReporter()
Aggregate metrics by reporters
|
MetricsQueryImpl |
endDate(Date endDate)
Restrict to data collected before the given date (exclusive)
|
Object |
execute(CommandContext commandContext) |
Date |
getEndDate() |
Long |
getEndDateMilliseconds() |
Long |
getInterval() |
int |
getMaxResults() |
String |
getName() |
String |
getReporter() |
Date |
getStartDate() |
Long |
getStartDateMilliseconds() |
List<MetricIntervalValue> |
interval()
Returns the metrics summed up and aggregated on a time interval.
|
List<MetricIntervalValue> |
interval(long interval)
Returns the metrics summed up and aggregated on a time interval.
|
MetricsQuery |
limit(int maxResults)
Sets the limit row count of the result.
|
MetricsQueryImpl |
name(String name) |
MetricsQuery |
offset(int offset)
Sets the offset of the returned results.
|
MetricsQuery |
reporter(String reporter)
Restrict to data collected by the reported with the given identifier
|
void |
setMaxResults(int maxResults) |
MetricsQueryImpl |
startDate(Date startDate)
Restrict to data collected after the given date (inclusive)
|
long |
sum() |
getAuthCheck, getDatabaseType, getFirstResult, getFirstRow, getLastRow, getOrderingProperties, getParameter, getTenantCheck, setAuthCheck, setDatabaseType, setFirstResult, setOrderingProperties, setParameter, setTenantCheck
public static final int DEFAULT_LIMIT_SELECT_INTERVAL
public static final long DEFAULT_SELECT_INTERVAL
protected String name
protected String reporter
protected Date startDate
protected Date endDate
protected Long startDateMilliseconds
protected Long endDateMilliseconds
protected Long interval
protected Boolean aggregateByReporter
protected transient CommandExecutor commandExecutor
public MetricsQueryImpl(CommandExecutor commandExecutor)
public MetricsQueryImpl name(String name)
name
in interface MetricsQuery
name
- The name of the metrics to query forin {@link Metrics} for a list of names which can be used here.
public MetricsQuery reporter(String reporter)
MetricsQuery
reporter
in interface MetricsQuery
public MetricsQueryImpl startDate(Date startDate)
MetricsQuery
startDate
in interface MetricsQuery
public MetricsQueryImpl endDate(Date endDate)
MetricsQuery
endDate
in interface MetricsQuery
public List<MetricIntervalValue> interval()
MetricsQuery
interval
in interface MetricsQuery
public List<MetricIntervalValue> interval(long interval)
MetricsQuery
interval
in interface MetricsQuery
interval
- The time interval on which the metrics should be aggregated.
The time unit is seconds.public long sum()
sum
in interface MetricsQuery
public Object execute(CommandContext commandContext)
public MetricsQuery offset(int offset)
MetricsQuery
offset
in interface MetricsQuery
offset
- indicates after which row the result beginspublic MetricsQuery limit(int maxResults)
MetricsQuery
limit
in interface MetricsQuery
maxResults
- the new row limit of the resultpublic MetricsQuery aggregateByReporter()
MetricsQuery
aggregateByReporter
in interface MetricsQuery
public void setMaxResults(int maxResults)
setMaxResults
in class ListQueryParameterObject
public Date getStartDate()
public Date getEndDate()
public Long getStartDateMilliseconds()
public Long getEndDateMilliseconds()
public String getName()
public String getReporter()
public Long getInterval()
public int getMaxResults()
getMaxResults
in class ListQueryParameterObject
Copyright © 2019. All rights reserved.