Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ui: Improve showing filtered and trimmed nodes in ProfileIcicleGraph #2758

Merged
merged 7 commits into from
Mar 21, 2023
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
591 changes: 320 additions & 271 deletions gen/proto/go/parca/query/v1alpha1/query.pb.go

Large diffs are not rendered by default.

81 changes: 81 additions & 0 deletions gen/proto/go/parca/query/v1alpha1/query_vtproto.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 19 additions & 4 deletions gen/proto/swagger/parca/query/v1alpha1/query.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,16 @@
"callgraph": {
"$ref": "#/definitions/v1alpha1Callgraph",
"title": "callgraph is a callgraph nodes and edges representation of the report"
},
"total": {
"type": "string",
"format": "int64",
"description": "total is the total number of samples shown in the report."
},
"filtered": {
"type": "string",
"format": "int64",
"description": "filtered is the number of samples filtered out of the report."
}
},
"title": "QueryResponse is the returned report for the given query"
Expand Down Expand Up @@ -826,7 +836,7 @@
"cumulative": {
"type": "string",
"format": "int64",
"title": "cumulative is the total cumulative value of the callgraph"
"description": "cumulative is the total cumulative value of the callgraph\nUse total from the top level query response instead."
}
},
"title": "Callgraph is the callgraph report type"
Expand Down Expand Up @@ -928,7 +938,7 @@
"total": {
"type": "string",
"format": "int64",
"title": "total is the total weight of the flame graph"
"description": "total is the total weight of the flame graph\nUse total from the top level query response instead."
},
"unit": {
"type": "string",
Expand Down Expand Up @@ -973,7 +983,12 @@
"untrimmedTotal": {
"type": "string",
"format": "int64",
"title": "untrimmed_total is the total weight of the flame graph before trimming"
"description": "untrimmed_total is the total weight of the flame graph before trimming.\nUse trimmed instead."
},
"trimmed": {
"type": "string",
"format": "int64",
"description": "trimmed is the amount of samples trimmed from the flame graph."
}
},
"title": "Flamegraph is the flame graph report type"
Expand Down Expand Up @@ -1313,7 +1328,7 @@
"total": {
"type": "integer",
"format": "int32",
"title": "total is the number of lines that exist in the report"
"description": "total is the number of lines that exist in the report\nUse total from the top level query response instead."
},
"unit": {
"type": "string",
Expand Down
13 changes: 9 additions & 4 deletions gen/proto/swagger/parca/share/v1alpha1/share.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@
"cumulative": {
"type": "string",
"format": "int64",
"title": "cumulative is the total cumulative value of the callgraph"
"description": "cumulative is the total cumulative value of the callgraph\nUse total from the top level query response instead."
}
},
"title": "Callgraph is the callgraph report type"
Expand Down Expand Up @@ -380,7 +380,7 @@
"total": {
"type": "string",
"format": "int64",
"title": "total is the total weight of the flame graph"
"description": "total is the total weight of the flame graph\nUse total from the top level query response instead."
},
"unit": {
"type": "string",
Expand Down Expand Up @@ -425,7 +425,12 @@
"untrimmedTotal": {
"type": "string",
"format": "int64",
"title": "untrimmed_total is the total weight of the flame graph before trimming"
"description": "untrimmed_total is the total weight of the flame graph before trimming.\nUse trimmed instead."
},
"trimmed": {
"type": "string",
"format": "int64",
"description": "trimmed is the amount of samples trimmed from the flame graph."
}
},
"title": "Flamegraph is the flame graph report type"
Expand Down Expand Up @@ -563,7 +568,7 @@
"total": {
"type": "integer",
"format": "int32",
"title": "total is the number of lines that exist in the report"
"description": "total is the number of lines that exist in the report\nUse total from the top level query response instead."
},
"unit": {
"type": "string",
Expand Down
2 changes: 2 additions & 0 deletions pkg/query/callgraph.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ func prunableNodes(nodes []*querypb.CallgraphNode, c int64) []*querypb.Callgraph
}

func pruneGraph(graph *querypb.Callgraph) *querypb.Callgraph {
//nolint:staticcheck // SA1019: This needs to be updated in a follow-up PR.
prunableNodes := prunableNodes(graph.Nodes, graph.Cumulative)
finalNodes := make([]*querypb.CallgraphNode, 0)
finalEdges := make([]*querypb.CallgraphEdge, 0)
Expand Down Expand Up @@ -268,6 +269,7 @@ func pruneGraph(graph *querypb.Callgraph) *querypb.Callgraph {
}
finalEdges = append(finalEdges, edgesToCreate...)

//nolint:staticcheck // SA1019: Fow now we want to support these APIs
return &querypb.Callgraph{Nodes: finalNodes, Edges: finalEdges, Cumulative: graph.Cumulative}
}

Expand Down
1 change: 1 addition & 0 deletions pkg/query/callgraph_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func TestGenerateCallgraph(t *testing.T) {
require.NoError(t, err)
require.NotNil(t, res)

//nolint:staticcheck // SA1019: Fow now we want to support these APIs
require.Equal(t, int64(310797348), res.Cumulative, "Root cummulative value mismatch")

/*
Expand Down
Loading