Skip to content

Commit

Permalink
Improve naming
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenlouv committed Dec 14, 2023
1 parent 3cf90c4 commit 5000f50
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions x-pack/plugins/apm/server/routes/historical_data/route.ts
Expand Up @@ -14,18 +14,17 @@ const hasDataRoute = createApmServerRoute({
options: { tags: ['access:apm'] },
handler: async (resources): Promise<{ hasData: boolean }> => {
const apmEventClient = await getApmEventClient(resources);
const hasDataWithTimerange = await hasHistoricalAgentData(apmEventClient, {
limitByDataTier: true,
});
const hasDataInWarmDataTiers = await hasHistoricalAgentData(
apmEventClient,
{ limitByDataTier: true }
);

if (hasDataWithTimerange) {
return { hasData: hasDataWithTimerange };
if (hasDataInWarmDataTiers) {
return { hasData: true };
}

const hasDataWithoutTimerange = await hasHistoricalAgentData(
apmEventClient
);
return { hasData: hasDataWithoutTimerange };
const hasDataUnbounded = await hasHistoricalAgentData(apmEventClient);
return { hasData: hasDataUnbounded };
},
});

Expand Down

0 comments on commit 5000f50

Please sign in to comment.