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

Use default sample rate of 100 per second for CPU #3342

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkg/model/flamegraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,6 @@ func ExportToFlamebearer(fg *querierv1.FlameGraph, profileType *typesv1.ProfileT
unit = metadata.ObjectsUnits
case "cpu":
unit = metadata.SamplesUnits
sampleRate = uint32(1_000_000_000)

}
levels := make([][]int, len(fg.Levels))
for i := range levels {
Expand Down
2 changes: 1 addition & 1 deletion pkg/og/structs/flamebearer/flamebearer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ type FlamebearerMetadataV1 struct {
Format string `json:"format"`
// Name of the spy / profiler used to generate the profile, if any.
SpyName string `json:"spyName"`
// Sample rate at which the profiler was operating.
// Sample rate at which the profiler was operating. Note: This unit is not related to the Units field and is measured in samples per second.
SampleRate uint32 `json:"sampleRate"`
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I am not too sure if this is the right type and definition. I think it would be better if we would signal the sampleRate per SampleUnit. But for this we would need to change the field to be a float.

The default 100 Hz, would become 0.00001 per nanosecond. Any insights that you have on this @korniltsev

// The unit of measurement for the profiled data.
Units metadata.Units `json:"units"`
Expand Down
Loading