-
Notifications
You must be signed in to change notification settings - Fork 219
Move boot time message sending logic to SystemdAnalyze class #4060
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
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: squirrelsc <[email protected]>
…fiedPerfMessage Co-authored-by: squirrelsc <[email protected]>
… time data Co-authored-by: squirrelsc <[email protected]>
Co-authored-by: squirrelsc <[email protected]>
lisa/tools/systemd_analyze.py
Outdated
| def _send_unified_boot_time_metrics( | ||
| self, | ||
| boot_time: ProvisionBootTimeMessage, | ||
| test_result: "TestResult", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Remove test_result: "TestResult", test_case_name: str = "". Set related
- Make testresult is optional in underlying method:
send_unified_perf_message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed test_result and test_case_name parameters and removed all UnifiedPerfMessage sending logic since it's not needed. The method now only sends ProvisionBootTimeMessage. Commit: eebdc4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Revert the commit. The PR is to send unified perf message. Move underlying test_result is optional for send_unified_perf_message.
Co-authored-by: squirrelsc <[email protected]>
Overview
This PR moves the boot time message sending logic from
operating_system.pyto theSystemdAnalyzeclass, centralizing boot time message handling in a single location.Problem
The boot time message sending logic was scattered between
operating_system.pyand theSystemdAnalyzetool, making it harder to maintain and understand. The logic inoperating_system.pydirectly calledget_boot_time()and handled the notification manually.Solution
Moved the boot time message sending logic to a new
send_boot_time_messages()method inlisa/tools/systemd_analyze.py:New
send_boot_time_messages()method:This method:
get_boot_time()to retrieve boot time dataProvisionBootTimeMessagenotificationUpdated
operating_system.py:SystemdAnalyze.send_boot_time_messages()systemd_analyze_tool.send_boot_time_messages()instead of manually handling boot timeUsage
When
capture_boot_timeis enabled, boot time messages are automatically sent during system initialization by calling thesend_boot_time_messages()method on theSystemdAnalyzetool.Benefits
SystemdAnalyzeclassProvisionBootTimeMessagebehavior unchangedTesting
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.