Skip to content

Commit

Permalink
expose samples example index
Browse files Browse the repository at this point in the history
  • Loading branch information
Zylphrex committed Aug 8, 2024
1 parent eae7546 commit c364068
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/flamegraph/flamegraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ func toSpeedscope(trees []*nodetree.Node, minFreq int, projectID uint64) speedsc
aggProfiles[0] = speedscope.SampledProfile{
Samples: fd.samples,
SamplesProfiles: fd.samplesProfileIDs,
SamplesExamples: fd.samplesProfiles,
Weights: fd.sampleCounts,
SampleCounts: fd.sampleCounts,
SampleDurationsNs: fd.sampleDurationsNs,
Expand Down
2 changes: 2 additions & 0 deletions internal/flamegraph/flamegraph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ func TestFlamegraphAggregation(t *testing.T) {
{0},
{1},
},
SamplesExamples: [][]int{{}, {}, {}, {}},
Type: "sampled",
Unit: "count",
Weights: []uint64{2, 1, 1, 1},
Expand Down Expand Up @@ -263,6 +264,7 @@ func TestAnnotatingWithExamples(t *testing.T) {
{0},
},
SamplesProfiles: [][]int{{}, {}},
SamplesExamples: [][]int{{0, 1}, {0, 1}},
Type: "sampled",
Unit: "count",
Weights: []uint64{2, 2},
Expand Down
1 change: 1 addition & 0 deletions internal/speedscope/speedscope.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ type (
Queues map[string]Queue `json:"queues,omitempty"`
Samples [][]int `json:"samples"`
SamplesProfiles [][]int `json:"samples_profiles,omitempty"`
SamplesExamples [][]int `json:"samples_examples,omitempty"`
StartValue uint64 `json:"startValue"`
State string `json:"state,omitempty"`
ThreadID uint64 `json:"threadID"`
Expand Down

0 comments on commit c364068

Please sign in to comment.