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

PropertyReturnsDescription
dataSeriesNameStringThe name of the data series that pre-calculated values for this metric are written to.
durationMultipleIntegerHow many durationUnit periods elapse between pre-calculation runs.
durationUnitTimeUnitThe time unit used together with durationMultiple to determine how often pre-calculation runs.
entityTypesList<String>The entity types (org types or group names) that this metric is pre-calculated for.
runAsUserStringThe 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.

ParameterDescription
nowthe date to calculate the next run date from
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.