vectorgrp / sil-kit

Vector SIL Kit – Open-Source Library for Connecting Software-in-the-Loop Environments
https://vectorgrp.github.io/sil-kit-docs
MIT License
107 stars 32 forks source link

dev: For SimStepAsync, measure execution time until call to CompleteSimStep #118

Closed KonradBkd closed 1 month ago

KonradBkd commented 2 months ago

Subject

Description

Developer checklist (address before review)

VDanielEdwards commented 2 months ago

@KonradBkd I think it would be better to add an additional metric that measures the completion duration in contrast to the execution duration. Both measurements are interesting, e.g., async sim. step handler is taking longer than expected due to lock contention.

KonradBkd commented 2 months ago

@KonradBkd I think it would be better to add an additional metric that measures the completion duration in contrast to the execution duration. Both measurements are interesting, e.g., async sim. step handler is taking longer than expected due to lock contention.

You're right, we should measure both and should be precise with the terminology. I'd say a LogicalSimStepDuration spans from the invocation of the handler until

Whereas, the SimStepHandlerExecutionDuration is just around the handler in both modes.

Or, as you suggested, we the split in handler execution time and completion time.

The issue came up when looking at the output by Trace(_logger, "Finished Simulation Step. Execution time was: {}ms", executionDurationMs.count());, which is kind of misleading (because too small) when using the SimStepHandlerAsync.