Skip to content

Commit dcf5123

Browse files
committed
Use default sample rate of 100 per second for CPU
This fixes the default sample rate for profiling and clarfies the field value. Relates to #3340.
1 parent a839566 commit dcf5123

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

pkg/model/flamegraph.go

-2
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@ func ExportToFlamebearer(fg *querierv1.FlameGraph, profileType *typesv1.ProfileT
132132
unit = metadata.ObjectsUnits
133133
case "cpu":
134134
unit = metadata.SamplesUnits
135-
sampleRate = uint32(1_000_000_000)
136-
137135
}
138136
levels := make([][]int, len(fg.Levels))
139137
for i := range levels {

pkg/og/structs/flamebearer/flamebearer.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ type FlamebearerMetadataV1 struct {
8282
Format string `json:"format"`
8383
// Name of the spy / profiler used to generate the profile, if any.
8484
SpyName string `json:"spyName"`
85-
// Sample rate at which the profiler was operating.
85+
// 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.
8686
SampleRate uint32 `json:"sampleRate"`
8787
// The unit of measurement for the profiled data.
8888
Units metadata.Units `json:"units"`

0 commit comments

Comments
 (0)