Class MetricsQueryImpl
- java.lang.Object
-
- org.camunda.bpm.engine.impl.db.ListQueryParameterObject
-
- org.camunda.bpm.engine.impl.metrics.MetricsQueryImpl
-
- All Implemented Interfaces:
java.io.Serializable,Command<java.lang.Object>,MetricsQuery
public class MetricsQueryImpl extends ListQueryParameterObject implements java.io.Serializable, Command<java.lang.Object>, MetricsQuery
- Author:
- Daniel Meyer
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classMetricsQueryImpl.MetricsQueryIntervalCmdprotected classMetricsQueryImpl.MetricsQuerySumCmd
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.BooleanaggregateByReporterprotected Command<java.lang.Object>callbackContains the command implementation which should be executed either metric sum or select metric grouped by time interval.protected CommandExecutorcommandExecutorstatic intDEFAULT_LIMIT_SELECT_INTERVALstatic longDEFAULT_SELECT_INTERVALprotected java.util.DateendDateprotected java.lang.LongendDateMillisecondsprotected java.lang.Longintervalprotected java.lang.Stringnameprotected java.lang.Stringreporterprotected java.util.DatestartDateprotected java.lang.LongstartDateMilliseconds-
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 MetricsQueryaggregateByReporter()Aggregate metrics by reportersMetricsQueryImplendDate(java.util.Date endDate)Restrict to data collected before the given date (exclusive)java.lang.Objectexecute(CommandContext commandContext)java.util.DategetEndDate()java.lang.LonggetEndDateMilliseconds()java.lang.LonggetInterval()intgetMaxResults()java.lang.StringgetName()java.lang.StringgetReporter()java.util.DategetStartDate()java.lang.LonggetStartDateMilliseconds()java.util.List<MetricIntervalValue>interval()Returns the metrics summed up and aggregated on a time interval.java.util.List<MetricIntervalValue>interval(long interval)Returns the metrics summed up and aggregated on a time interval.MetricsQuerylimit(int maxResults)Sets the limit row count of the result.MetricsQueryImplname(java.lang.String name)MetricsQueryoffset(int offset)Sets the offset of the returned results.MetricsQueryreporter(java.lang.String reporter)Restrict to data collected by the reported with the given identifiervoidsetMaxResults(int maxResults)MetricsQueryImplstartDate(java.util.Date startDate)Restrict to data collected after the given date (inclusive)longsum()-
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 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
-
commandExecutor
protected transient CommandExecutor commandExecutor
-
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:
namein 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(java.lang.String reporter)
Description copied from interface:MetricsQueryRestrict to data collected by the reported with the given identifier- Specified by:
reporterin interfaceMetricsQuery
-
startDate
public MetricsQueryImpl startDate(java.util.Date startDate)
Description copied from interface:MetricsQueryRestrict to data collected after the given date (inclusive)- Specified by:
startDatein interfaceMetricsQuery
-
endDate
public MetricsQueryImpl endDate(java.util.Date endDate)
Description copied from interface:MetricsQueryRestrict to data collected before the given date (exclusive)- Specified by:
endDatein interfaceMetricsQuery
-
interval
public java.util.List<MetricIntervalValue> interval()
Description copied from interface:MetricsQueryReturns 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:
intervalin interfaceMetricsQuery- Returns:
- the aggregated metrics
-
interval
public java.util.List<MetricIntervalValue> interval(long interval)
Description copied from interface:MetricsQueryReturns 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:
intervalin 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:
sumin interfaceMetricsQuery- Returns:
- the aggregated sum
-
execute
public java.lang.Object execute(CommandContext commandContext)
-
offset
public MetricsQuery offset(int offset)
Description copied from interface:MetricsQuerySets the offset of the returned results.- Specified by:
offsetin interfaceMetricsQuery- Parameters:
offset- indicates after which row the result begins- Returns:
- the adjusted MetricsQuery
-
limit
public MetricsQuery limit(int maxResults)
Description copied from interface:MetricsQuerySets 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:
limitin interfaceMetricsQuery- Parameters:
maxResults- the new row limit of the result- Returns:
- the adjusted MetricsQuery
-
aggregateByReporter
public MetricsQuery aggregateByReporter()
Description copied from interface:MetricsQueryAggregate metrics by reporters- Specified by:
aggregateByReporterin interfaceMetricsQuery- Returns:
- the adjusted MetricsQuery
-
setMaxResults
public void setMaxResults(int maxResults)
- Overrides:
setMaxResultsin classListQueryParameterObject
-
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()
-
getMaxResults
public int getMaxResults()
- Overrides:
getMaxResultsin classListQueryParameterObject
-
-