public class MetricsQueryImpl extends ListQueryParameterObject implements Serializable, Command<Object>, MetricsQuery
| Modifier and Type | Class and Description |
|---|---|
protected class |
MetricsQueryImpl.MetricsQueryIntervalCmd |
protected class |
MetricsQueryImpl.MetricsQuerySumCmd |
| 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, setTenantCheckclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitisRetryablepublic 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 MetricsQueryname - 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)
MetricsQueryreporter in interface MetricsQuerypublic MetricsQueryImpl startDate(Date startDate)
MetricsQuerystartDate in interface MetricsQuerypublic MetricsQueryImpl endDate(Date endDate)
MetricsQueryendDate in interface MetricsQuerypublic List<MetricIntervalValue> interval()
MetricsQueryinterval in interface MetricsQuerypublic List<MetricIntervalValue> interval(long interval)
MetricsQueryinterval in interface MetricsQueryinterval - The time interval on which the metrics should be aggregated.
The time unit is seconds.public long sum()
sum in interface MetricsQuerypublic Object execute(CommandContext commandContext)
public MetricsQuery offset(int offset)
MetricsQueryoffset in interface MetricsQueryoffset - indicates after which row the result beginspublic MetricsQuery limit(int maxResults)
MetricsQuerylimit in interface MetricsQuerymaxResults - the new row limit of the resultpublic MetricsQuery aggregateByReporter()
MetricsQueryaggregateByReporter in interface MetricsQuerypublic void setMaxResults(int maxResults)
setMaxResults in class ListQueryParameterObjectpublic 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 ListQueryParameterObjectCopyright © 2022. All rights reserved.