kibana/x-pack/plugins/profiling/server
Joseph Crail d8901857aa
[Profiling] Reduce CPU usage for flamegraph and TopN function (#141017)
* Add instrumentation for flamegraph

I inlined the construction of the flamegraph into the respective route
so that we could add fine-grained instrumentation. We now use APM and
console logging to understand how long flamegraph construction takes.

* Remove unnecessary Set usage

* Remove superfluous clone

This was likely added when we needed to avoid infinite recursion when
serializing to JSON. This no longer has a useful function.

* Pass in pre-calculated frame group info

I noticed that we were creating frame group info multiple times so I
added it as a parameter for the intermediate node.

* Sort callees in one place

Callees should be sorted first by samples decreasing and then by frame
groups. Combining the two sorts makes the post-processing clearer to
future readers and/or maintainers.

* Capitalize fields in preparation of merging

* Align both node data structures

* Pass metadata instead of copying fields

* Refactor frame label method

* Use pre-calculated array length

* Use pre-allocated array

* Refactor intermediate node

* Remove intermediate node structure

* Move if statement out of for loop

* Fix comments

* Sort sibling nodes by frame group ID

* Calculate graph size during creation

* Add missing groupStackFrameMetadataByStackTrace

* Fix formatting

* Fix generated callee source

* Fix creation of frame group

* Fix test

* Remove filter for relevant traces

* Stop passing frame group

* Create root node inside createCallerCalleeGraph

* Fix timestamps

* Remove frame group comparator

* Add instrumentation for topN functions

* Allow for missing stacktraces

* Use Date.now instead
2022-09-22 09:37:45 -07:00
..
routes [Profiling] Reduce CPU usage for flamegraph and TopN function (#141017) 2022-09-22 09:37:45 -07:00
utils Move src/core/types/elasticsearch to @kbn/es-types (#140522) 2022-09-20 10:32:13 +02:00
feature.ts [Profiling] Use 'Universal Profiling' everywhere (#140906) 2022-09-19 02:21:14 -07:00
index.ts
plugin.ts
types.ts