Class MetricsQueryImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.db.ListQueryParameterObject
-
- org.camunda.bpm.engine.impl.metrics.MetricsQueryImpl
-
- All Implemented Interfaces:
Serializable
,Command<Object>
,MetricsQuery
public class MetricsQueryImpl extends ListQueryParameterObject implements Serializable, Command<Object>, MetricsQuery
- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
MetricsQueryImpl.MetricsQueryIntervalCmd
protected class
MetricsQueryImpl.MetricsQuerySumCmd
-
Field Summary
Fields Modifier and Type Field 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
-
Fields inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
authCheck, databaseType, firstResult, maxResults, orderingProperties, parameter, tenantCheck
-
-
Constructor Summary
Constructors Constructor Description MetricsQueryImpl(CommandExecutor commandExecutor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetricsQuery
aggregateByReporter()
Aggregate metrics by reportersMetricsQueryImpl
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 identifiervoid
setMaxResults(int maxResults)
MetricsQueryImpl
startDate(Date startDate)
Restrict to data collected after the given date (inclusive)long
sum()
-
Methods inherited from class org.camunda.bpm.engine.impl.db.ListQueryParameterObject
getAuthCheck, getDatabaseType, getFirstResult, getFirstRow, getLastRow, getOrderingProperties, getParameter, getTenantCheck, setAuthCheck, setDatabaseType, setFirstResult, setOrderingProperties, setParameter, setTenantCheck
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.camunda.bpm.engine.impl.interceptor.Command
isRetryable
-
-
-
-
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 String name
-
reporter
protected String reporter
-
startDate
protected Date startDate
-
endDate
protected Date endDate
-
startDateMilliseconds
protected Long startDateMilliseconds
-
endDateMilliseconds
protected Long endDateMilliseconds
-
interval
protected Long interval
-
aggregateByReporter
protected Boolean aggregateByReporter
-
commandExecutor
protected transient CommandExecutor commandExecutor
-
-
Constructor Detail
-
MetricsQueryImpl
public MetricsQueryImpl(CommandExecutor commandExecutor)
-
-
Method Detail
-
name
public MetricsQueryImpl name(String name)
- Specified by:
name
in interfaceMetricsQuery
- 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(String reporter)
Description copied from interface:MetricsQuery
Restrict to data collected by the reported with the given identifier- Specified by:
reporter
in interfaceMetricsQuery
-
startDate
public MetricsQueryImpl startDate(Date startDate)
Description copied from interface:MetricsQuery
Restrict to data collected after the given date (inclusive)- Specified by:
startDate
in interfaceMetricsQuery
-
endDate
public MetricsQueryImpl endDate(Date endDate)
Description copied from interface:MetricsQuery
Restrict to data collected before the given date (exclusive)- Specified by:
endDate
in interfaceMetricsQuery
-
interval
public 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 interfaceMetricsQuery
- Returns:
- the aggregated metrics
-
interval
public 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 interfaceMetricsQuery
- 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 interfaceMetricsQuery
- Returns:
- the aggregated sum
-
execute
public Object execute(CommandContext commandContext)
-
offset
public MetricsQuery offset(int offset)
Description copied from interface:MetricsQuery
Sets the offset of the returned results.- Specified by:
offset
in interfaceMetricsQuery
- 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 interfaceMetricsQuery
- Parameters:
maxResults
- the new row limit of the result- Returns:
- the adjusted MetricsQuery
-
aggregateByReporter
public MetricsQuery aggregateByReporter()
Description copied from interface:MetricsQuery
Aggregate metrics by reporters- Specified by:
aggregateByReporter
in interfaceMetricsQuery
- Returns:
- the adjusted MetricsQuery
-
setMaxResults
public void setMaxResults(int maxResults)
- Overrides:
setMaxResults
in classListQueryParameterObject
-
getStartDate
public Date getStartDate()
-
getEndDate
public Date getEndDate()
-
getStartDateMilliseconds
public Long getStartDateMilliseconds()
-
getEndDateMilliseconds
public Long getEndDateMilliseconds()
-
getName
public String getName()
-
getReporter
public String getReporter()
-
getInterval
public Long getInterval()
-
getMaxResults
public int getMaxResults()
- Overrides:
getMaxResults
in classListQueryParameterObject
-
-