Skip to content
Merged
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
1 change: 0 additions & 1 deletion internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ func (ma *Aggregator) AddFunctions(functions []nodetree.CallTreeFunction, result
fn.SampleCount += f.SampleCount
fn.DurationsNS = append(fn.DurationsNS, f.DurationsNS...)
fn.SumDurationNS += f.SumDurationNS
fn.SelfTimesNS = append(fn.SelfTimesNS, f.SelfTimesNS...)
fn.SumSelfTimeNS += f.SumSelfTimeNS
funcMetadata := ma.FunctionsMetadata[f.Fingerprint]
if f.SumSelfTimeNS > funcMetadata.MaxVal {
Expand Down
6 changes: 0 additions & 6 deletions internal/metrics/metrics_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@ func TestAggregatorAddFunctions(t *testing.T) {
{
Function: "a",
Fingerprint: 0,
SelfTimesNS: []uint64{10, 5, 25},
SumSelfTimeNS: 40,
DurationsNS: []uint64{10, 5, 25},
SumDurationNS: 40,
},
{
Function: "b",
Fingerprint: 1,
SelfTimesNS: []uint64{45, 60},
SumSelfTimeNS: 105,
DurationsNS: []uint64{45, 60},
SumDurationNS: 105,
Expand All @@ -42,15 +40,13 @@ func TestAggregatorAddFunctions(t *testing.T) {
0: {
Function: "a",
Fingerprint: 0,
SelfTimesNS: []uint64{10, 5, 25, 10, 5, 25},
SumSelfTimeNS: 80,
DurationsNS: []uint64{10, 5, 25, 10, 5, 25},
SumDurationNS: 80,
},
1: {
Function: "b",
Fingerprint: 1,
SelfTimesNS: []uint64{45, 60, 45, 60},
SumSelfTimeNS: 210,
DurationsNS: []uint64{45, 60, 45, 60},
SumDurationNS: 210,
Expand Down Expand Up @@ -100,7 +96,6 @@ func TestAggregatorToMetrics(t *testing.T) {
Fingerprint: 0,
DurationsNS: []uint64{1, 2, 3, 4, 10, 8, 7, 11, 20},
SumDurationNS: 66,
SelfTimesNS: []uint64{1, 2, 3, 4, 10, 8, 7, 11, 20},
SumSelfTimeNS: 66,
SampleCount: 2,
},
Expand All @@ -109,7 +104,6 @@ func TestAggregatorToMetrics(t *testing.T) {
Fingerprint: 1,
DurationsNS: []uint64{1, 2, 3, 4, 10, 8, 7, 11, 20},
SumDurationNS: 66,
SelfTimesNS: []uint64{1, 2, 3, 4, 10, 8, 7, 11, 20},
SumSelfTimeNS: 66,
SampleCount: 2,
},
Expand Down
3 changes: 0 additions & 3 deletions internal/nodetree/nodetree.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ type CallTreeFunction struct {
InApp bool `json:"in_app"`
DurationsNS []uint64 `json:"durations_ns"`
SumDurationNS uint64 `json:"-"`
SelfTimesNS []uint64 `json:"self_times_ns"`
SumSelfTimeNS uint64 `json:"-"`
SampleCount int `json:"-"`
ThreadID string `json:"thread_id"`
Expand Down Expand Up @@ -210,7 +209,6 @@ func (n *Node) CollectFunctions(
InApp: n.IsApplication,
DurationsNS: []uint64{n.DurationNS},
SumDurationNS: n.DurationNS,
SelfTimesNS: []uint64{},
SumSelfTimeNS: 0,
SampleCount: n.SampleCount,
ThreadID: threadID,
Expand All @@ -229,7 +227,6 @@ func (n *Node) CollectFunctions(
}

if selfTimeNS > 0 {
function.SelfTimesNS = append(function.SelfTimesNS, selfTimeNS)
function.SumSelfTimeNS += selfTimeNS
}

Expand Down
15 changes: 0 additions & 15 deletions internal/nodetree/nodetree_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "foo",
DurationsNS: []uint64{10},
SumDurationNS: 10,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand All @@ -68,7 +67,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "foo",
DurationsNS: []uint64{10},
SumDurationNS: 10,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand Down Expand Up @@ -103,7 +101,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "foo",
DurationsNS: []uint64{20},
SumDurationNS: 20,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand All @@ -114,7 +111,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "bar",
DurationsNS: []uint64{10},
SumDurationNS: 10,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand Down Expand Up @@ -167,7 +163,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Function: "bar",
Package: "bar",
DurationsNS: []uint64{10},
SelfTimesNS: []uint64{},
SumDurationNS: 10,
MaxDuration: 0,
},
Expand All @@ -178,7 +173,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "foo",
DurationsNS: []uint64{10},
SumDurationNS: 10,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand All @@ -189,7 +183,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "baz",
DurationsNS: []uint64{10},
SumDurationNS: 10,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand All @@ -200,7 +193,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "main",
DurationsNS: []uint64{10},
SumDurationNS: 10,
SelfTimesNS: []uint64{},
SumSelfTimeNS: 0,
MaxDuration: 0,
},
Expand Down Expand Up @@ -297,7 +289,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Function: "bar",
Package: "bar",
DurationsNS: []uint64{10, 20},
SelfTimesNS: []uint64{},
SumDurationNS: 30,
MaxDuration: 0,
},
Expand All @@ -308,7 +299,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "foo",
DurationsNS: []uint64{10, 20},
SumDurationNS: 30,
SelfTimesNS: []uint64{10, 20},
SumSelfTimeNS: 30,
MaxDuration: 20,
},
Expand All @@ -319,7 +309,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "baz",
DurationsNS: []uint64{10, 20},
SumDurationNS: 30,
SelfTimesNS: []uint64{10, 20},
SumSelfTimeNS: 30,
MaxDuration: 20,
},
Expand All @@ -330,7 +319,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "qux",
DurationsNS: []uint64{10},
SumDurationNS: 10,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand All @@ -341,7 +329,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
Package: "main",
DurationsNS: []uint64{40},
SumDurationNS: 40,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand Down Expand Up @@ -396,7 +383,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
InApp: true,
DurationsNS: []uint64{10},
SumDurationNS: 10,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand Down Expand Up @@ -433,7 +419,6 @@ func TestNodeTreeCollectFunctions(t *testing.T) {
InApp: true,
DurationsNS: []uint64{10},
SumDurationNS: 10,
SelfTimesNS: []uint64{10},
SumSelfTimeNS: 10,
MaxDuration: 10,
},
Expand Down
Loading