Operations Automation shows incorrect resource usage for counter resources.
Moreover, even though backend returns the same value, usage displayed by Operations Automation is different after each run of the "Synchronize resource usage for instances of APS applications" task.
Typically it fluctuates between 0 and double of the actual value.
updateResource() functions when they change counter fields in a resource report resource usage to Operations Automation in terms of difference with current value.
Actual usage recalculation will happen only after
retrieve() completes, so if you run
retrieve(), double difference will be reported.
updateResource() calls to the same APS resource you calculate counters for from your
It is sufficient to only update counters fields on
It will be returned to controller by the
retrieve() function and it is sufficient to update the usage values.
An example is available in the Resource Consumption Monitoring demo project.