Skip to content

Commit

Permalink
Merge pull request #17 from optimyze/tim/remove-flamegraph-query
Browse files Browse the repository at this point in the history
Remove superfluous query from flamegraph code
  • Loading branch information
rockdaboot authored Feb 16, 2022
2 parents ad9e293 + e06465f commit 736f27b
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 27 deletions.
4 changes: 1 addition & 3 deletions src/plugins/profiling/server/routes/flamegraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,12 @@ function getLabel(frame: any, executable: any, type: number) {

export class FlameGraph {
events: any;
totalEvents: any;
stacktraces: any;
stackframes: any;
executables: any;

constructor(events: any, totalEvents: any, stackTraces: any, stackFrames: any, executables: any) {
constructor(events: any, stackTraces: any, stackFrames: any, executables: any) {
this.events = events;
this.totalEvents = totalEvents;
this.stacktraces = stackTraces;
this.stackframes = stackFrames;
this.executables = executables;
Expand Down
24 changes: 0 additions & 24 deletions src/plugins/profiling/server/routes/search_flamechart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,29 +124,6 @@ export function registerFlameChartSearchRoute(router: IRouter<DataRequestHandler
},
});

const resTotalEvents = await esClient.search({
index,
body: {
size: 0,
query: filter,
aggs: {
histogram: {
auto_date_histogram: {
field: '@timestamp',
buckets: 100,
},
aggs: {
Count: {
sum: {
field: 'Count',
},
},
},
},
},
},
});

const tracesDocIDs: string[] = [];
resEvents.body.aggregations.sample.group_by.buckets.forEach((stackTraceItem: any) => {
tracesDocIDs.push(stackTraceItem.key);
Expand Down Expand Up @@ -189,7 +166,6 @@ export function registerFlameChartSearchRoute(router: IRouter<DataRequestHandler

const flamegraph = new FlameGraph(
resEvents.body,
resTotalEvents.body,
resStackTraces.body.docs,
resStackFrames.body.docs,
resExecutables.body.docs
Expand Down

0 comments on commit 736f27b

Please sign in to comment.