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

Feature/task monitor api #171

Merged
merged 4 commits into from
Mar 5, 2024
Merged

Feature/task monitor api #171

merged 4 commits into from
Mar 5, 2024

Conversation

finger563
Copy link
Contributor

@finger563 finger563 commented Mar 5, 2024

Description

  • Update monitor API to support getting structured representations of the data for further inspection
  • Update naming of static API calls for consistency
  • Update monitor example to have more varied CPU utilization and to better showcase the monitor output rather than the task output
  • rebuild docs

Motivation and Context

  • Allows callers to get structured data for the tasks for analysis, inspection, and action
  • Returns the actual table object instead of a string - allowing conversion to other table representations such as markdown.

How has this been tested?

Building and running the monitor example on QtPy ESP32S3.

Screenshots (if appropriate, e.g. schematic, board, console logs, lab pictures):

CleanShot 2024-03-05 at 14 36 04

Markdown table copied below:

Task Name CPU % High Water Mark Priority
main 1 % 14264 B 1
IDLE 95 % 824 B 0
IDLE 90 % 816 B 0
Task 9 <1% 4156 B 5
Task 6 <1% 4148 B 5
Task 5 <1% 4156 B 5
Task 1 <1% 4176 B 5
Task 2 <1% 4156 B 5
Task 0 <1% 4156 B 5
Task 8 <1% 4148 B 5
Task 7 <1% 4156 B 5
Task 4 <1% 4148 B 5
Task 3 <1% 4152 B 5
ipc1 4 % 520 B 24
ipc0 4 % 512 B 24
esp_timer <1% 3344 B 22

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation Update
  • Hardware (schematic, board, system design) change
  • Software change

Checklist:

  • My change requires a change to the documentation.
  • I have added / updated the documentation related to this change via either README or WIKI

Software

  • I have added tests to cover my changes.
  • I have updated the .github/workflows/build.yml file to add my new test to the automated cloud build github action.
  • All new and existing tests passed.
  • My code follows the code style of this project.

* Update monitor API to support getting structured representations of the data for further inspection
* Update naming of static API calls for consistency
* Update monitor example to have more varied CPU utilization and to better showcase the monitor output rather than the task output
@finger563 finger563 self-assigned this Mar 5, 2024
@finger563 finger563 added enhancement New feature or request monitor labels Mar 5, 2024
@finger563 finger563 merged commit 5ef4de0 into main Mar 5, 2024
16 of 17 checks passed
@finger563 finger563 deleted the feature/task-monitor-api branch March 5, 2024 20:46
Copy link

github-actions bot commented Mar 5, 2024

⚡ Static analysis result ⚡

🔴 cppcheck found 2 issues! Click here to see details.

for (const auto &t : task_info) {
if (t.cpu_percent > 0.0f) {
info += fmt::format("{},{},{},{};", t.name, t.cpu_percent, t.high_water_mark, t.priority);
} else {
info += fmt::format("{},<1%,{},{};", t.name, 0, t.high_water_mark, t.priority);
}

!Line: 168 - style: Iterating over container 'task_info' that is always empty. [knownEmptyContainer]

for (const auto &t : task_info) {
std::string percent = t.cpu_percent > 0 ? fmt::format("{} %", t.cpu_percent) : "<1%";
table.add_row(
{t.name, percent, fmt::format("{} B", t.high_water_mark), fmt::format("{}", t.priority)});
}
return table;

!Line: 192 - style: Iterating over container 'task_info' that is always empty. [knownEmptyContainer]


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request monitor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant