Skip to content

Calculate sample rate correctly #4440

@simonswine

Description

@simonswine

The flamebearer metadata passes the sample rate to the frontend:

SampleRate uint32 `json:"sampleRate"`
, we currently hard code the value:

sampleRate := uint32(100)

While the older version of flamebearer calculated it from PeriodDuration:

if c, ok := tree.DefaultSampleTypeMapping[stype]; ok {
units = c.Units
if c.Sampled && p.Period > 0 {
sampleRate = uint32(time.Second / time.Duration(p.Period))
}
}

In reality the data in Duration is not propagated correctly in our query path as those values remain unpopulated.

#4192

Related #3342

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions