Skip to content

Commit

Permalink
renaming
Browse files Browse the repository at this point in the history
  • Loading branch information
benakansara committed Jun 19, 2023
1 parent 767e41a commit 8d22e8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import {
getDomain,
useDateFormatter,
} from './chart_preview_helper';
import { BUCKET_SIZE } from '../../utils/helper';
import { ALERT_PREVIEW_BUCKET_SIZE } from '../../utils/helper';
import { Coordinate } from '../../../../../typings/timeseries';
import { Maybe } from '../../../../../typings/common';

Expand Down Expand Up @@ -108,7 +108,7 @@ export function ChartPreview({

const dateFormatter = useDateFormatter(xMin, xMax);

const lookback = timeSize * BUCKET_SIZE;
const lookback = timeSize * ALERT_PREVIEW_BUCKET_SIZE;
const timeLabel = TIME_LABELS[timeUnit as keyof typeof TIME_LABELS];

const rectDataValues: RectAnnotationDatum[] = [
Expand Down
5 changes: 3 additions & 2 deletions x-pack/plugins/apm/public/components/alerting/utils/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface AlertMetadata {
end?: string;
}

export const BUCKET_SIZE = 5;
export const ALERT_PREVIEW_BUCKET_SIZE = 5;

export function getIntervalAndTimeRange({
windowSize,
Expand All @@ -28,7 +28,8 @@ export function getIntervalAndTimeRange({
const end = Date.now();
const start =
end -
moment.duration(windowSize, windowUnit).asMilliseconds() * BUCKET_SIZE;
moment.duration(windowSize, windowUnit).asMilliseconds() *
ALERT_PREVIEW_BUCKET_SIZE;

return {
interval: `${windowSize}${windowUnit}`,
Expand Down

0 comments on commit 8d22e8a

Please sign in to comment.