dynatrace-extensions / dt-extensions-python-sdk

Dynatrace Python Extensions SDK
https://dynatrace-extensions.github.io/dt-extensions-python-sdk/
MIT License
8 stars 1 forks source link

#69 - Fix an issue with the callback iteration timestamp drifting #70

Closed dlopes7 closed 3 months ago

dlopes7 commented 3 months ago

The callback iteration slowly drifts a few milliseconds per call This is due to inaccuracies of time.sleep and some overhead on the _run_callback method

This fix the issue by using sched.enterabs instead of sched.enter. This time to enter is always calculated based on the start timestamp of the callback

There will still be some milliseconds variation from execution to execution, but it will never drift.