Skip to content

Commit

Permalink
Move table to using arrow (#3659)
Browse files Browse the repository at this point in the history
* pkg/query: Create TableArrow report type

* pkg/query: Create GenerateTable to return arrow record

* [pre-commit.ci lite] apply automatic fixes

* pkg/query/table: Add test and support for unsymbolized profiles

* pkg/query: Use `(null)` string when testing string dictionaries

* pkg/query/table: Fix flat values

* ui/shared/profile: Don't break adding arrow to TopTableData

* pkg/query/table: Fix flat values and tests

* ui/shared/profile: Add flatDiff and cumulativeDiff columns

Also start using the columnsVisibility feature by react-table rather than adding columns manually like before.

* pkg/query: Post rebase fixes

* pkg/query/table: Add comment about map check not panicking

---------

Co-authored-by: pre-commit-ci-lite[bot] <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com>
  • Loading branch information
metalmatze and pre-commit-ci-lite[bot] authored Aug 23, 2023
1 parent cec1f8a commit 14e0e67
Show file tree
Hide file tree
Showing 14 changed files with 1,884 additions and 423 deletions.
828 changes: 465 additions & 363 deletions gen/proto/go/parca/query/v1alpha1/query.pb.go

Large diffs are not rendered by default.

254 changes: 254 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.

29 changes: 25 additions & 4 deletions gen/proto/swagger/parca/query/v1alpha1/query.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@
},
{
"name": "reportType",
"description": "report_type is the type of report to return\n\n - REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information",
"description": "report_type is the type of report to return\n\n - REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information\n - REPORT_TYPE_TABLE_ARROW: REPORT_TYPE_TABLE_ARROW unspecified",
"in": "query",
"required": false,
"type": "string",
Expand All @@ -310,7 +310,8 @@
"REPORT_TYPE_CALLGRAPH",
"REPORT_TYPE_FLAMEGRAPH_TABLE",
"REPORT_TYPE_FLAMEGRAPH_ARROW",
"REPORT_TYPE_SOURCE"
"REPORT_TYPE_SOURCE",
"REPORT_TYPE_TABLE_ARROW"
],
"default": "REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED"
},
Expand Down Expand Up @@ -549,10 +550,11 @@
"REPORT_TYPE_CALLGRAPH",
"REPORT_TYPE_FLAMEGRAPH_TABLE",
"REPORT_TYPE_FLAMEGRAPH_ARROW",
"REPORT_TYPE_SOURCE"
"REPORT_TYPE_SOURCE",
"REPORT_TYPE_TABLE_ARROW"
],
"default": "REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED",
"description": "- REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information",
"description": "- REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information\n - REPORT_TYPE_TABLE_ARROW: REPORT_TYPE_TABLE_ARROW unspecified",
"title": "ReportType is the type of report to return"
},
"metastorev1alpha1Function": {
Expand Down Expand Up @@ -797,6 +799,10 @@
"$ref": "#/definitions/queryv1alpha1Source",
"title": "source is the source report type result"
},
"tableArrow": {
"$ref": "#/definitions/v1alpha1TableArrow",
"title": "table_arrow is a table encoded as a arrow record"
},
"total": {
"type": "string",
"format": "int64",
Expand Down Expand Up @@ -1432,6 +1438,21 @@
},
"description": "SourceReference contains a reference to source code."
},
"v1alpha1TableArrow": {
"type": "object",
"properties": {
"record": {
"type": "string",
"format": "byte",
"title": "record is the arrow record containing the actual table data"
},
"unit": {
"type": "string",
"title": "unit is the unit represented by the flame graph"
}
},
"title": "TableArrow has the table encoded as a arrow record"
},
"v1alpha1Top": {
"type": "object",
"properties": {
Expand Down
5 changes: 3 additions & 2 deletions gen/proto/swagger/parca/share/v1alpha1/share.swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,11 @@
"REPORT_TYPE_CALLGRAPH",
"REPORT_TYPE_FLAMEGRAPH_TABLE",
"REPORT_TYPE_FLAMEGRAPH_ARROW",
"REPORT_TYPE_SOURCE"
"REPORT_TYPE_SOURCE",
"REPORT_TYPE_TABLE_ARROW"
],
"default": "REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED",
"description": "- REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information",
"description": "- REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED: REPORT_TYPE_FLAMEGRAPH_UNSPECIFIED unspecified\n - REPORT_TYPE_PPROF: REPORT_TYPE_PPROF unspecified\n - REPORT_TYPE_TOP: REPORT_TYPE_TOP unspecified\n - REPORT_TYPE_CALLGRAPH: REPORT_TYPE_CALLGRAPH unspecified\n - REPORT_TYPE_FLAMEGRAPH_TABLE: REPORT_TYPE_FLAMEGRAPH_TABLE unspecified\n - REPORT_TYPE_FLAMEGRAPH_ARROW: REPORT_TYPE_FLAMEGRAPH_ARROW unspecified\n - REPORT_TYPE_SOURCE: REPORT_TYPE_SOURCE contains source code annotated with profiling information\n - REPORT_TYPE_TABLE_ARROW: REPORT_TYPE_TABLE_ARROW unspecified",
"title": "ReportType is the type of report to return"
},
"metastorev1alpha1Function": {
Expand Down
12 changes: 12 additions & 0 deletions pkg/query/columnquery.go
Original file line number Diff line number Diff line change
Expand Up @@ -592,6 +592,18 @@ func RenderReport(
Filtered: filtered,
Report: &pb.QueryResponse_Top{Top: top},
}, nil
case pb.QueryRequest_REPORT_TYPE_TABLE_ARROW:
table, cumulative, err := GenerateTable(ctx, mem, tracer, p)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to generate table: %v", err.Error())
}

return &pb.QueryResponse{
Total: cumulative,
Filtered: filtered,
Report: &pb.QueryResponse_TableArrow{TableArrow: table},
}, nil

case pb.QueryRequest_REPORT_TYPE_CALLGRAPH:
op, err := converter.Convert(ctx, p)
if err != nil {
Expand Down
Loading

0 comments on commit 14e0e67

Please sign in to comment.