Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ML] Fix "View by" swim lane with applied filter and sorting by score #105217

Merged
merged 5 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,9 @@ const loadExplorerDataProvider = (
swimlaneLimit,
viewByPerPage,
viewByFromPage,
swimlaneContainerWidth
swimlaneContainerWidth,
selectionInfluencers,
influencersFilterQuery
)
: Promise.resolve([]),
}).pipe(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,6 @@ declare interface LoadOverallDataResponse {
overallSwimlaneData: OverallSwimlaneData;
}

export declare const loadViewByTopFieldValuesForSelectedTime: (
earliestMs: number,
latestMs: number,
selectedJobs: ExplorerJob[],
viewBySwimlaneFieldName: string,
swimlaneLimit: number,
noInfluencersConfigured: boolean
) => Promise<any>;

export declare interface FilterData {
influencersFilterQuery: InfluencersFilterQuery;
filterActive: boolean;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@ export const SwimlaneContainer: FC<SwimlaneProps> = ({
>
<>
<div>
<div style={{ height: `${containerHeight}px` }}>
<div style={{ height: `${containerHeight}px`, position: 'relative' }}>
{showSwimlane && !isLoading && (
<Chart className={'mlSwimLaneContainer'}>
<Settings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
} from '../explorer/explorer_utils';
import { OVERALL_LABEL, VIEW_BY_JOB_LABEL } from '../explorer/explorer_constants';
import { MlResultsService } from './results_service';
import { EntityField } from '../../../common/util/anomaly_utils';
import { InfluencersFilterQuery } from '../../../common/types/es_client';

/**
* Service for retrieving anomaly swim lanes data.
Expand Down Expand Up @@ -241,7 +243,9 @@ export class AnomalyTimelineService {
swimlaneLimit: number,
perPage: number,
fromPage: number,
swimlaneContainerWidth: number
swimlaneContainerWidth: number,
selectionInfluencers: EntityField[],
influencersFilterQuery: InfluencersFilterQuery
) {
const selectedJobIds = selectedJobs.map((d) => d.id);

Expand All @@ -254,7 +258,9 @@ export class AnomalyTimelineService {
latestMs,
swimlaneLimit,
perPage,
fromPage
fromPage,
selectionInfluencers,
influencersFilterQuery
);
if (resp.influencers[viewBySwimlaneFieldName] === undefined) {
return [];
Expand All @@ -276,6 +282,8 @@ export class AnomalyTimelineService {
earliestMs,
latestMs,
this.getSwimlaneBucketInterval(selectedJobs, swimlaneContainerWidth).asMilliseconds(),
perPage,
fromPage,
swimlaneLimit
);
return Object.keys(resp.results);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,18 @@ export const resultsApiProvider = (httpService: HttpService) => ({
});
},

anomalySearch(query: any, jobIds: string[]) {
anomalySearch(query: object, jobIds: string[]) {
const body = JSON.stringify({ query, jobIds });
return httpService.http<any>({
return httpService.http<object>({
path: `${basePath()}/results/anomaly_search`,
method: 'POST',
body,
});
},

anomalySearch$(query: any, jobIds: string[]) {
anomalySearch$(query: object, jobIds: string[]) {
const body = JSON.stringify({ query, jobIds });
return httpService.http$<any>({
return httpService.http$<object>({
path: `${basePath()}/results/anomaly_search`,
method: 'POST',
body,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ export function resultsServiceProvider(
intervalMs: number,
perPage?: number,
fromPage?: number,
swimLaneSeverity?: number
swimLaneSeverity?: number,
influencersFilterQuery?: InfluencersFilterQuery
): Promise<any>;
getTopInfluencers(
selectedJobIds: string[],
Expand All @@ -32,7 +33,7 @@ export function resultsServiceProvider(
maxFieldValues: number,
perPage?: number,
fromPage?: number,
influencers?: any[],
influencers?: EntityField[],
influencersFilterQuery?: InfluencersFilterQuery
): Promise<any>;
getTopInfluencerValues(): Promise<any>;
Expand Down