Skip to content

Commit

Permalink
calcAutoIntervalLessThan -> search.aggs.calcAutoIntervalLessThan
Browse files Browse the repository at this point in the history
  • Loading branch information
alexwizp committed Nov 24, 2020
1 parent ac08751 commit 6bd8321
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 34 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@

| Function | Description |
| --- | --- |
| [calcAutoIntervalLessThan(maxBucketCount, duration)](./kibana-plugin-plugins-data-server.calcautointervallessthan.md) | Pick a "pretty" interval that produces no more than the maxBucketCount for the given time range. |
| [getCapabilitiesForRollupIndices(indices)](./kibana-plugin-plugins-data-server.getcapabilitiesforrollupindices.md) | |
| [getDefaultSearchParams(uiSettingsClient)](./kibana-plugin-plugins-data-server.getdefaultsearchparams.md) | |
| [getShardTimeout(config)](./kibana-plugin-plugins-data-server.getshardtimeout.md) | |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ search: {
siblingPipelineType: string;
termsAggFilter: string[];
toAbsoluteDates: typeof toAbsoluteDates;
calcAutoIntervalLessThan: typeof calcAutoIntervalLessThan;
};
getRequestInspectorStats: typeof getRequestInspectorStats;
getResponseInspectorStats: typeof getResponseInspectorStats;
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/data/server/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ import {
includeTotalLoaded,
toKibanaSearchResponse,
getTotalLoaded,
calcAutoIntervalLessThan,
} from '../common';

export {
Expand Down Expand Up @@ -223,7 +224,6 @@ export {
TabbedAggColumn,
TabbedAggRow,
TabbedTable,
calcAutoIntervalLessThan,
} from '../common';

export {
Expand Down Expand Up @@ -273,6 +273,7 @@ export const search = {
siblingPipelineType,
termsAggFilter,
toAbsoluteDates,
calcAutoIntervalLessThan,
},
getRequestInspectorStats,
getResponseInspectorStats,
Expand Down
7 changes: 2 additions & 5 deletions src/plugins/data/server/server.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,6 @@ export enum BUCKET_TYPES {
TERMS = "terms"
}

// Warning: (ae-missing-release-tag) "calcAutoIntervalLessThan" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
export function calcAutoIntervalLessThan(maxBucketCount: number, duration: number): moment.Duration;

// Warning: (ae-missing-release-tag) "castEsToKbnFieldTypeName" is exported by the package, but it is missing a release tag (@alpha, @beta, @public, or @internal)
//
// @public
Expand Down Expand Up @@ -1079,6 +1074,7 @@ export const search: {
siblingPipelineType: string;
termsAggFilter: string[];
toAbsoluteDates: typeof toAbsoluteDates;
calcAutoIntervalLessThan: typeof calcAutoIntervalLessThan;
};
getRequestInspectorStats: typeof getRequestInspectorStats;
getResponseInspectorStats: typeof getResponseInspectorStats;
Expand Down Expand Up @@ -1255,6 +1251,7 @@ export function usageProvider(core: CoreSetup_2): SearchUsage;
// src/plugins/data/server/index.ts:281:1 - (ae-forgotten-export) The symbol "isValidInterval" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/index.ts:285:1 - (ae-forgotten-export) The symbol "propFilter" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/index.ts:288:1 - (ae-forgotten-export) The symbol "toAbsoluteDates" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/index.ts:289:1 - (ae-forgotten-export) The symbol "calcAutoIntervalLessThan" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/index_patterns/index_patterns_service.ts:58:14 - (ae-forgotten-export) The symbol "IndexPatternsService" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/plugin.ts:88:66 - (ae-forgotten-export) The symbol "DataEnhancements" needs to be exported by the entry point index.d.ts
// src/plugins/data/server/search/types.ts:104:5 - (ae-forgotten-export) The symbol "ISearchStartSearchSource" needs to be exported by the entry point index.d.ts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import {
} from './unit_to_seconds';
import { getTimerange } from './get_timerange';
import { INTERVAL_STRING_RE, GTE_INTERVAL_RE } from '../../../../common/interval_regexp';
import { calcAutoIntervalLessThan } from '../../../../../data/server';
import { search } from '../../../../../data/server';

const calculateBucketData = (timeInterval, capabilities) => {
let intervalString = capabilities
Expand Down Expand Up @@ -69,7 +69,7 @@ const calculateBucketSizeForAutoInterval = (req, maxBars) => {
const { from, to } = getTimerange(req);
const timerange = to.valueOf() - from.valueOf();

return calcAutoIntervalLessThan(maxBars, timerange).asSeconds();
return search.aggs.calcAutoIntervalLessThan(maxBars, timerange).asSeconds();
};

export const getBucketSize = (req, interval, capabilities, maxBars) => {
Expand Down

0 comments on commit 6bd8321

Please sign in to comment.