Configuration for pre-calculating a Metric's value ahead of time on a schedule, rather than computing it on demand. Persisted to XML under the element name "pre-calc" as a child of a metric's cache configuration. A pre-calculated metric's values are written into a named data series (dataSeriesName) for the configured entity types, run as the given user, on a schedule determined by durationUnit and durationMultiple.
Group: Queries
Properties
| Property | Returns | Description |
|---|---|---|
| dataSeriesName | String | The name of the data series that pre-calculated values for this metric are written to. |
| durationMultiple | Integer | How many durationUnit periods elapse between pre-calculation runs. |
| durationUnit | TimeUnit | The time unit used together with durationMultiple to determine how often pre-calculation runs. |
| entityTypes | List<String> | The entity types (org types or group names) that this metric is pre-calculated for. |
| runAsUser | String | The username the pre-calculation process runs as. |
Methods
getDataSeriesName()
Returns: String
The name of the data series that pre-calculated values for this metric are written to.
getEntityTypes()
Returns: List<String>
The entity types (org types or group names) that this metric is pre-calculated for.
getRunAsUser()
Returns: String
The username the pre-calculation process runs as.
getDurationUnit()
Returns: TimeUnit
The time unit used together with durationMultiple to determine how often pre-calculation runs.
getDurationMultiple()
Returns: Integer
How many durationUnit periods elapse between pre-calculation runs.
calcNextRunDate(Date now)
Returns: Date
Calculates the next scheduled pre-calculation run date after the given date, by adding durationMultiple durationUnit periods to it. Defaults to one week ahead if durationUnit is not set, or if it has an unrecognised value.
| Parameter | Description |
|---|---|
now | the date to calculate the next run date from |