Skip to content

Refactor error handling and message printing - #35

Merged
kazeburo merged 1 commit into
masterfrom
kazeburo-patch-1
Aug 16, 2026
Merged

Refactor error handling and message printing#35
kazeburo merged 1 commit into
masterfrom
kazeburo-patch-1

Conversation

@kazeburo

@kazeburo kazeburo commented Aug 16, 2026

Copy link
Copy Markdown
Member

PR Type

Bug fix


Description

  • Suppress stale metric output after collection errors

  • Print CPU, FDs, and memory results only on success


Diagram Walkthrough

flowchart LR
  Collect["Collect metric statistics"]
  Error["Report collection error"]
  Output["Print metric output"]
  Collect -- "fails" --> Error
  Collect -- "succeeds with message" --> Output
Loading

File Walkthrough

Relevant files
Bug fix
main.go
Guard metric output after collection errors                           

main.go

  • Print CPU statistics only when cpuStat succeeds.
  • Print file-descriptor statistics only when fdsStat succeeds.
  • Print memory statistics only when memStat succeeds.
+3/-6     

@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 No relevant tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

PR Code Suggestions ✨

No code suggestions found for the PR.

@kazeburo
kazeburo merged commit 19ffa22 into master Aug 16, 2026
3 checks passed
@kazeburo
kazeburo deleted the kazeburo-patch-1 branch August 16, 2026 14:30
@github-actions github-actions Bot mentioned this pull request Aug 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant