Skip to content

Commit

Permalink
Amend message handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Kerry350 committed Jul 13, 2020
1 parent 9198baf commit 51a1936
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ export const anomalyTypeRT = rt.keyof({
logCategory: null,
});

export type AnomalyType = rt.TypeOf<typeof anomalyTypeRT>;

const logEntryAnomalyCommonFieldsRT = rt.type({
id: rt.string,
anomalyScore: rt.number,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,6 @@ export const LogEntryRateResultsContent: React.FunctionComponent<LogEntryRateRes
sourceId,
startTime: queryTimeRange.value.startTime,
endTime: queryTimeRange.value.endTime,
lastChangedTime: queryTimeRange.lastChangedTime,
defaultSortOptions: SORT_DEFAULTS,
defaultPaginationOptions: PAGINATION_DEFAULTS,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
getFriendlyNameForPartitionId,
formatOneDecimalPlace,
} from '../../../../../../common/log_analysis';
import { AnomalyType } from '../../../../../../common/http_api/log_analysis';
import { RowExpansionButton } from '../../../../../components/basic_table';
import { AnomaliesTableExpandedRow } from './expanded_row';
import { AnomalySeverityIndicator } from '../../../../../components/logging/log_analysis_results/anomaly_severity_indicator';
Expand All @@ -48,7 +49,7 @@ interface TableItem {
startTime: number;
typical: number;
actual: number;
type: string;
type: AnomalyType;
}

const anomalyScoreColumnName = i18n.translate(
Expand Down Expand Up @@ -239,7 +240,8 @@ const AnomalyMessage = ({
const moreThanExpectedAnomalyMessage = i18n.translate(
'xpack.infra.logs.analysis.anomaliesTableMoreThanExpectedAnomalyMessage',
{
defaultMessage: 'higher log messages in this {type, select, logRate {dataset}, logCategory {category}} than expected',
defaultMessage:
'more log messages in this {type, select, logRate {dataset}, logCategory {category}} than expected',
values: { type },
}
);
Expand All @@ -248,7 +250,7 @@ const AnomalyMessage = ({
'xpack.infra.logs.analysis.anomaliesTableFewerThanExpectedAnomalyMessage',
{
defaultMessage: 'fewer log messages in this {messageType} than expected',
values: { messageType },
values: { type },
}
);
const isMore = actual > typical;
Expand Down

0 comments on commit 51a1936

Please sign in to comment.