Skip to content

Commit

Permalink
Use default sample rate of 100 per second for CPU
Browse files Browse the repository at this point in the history
This fixes the default sample rate for profiling and clarfies the field
value. Relates to #3340.
  • Loading branch information
simonswine committed Jun 6, 2024
1 parent a839566 commit dcf5123
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
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"`
// The unit of measurement for the profiled data.
Units metadata.Units `json:"units"`
Expand Down

0 comments on commit dcf5123

Please sign in to comment.