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

feat(performance-metrics): add RobotContextTracker #14862

Merged
merged 23 commits into from
Apr 15, 2024

Conversation

DerekMaggio
Copy link
Contributor

@DerekMaggio DerekMaggio commented Apr 10, 2024

Overview

Create RobotContextTracker class.

This class provides a track method.
The track method should be used as a decorator on either a function/method. It takes a RobotContextState enum value to label what state the RobotContextTracker is tracking. Uses FunctionTimer to measure execution time and stores results in a list.

RobotContextTracker is defaulted not to track anything at all. To turn on tracking, instantiate the class with should_track=True. When not tracking, the track method calls the underlying wrapped function as quickly as possible.

Test Plan

  • See test_robot_contest_tracker.py

Changelog

  • Add RobotContextTracker class
  • Add test_robot_context_tracker.py

Review requests

None

Risk assessment

Low, not being used on any production code

@DerekMaggio DerekMaggio changed the base branch from EXEC-366_function_timer to edge April 11, 2024 17:18
@DerekMaggio DerekMaggio requested a review from a team April 11, 2024 17:37
@DerekMaggio DerekMaggio marked this pull request as ready for review April 11, 2024 17:47
@DerekMaggio DerekMaggio requested review from a team as code owners April 11, 2024 17:47
@DerekMaggio DerekMaggio changed the base branch from edge to EXEC-366_function_timer April 11, 2024 17:54
@DerekMaggio DerekMaggio force-pushed the EXEC-384-robot-context-tracker branch from 1b1e80b to 18e0b15 Compare April 11, 2024 17:58
@DerekMaggio DerekMaggio changed the title Exec 384 robot context tracker feat(performance-metrics): add RobotContextTracker Apr 11, 2024
@DerekMaggio DerekMaggio changed the base branch from EXEC-366_function_timer to edge April 11, 2024 19:13
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One small change but looking great, love the decorator approach

# Overview

Add CI testing and lint checks
# Overview

Add functionality to store CSV data in a file

# Test Plan

- Added test cases to verify storing to a file correctly

# Changelog

- Added `store` method to RobotContextTracker
- Added data shaping to RawContextData
- Tests

# Review requests

None

# Risk assessment

Low
Copy link
Member

@sfoster1 sfoster1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@DerekMaggio DerekMaggio merged commit fa13e30 into edge Apr 15, 2024
5 checks passed
@DerekMaggio DerekMaggio deleted the EXEC-384-robot-context-tracker branch April 15, 2024 15:10
Carlos-fernandez pushed a commit that referenced this pull request May 20, 2024
# Overview

Create RobotContextTracker class.

This class provides a `track` method. 
The track method should be used as a decorator on either a
function/method. It takes a RobotContextState enum value to label what
state the RobotContextTracker is tracking. Uses `FunctionTimer` to
measure execution time and stores results in a list.

RobotContextTracker is defaulted not to track anything at all. To turn
on tracking, instantiate the class with `should_track=True`. When not
tracking, the `track` method calls the underlying wrapped function as
quickly as possible.

# Test Plan

- See test_robot_contest_tracker.py

# Changelog

- Add RobotContextTracker class
- Add test_robot_context_tracker.py

# Review requests

None

# Risk assessment

Low, not being used on any production code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants