Skip to content

Commit

Permalink
addressing PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Mar 8, 2021
1 parent 648f0f4 commit 6d9d249
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,13 @@ function getSelectOptions({
}),
};

const dateDiff = Math.round(
const dateDiff = Number(
getDateDifference({
start: momentStart,
end: momentEnd,
unitOfTime: 'days',
precise: true,
})
}).toFixed(2)
);

const isRangeToNow = rangeTo === 'now';
Expand Down
13 changes: 3 additions & 10 deletions x-pack/plugins/apm/public/selectors/latency_chart_selectors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,12 @@ export function getLatencyChartSelector({
latencyChart?: LatencyChartsResponse;
theme: EuiTheme;
latencyAggregationType?: string;
}): LatencyChartData {
}): Partial<LatencyChartData> {
if (
!latencyChart?.currentPeriod.latencyTimeseries ||
!latencyAggregationType
) {
return {
currentPeriod: undefined,
previousPeriod: undefined,
mlJobId: undefined,
anomalyTimeseries: undefined,
};
return {};
}
return {
currentPeriod: getLatencyTimeseries({
Expand Down Expand Up @@ -73,9 +68,7 @@ function getPreviousPeriodTimeseries({
color: theme.eui.euiColorLightestShade,
title: i18n.translate(
'xpack.apm.serviceOverview.latencyChartTitle.previousPeriodLabel',
{
defaultMessage: 'Previous period',
}
{ defaultMessage: 'Previous period' }
),
};
}
Expand Down

0 comments on commit 6d9d249

Please sign in to comment.