Skip to content

Commit

Permalink
[ML] fix agg size for influencer filters
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Jul 1, 2020
1 parent 04bf4ca commit d1919b3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import { useMlKibana, useTimefilter } from '../../contexts/kibana';
import { AnomalyTimelineService } from '../../services/anomaly_timeline_service';
import { mlResultsServiceProvider } from '../../services/results_service';
import { isViewBySwimLaneData } from '../swimlane_container';
import { ANOMALY_SWIM_LANE_HARD_LIMIT } from '../explorer_constants';

// Memoize the data fetching methods.
// wrapWithLastRefreshArg() wraps any given function and preprends a `lastRefresh` argument
Expand Down Expand Up @@ -245,7 +246,7 @@ const loadExplorerDataProvider = (anomalyTimelineService: AnomalyTimelineService
},
selectedJobs,
viewBySwimlaneFieldName,
swimlaneLimit,
ANOMALY_SWIM_LANE_HARD_LIMIT,
viewByPerPage,
viewByFromPage,
swimlaneContainerWidth,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,19 @@ export class AnomalyTimelineService {
return overallSwimlaneData;
}

/**
* Fetches view by swim lane data.
*
* @param fieldValues
* @param bounds
* @param selectedJobs
* @param viewBySwimlaneFieldName
* @param swimlaneLimit
* @param perPage
* @param fromPage
* @param swimlaneContainerWidth
* @param influencersFilterQuery
*/
public async loadViewBySwimlane(
fieldValues: string[],
bounds: { earliest: number; latest: number },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ import _ from 'lodash';
import { ML_MEDIAN_PERCENTS } from '../../../../common/util/job_utils';
import { escapeForElasticsearchQuery } from '../../util/string_utils';
import { ML_RESULTS_INDEX_PATTERN } from '../../../../common/constants/index_patterns';
import { ANOMALY_SWIM_LANE_HARD_LIMIT } from '../../explorer/explorer_constants';
import {
ANOMALY_SWIM_LANE_HARD_LIMIT,
SWIM_LANE_DEFAULT_PAGE_SIZE,
} from '../../explorer/explorer_constants';

/**
* Service for carrying out Elasticsearch queries to obtain data for the Ml Results dashboards.
Expand Down Expand Up @@ -488,7 +491,7 @@ export function resultsServiceProvider(mlApiServices) {
latestMs,
interval,
maxResults = ANOMALY_SWIM_LANE_HARD_LIMIT,
perPage = 10,
perPage = SWIM_LANE_DEFAULT_PAGE_SIZE,
fromPage = 1,
influencersFilterQuery
) {
Expand Down

0 comments on commit d1919b3

Please sign in to comment.