Skip to content

Commit

Permalink
Add max bucket anomaly score
Browse files Browse the repository at this point in the history
  • Loading branch information
weltenwort committed Oct 8, 2019
1 parent 4119a05 commit 8d887a8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const logEntryRatePartitionRT = rt.type({
analysisBucketCount: rt.number,
anomalies: rt.array(logEntryRateAnomaly),
averageActualLogEntryRate: rt.number,
maximumAnomalyScore: rt.number,
partitionId: rt.string,
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export class InfraLogAnalysis {
typicalLogEntryRate: number;
}>;
averageActualLogEntryRate: number;
maximumAnomalyScore: number;
partitionId: string;
}>;
startTime: number;
Expand All @@ -108,7 +109,10 @@ export class InfraLogAnalysis {
typicalLogEntryRate: record.typical[0],
})
),
averageActualLogEntryRate: timestampPartitionBucket.filter_model_plot.average_actual.value || 0,
averageActualLogEntryRate:
timestampPartitionBucket.filter_model_plot.average_actual.value || 0,
maximumAnomalyScore:
timestampPartitionBucket.filter_records.maximum_record_score.value || 0,
partitionId: timestampPartitionBucket.key.partition,
};
if (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ export const createLogEntryRateQuery = (
},
},
aggs: {
maximum_record_score: {
max: {
field: 'record_score',
},
},
top_hits_record: {
top_hits: {
_source: Object.keys(logRateMlRecordRT.props),
Expand Down Expand Up @@ -138,6 +143,7 @@ export const logRateModelPlotBucketRT = rt.type({
key: compositeTimestampPartitionKeyRT,
filter_records: rt.type({
doc_count: rt.number,
maximum_record_score: metricAggregationRT,
top_hits_record: rt.type({
hits: rt.type({
hits: rt.array(
Expand Down

0 comments on commit 8d887a8

Please sign in to comment.