Skip to content

feat: WithCPUSamplingTime#155

Merged
cch123 merged 1 commit intomosn:masterfrom
suhuaqin:feat/WithCPUSamplingTime
Apr 23, 2025
Merged

feat: WithCPUSamplingTime#155
cch123 merged 1 commit intomosn:masterfrom
suhuaqin:feat/WithCPUSamplingTime

Conversation

@suhuaqin
Copy link
Copy Markdown
Contributor

It is hoped that the cpu collection duration can be customized

@cch123 cch123 requested a review from Copilot April 23, 2025 07:01
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds the ability to customize the CPU sampling time for profiling. Key changes include:

  • Adding a new CPUSamplingTime field in options.go.
  • Introducing a WithCPUSamplingTime functional option for setting a custom CPU sampling time.
  • Updating holmes.go to use the custom CPUSamplingTime value during profiling.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
options.go Adds CPUSamplingTime field and functional option; initializes with a default.
holmes.go Replaces hardcoded sleep duration with the configurable CPUSamplingTime.
Comments suppressed due to low confidence (1)

options.go:247

  • The fallback for non-positive durations uses defaultInterval instead of defaultCPUSamplingTime, which may cause inconsistent configuration. Consider changing it to defaultCPUSamplingTime.
if newDuration <= 0 { newDuration = defaultInterval }

@cch123 cch123 merged commit 41be02e into mosn:master Apr 23, 2025
2 checks passed
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.

3 participants