Skip to content

daemon: minor cleanups for getting system info#49185

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:daemon_info_cleanups
Jan 1, 2025
Merged

daemon: minor cleanups for getting system info#49185
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:daemon_info_cleanups

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

  • rename variables that shadowed functions
  • use strconv.FormatBool instead of fmt.Sprintf to reduce some allocations
  • use structured logs for some warnings
  • remove some intermediate vars in favor of early returns

- A picture of a cute animal (not mandatory but encouraged)

@thaJeztah thaJeztah added status/2-code-review area/daemon Core Engine kind/refactor PR's that refactor, or clean-up code labels Jan 1, 2025
@thaJeztah thaJeztah added this to the 28.0.0 milestone Jan 1, 2025
@thaJeztah thaJeztah self-assigned this Jan 1, 2025
Comment thread daemon/info.go Outdated
memInfo, err := meminfo.Read()
mi, err := meminfo.Read()
if err != nil {
log.G(ctx).Errorf("Could not read system memory info: %v", err)
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Oh! Looks like I missed one; let me update this one as well while I'm at it 🙈

@thaJeztah thaJeztah force-pushed the daemon_info_cleanups branch from f077112 to c383642 Compare January 1, 2025 14:00
- rename variables that shadowed functions
- use strconv.FormatBool instead of fmt.Sprintf to reduce some allocations
- use structured logs for some warnings
- remove some intermediate vars in favor of early returns

Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah force-pushed the daemon_info_cleanups branch from c383642 to aa7493f Compare January 1, 2025 15:10
@thaJeztah thaJeztah merged commit 700c91b into moby:master Jan 1, 2025
@thaJeztah thaJeztah deleted the daemon_info_cleanups branch January 1, 2025 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/daemon Core Engine kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants