Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

Task Schedule for Extensions

Table of Contents

Use Case

Configuration

Notes

 

Use Case

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.

 

Configuration

In order to use task schedule mode, the following line should be included in the config.yml.

 

taskSchedule:
  numberOfThreads:
  taskDelaySeconds:

 

  • numberOfThreads is the size of the core thread pool that is used by the Scheduled Threadpool Executor. The default is 1.
  • taskDelaySeconds is the scheduling interval in seconds.

 

Here is an example to schedule tasks for every 12 minutes (12 * 60 seconds)

 

taskSchedule:
  numberOfThreads: 1
  taskDelaySeconds: 720

 

Note

  • The ideal scenario for using taskSchedule is to use it when you want to fetch current metrics at an interval of more than 300 seconds (5 minutes).
  • The cached metrics are only retained for 15 minutes, after which they expire and are re-cached in the next scheduled run.
  • If taskDelaySeconds is configured to be more than 15 minutes, the extension will report null values. This will lead to gaps on the Metric Browser.
Version history
Revision #:
5 of 5
Last update:
‎02-20-2019 01:43 PM
Updated by:
 
Labels (1)
Tags (1)


Found this article helpful? Click the Thumbs Up button.
Have an additional comment? Post it below.
0 Kudos