Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add execution time metrics #1517

Merged
merged 58 commits into from
Feb 21, 2025
Merged

Add execution time metrics #1517

merged 58 commits into from
Feb 21, 2025

Conversation

HansRobo
Copy link
Member

@HansRobo HansRobo commented Jan 28, 2025

Description

Abstract

This pull-request adds computation time metrics for...

  • allowing scenarios to evaluate the impact of increased computation time
  • allowing us to find out the calculation time and analyze with rosbags

Additionally, this pull-request added test scenario that has execution time conditions.

Background

Previously, scenario_simulator_v2 simply dispaly a log like below if the main loop is timed out:

Your machine is not powerful enough to run the scenario at the specified frame rate

This pull-reuqest has been made to allow for more detailed analysis.

Details

added metrics topics

  • /simulation/interpreter/execution_time/evaluate
    • execution time for evaluating scenario
  • /simulation/interpreter/execution_time/update
    • execution time for updating traffic_simulator
  • /simulation/interpreter/execution_time/output
    • execution time for creating and publishing simulation context

optional scenarios in workflow

This pull-request added execution_time_test.yaml, but the execution time and the scenario result are flaky.
Off cource, greater execution time threshold make the scenarios stable.
But the greater the threshold, the lesshoh value there is in the scenario.

In this pull-request, I prepare optional scenario workflows for effective but flaky scenarios.
The scenario failures don't affect CI result, but report the result and error messages by comment as below.

image

References

Regression Test: OK

Destructive Changes

None

Known Limitations

None

Copy link

github-actions bot commented Jan 28, 2025

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@HansRobo HansRobo added wait for regression test bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 labels Jan 29, 2025
@HansRobo HansRobo changed the title feat: implement ScopedElapsedTimeRecorder class Add execution time metrics Jan 29, 2025
@HansRobo HansRobo added bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 and removed bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 wait for regression test labels Jan 29, 2025
@HansRobo HansRobo requested a review from yamacir-kit January 29, 2025 08:53
@HansRobo HansRobo marked this pull request as ready for review January 29, 2025 08:53
@HansRobo HansRobo self-assigned this Feb 3, 2025
Copy link

Failure optional scenarios

This is an experimental check and does not block merging the pull-request. But, please be aware that this may indicate a regression.

scenario failed: execution_time_test.junit.xml
      <failure type="SimulationFailure" message="CustomCommandAction typed &quot;exitFailure&quot; was triggered by the named Conditions {&quot;update time checker&quot;, &quot;avoid startup&quot;}: {&quot;update time checker&quot;: Is the /simulation/interpreter/execution_time/update (= 0.002308999999999999854644050501) is greaterThan 0.0?}, {&quot;avoid startup&quot;: Is the simulation time (= 1.000000000000000222044604925031) is greaterThan 1.000000000000000000000000000000?}" />

Copy link

Failure optional scenarios

This is an experimental check and does not block merging the pull-request. But, please be aware that this may indicate a regression.

scenario failed: execution_time_test.junit.xml
      <failure type="SimulationFailure" message="CustomCommandAction typed &quot;exitFailure&quot; was triggered by the named Conditions {&quot;update time checker&quot;, &quot;avoid startup&quot;}: {&quot;update time checker&quot;: Is the /simulation/interpreter/execution_time/update (= 0.002164999999999999823890872719) is greaterThan 0.0?}, {&quot;avoid startup&quot;: Is the simulation time (= 1.000000000000000222044604925031) is greaterThan 1.000000000000000000000000000000?}" />

Copy link

Failure optional scenarios

Note

This is an experimental check and does not block merging the pull-request.
But, please be aware that this may indicate a regression.

scenario failed: execution_time_test.junit.xml
      <failure type="SimulationFailure" message="CustomCommandAction typed &quot;exitFailure&quot; was triggered by the named Conditions {&quot;update time checker&quot;, &quot;avoid startup&quot;}: {&quot;update time checker&quot;: Is the /simulation/interpreter/execution_time/update (= 0.002955999999999999860306187927) is greaterThan 0.0?}, {&quot;avoid startup&quot;: Is the simulation time (= 1.000000000000000222044604925031) is greaterThan 1.000000000000000000000000000000?}" />

Copy link

Failure optional scenarios

Note

This is an experimental check and does not block merging the pull-request.
But, please be aware that this may indicate a regression.

scenario failed: execution_time_test.junit.xml
      <failure type="SimulationFailure" message="CustomCommandAction typed &quot;exitFailure&quot; was triggered by the named Conditions {&quot;update time checker&quot;, &quot;avoid startup&quot;}: {&quot;update time checker&quot;: Is the /simulation/interpreter/execution_time/update (= 0.002618000000000000101335606573) is greaterThan 0.0?}, {&quot;avoid startup&quot;: Is the simulation time (= 1.000000000000000222044604925031) is greaterThan 1.000000000000000000000000000000?}" />

@HansRobo HansRobo assigned yamacir-kit and unassigned HansRobo Feb 19, 2025
Copy link

Failure optional scenarios

Note

This is an experimental check and does not block merging the pull-request.
But, please be aware that this may indicate a regression.

scenario failed: execution_time_test
      <failure type="SimulationFailure" message="CustomCommandAction typed &quot;exitFailure&quot; was triggered by the named Conditions {&quot;update time checker&quot;, &quot;avoid startup&quot;}: {&quot;update time checker&quot;: Is the /simulation/interpreter/execution_time/update (= 0.002360000000000000118516307879) is greaterThan 0.0?}, {&quot;avoid startup&quot;: Is the simulation time (= 1.000000000000000222044604925031) is greaterThan 1.000000000000000000000000000000?}" />

Copy link

Failure optional scenarios

Note

This is an experimental check and does not block merging the pull-request.
But, please be aware that this may indicate a regression.

scenario failed: execution_time_test
      <failure type="SimulationFailure" message="CustomCommandAction typed &quot;exitFailure&quot; was triggered by the named Conditions {&quot;update time checker&quot;, &quot;avoid startup&quot;}: {&quot;update time checker&quot;: Is the /simulation/interpreter/execution_time/update (= 0.002327000000000000075328632221) is greaterThan 0.0?}, {&quot;avoid startup&quot;: Is the simulation time (= 1.000000000000000222044604925031) is greaterThan 1.000000000000000000000000000000?}" />

@HansRobo HansRobo added bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 and removed bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 labels Feb 21, 2025
@yamacir-kit yamacir-kit added the feature New feature or request label Feb 21, 2025
@HansRobo HansRobo merged commit 99791bf into master Feb 21, 2025
21 checks passed
@HansRobo HansRobo deleted the feature/execution_time branch February 21, 2025 03:05
@github-actions github-actions bot restored the feature/execution_time branch February 21, 2025 03:06
@github-actions github-actions bot deleted the feature/execution_time branch February 21, 2025 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bump minor If this pull request merged, bump minor version of the scenario_simulator_v2 feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants