Skip to content

Commit

Permalink
Reduce Flamegraph (Elastic) memory consumption (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
rockdaboot committed Jun 8, 2022
1 parent 51a8caf commit b77023c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/profiling/server/routes/search_flameChart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ export function registerFlameChartSearchRoute(router: IRouter<DataRequestHandler
},
async (context, request, response) => {
const { index, projectID, timeFrom, timeTo } = request.query;
const sampleSize = 20000;
const sampleSize = 200;

try {
const esClient = context.core.elasticsearch.client.asCurrentUser;
Expand Down Expand Up @@ -150,6 +150,7 @@ export function registerFlameChartSearchRoute(router: IRouter<DataRequestHandler
const resEvents = await esClient.search({
index: eventsIndex,
body: {
size: 0,
query: {
function_score: {
query: filter,
Expand All @@ -176,6 +177,7 @@ export function registerFlameChartSearchRoute(router: IRouter<DataRequestHandler
const resTotalEvents = await esClient.search({
index,
body: {
size: 0,
query: filter,
aggs: {
histogram: {
Expand Down

0 comments on commit b77023c

Please sign in to comment.