Skip to content

Commit e178664

Browse files
authored
perf: eliminate flamegraph merge (#3349)
1 parent 1bd65d1 commit e178664

11 files changed

Lines changed: 710 additions & 353 deletions

File tree

api/gen/proto/go/querier/v1/querier.pb.go

Lines changed: 411 additions & 304 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/gen/proto/go/querier/v1/querier_vtproto.pb.go

Lines changed: 168 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/openapiv2/gen/phlare.swagger.json

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,15 @@
10631063
}
10641064
}
10651065
},
1066+
"v1ProfileFormat": {
1067+
"type": "string",
1068+
"enum": [
1069+
"PROFILE_FORMAT_UNSPECIFIED",
1070+
"PROFILE_FORMAT_FLAMEGRAPH",
1071+
"PROFILE_FORMAT_TREE"
1072+
],
1073+
"default": "PROFILE_FORMAT_UNSPECIFIED"
1074+
},
10661075
"v1ProfileSets": {
10671076
"type": "object",
10681077
"properties": {
@@ -1238,6 +1247,11 @@
12381247
"properties": {
12391248
"flamegraph": {
12401249
"$ref": "#/definitions/v1FlameGraph"
1250+
},
1251+
"tree": {
1252+
"type": "string",
1253+
"format": "byte",
1254+
"description": "Pyroscope tree bytes."
12411255
}
12421256
}
12431257
},
@@ -1264,6 +1278,10 @@
12641278
"type": "string",
12651279
"format": "int64",
12661280
"title": "Limit the nodes returned to only show the node with the max_node's biggest total"
1281+
},
1282+
"format": {
1283+
"$ref": "#/definitions/v1ProfileFormat",
1284+
"description": "Profile format specifies the format of profile to be returned.\nIf not specified, the profile will be returned in flame graph format."
12671285
}
12681286
}
12691287
},
@@ -1272,6 +1290,11 @@
12721290
"properties": {
12731291
"flamegraph": {
12741292
"$ref": "#/definitions/v1FlameGraph"
1293+
},
1294+
"tree": {
1295+
"type": "string",
1296+
"format": "byte",
1297+
"description": "Pyroscope tree bytes."
12751298
}
12761299
}
12771300
},

api/querier/v1/querier.proto

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,21 @@ message SelectMergeStacktracesRequest {
6868
int64 end = 4;
6969
// Limit the nodes returned to only show the node with the max_node's biggest total
7070
optional int64 max_nodes = 5;
71+
// Profile format specifies the format of profile to be returned.
72+
// If not specified, the profile will be returned in flame graph format.
73+
ProfileFormat format = 6;
74+
}
75+
76+
enum ProfileFormat {
77+
PROFILE_FORMAT_UNSPECIFIED = 0;
78+
PROFILE_FORMAT_FLAMEGRAPH = 1;
79+
PROFILE_FORMAT_TREE = 2;
7180
}
7281

7382
message SelectMergeStacktracesResponse {
7483
FlameGraph flamegraph = 1;
84+
// Pyroscope tree bytes.
85+
bytes tree = 2;
7586
}
7687

7788
message SelectMergeSpanProfileRequest {
@@ -84,10 +95,15 @@ message SelectMergeSpanProfileRequest {
8495
int64 end = 5;
8596
// Limit the nodes returned to only show the node with the max_node's biggest total
8697
optional int64 max_nodes = 6;
98+
// Profile format specifies the format of profile to be returned.
99+
// If not specified, the profile will be returned in flame graph format.
100+
ProfileFormat format = 7;
87101
}
88102

89103
message SelectMergeSpanProfileResponse {
90104
FlameGraph flamegraph = 1;
105+
// Pyroscope tree bytes.
106+
bytes tree = 2;
91107
}
92108

93109
message DiffRequest {

0 commit comments

Comments
 (0)