The execution frequency for an extension is typically set using the element <execution-frequency-in-seconds> in the monitor.xml. However, this value cannot be higher than 300 seconds. For use cases where an artifact needs to be monitored with an interval greater than 300 seconds, taskSchedule should be used.
The SDK provides a mechanism to cache the metrics and retain them for a maximum period of 15 minutes. When taskSchedule is configured, the Machine Agent still runs the extension as configured in <execution-frequency-in-seconds>. However, the extension returns cached values until the cache refreshes, as specified in the taskDelaySeconds field of the configuration.
In order to use task schedule mode, the following line should be included in the config.yml.
taskSchedule: numberOfThreads: taskDelaySeconds:
Here is an example to schedule tasks for every 12 minutes (12 * 60 seconds)
taskSchedule: numberOfThreads: 1 taskDelaySeconds: 720