Skip to content

Commit 3999afb

Browse files
committed
[ML] Rename MlTimeBuckets to TimeBuckets
1 parent 6616bc7 commit 3999afb

34 files changed

+101
-101
lines changed

x-pack/legacy/plugins/ml/public/datavisualizer/index_based/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { useKibanaContext, SavedSearchQuery } from '../../contexts/kibana';
3535
import { kbnTypeToMLJobType } from '../../util/field_types_utils';
3636
// @ts-ignore
3737
import { timeBasedIndexCheck } from '../../util/index_utils';
38-
import { MlTimeBuckets } from '../../util/ml_time_buckets';
38+
import { TimeBuckets } from '../../util/time_buckets';
3939
import { FieldRequestConfig, FieldVisConfig } from './common';
4040
import { ActionsPanel } from './components/actions_panel';
4141
import { FieldsPanel } from './components/fields_panel';
@@ -269,7 +269,7 @@ export const Page: FC = () => {
269269

270270
// Obtain the interval to use for date histogram aggregations
271271
// (such as the document count chart). Aim for 75 bars.
272-
const buckets = new MlTimeBuckets();
272+
const buckets = new TimeBuckets();
273273

274274
const tf = timefilter as any;
275275
let earliest: number | undefined;

x-pack/legacy/plugins/ml/public/explorer/explorer.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import {
3636
import { ExplorerSwimlane } from './explorer_swimlane';
3737
import { KqlFilterBar } from '../components/kql_filter_bar';
3838
import { formatHumanReadableDateTime } from '../util/date_utils';
39-
import { getBoundsRoundedToInterval } from 'plugins/ml/util/ml_time_buckets';
39+
import { getBoundsRoundedToInterval } from '../util/time_buckets';
4040
import { getSelectedJobIds } from '../components/job_selector/job_select_service_utils';
4141
import { InfluencersList } from '../components/influencers_list';
4242
import { ALLOW_CELL_RANGE_SELECTION, dragSelect$, explorer$ } from './explorer_dashboard_service';
@@ -159,7 +159,7 @@ export const Explorer = injectI18n(injectObservablesAsProps(
159159
dateFormatTz: PropTypes.string.isRequired,
160160
globalState: PropTypes.object.isRequired,
161161
jobSelectService: PropTypes.object.isRequired,
162-
MlTimeBuckets: PropTypes.func.isRequired,
162+
TimeBuckets: PropTypes.func.isRequired,
163163
};
164164

165165
state = getExplorerDefaultState();
@@ -365,13 +365,13 @@ export const Explorer = injectI18n(injectObservablesAsProps(
365365
}
366366

367367
getSwimlaneBucketInterval(selectedJobs) {
368-
const { MlTimeBuckets } = this.props;
368+
const { TimeBuckets } = this.props;
369369

370370
const swimlaneWidth = getSwimlaneContainerWidth(this.state.noInfluencersConfigured);
371371
// Bucketing interval should be the maximum of the chart related interval (i.e. time range related)
372372
// and the max bucket span for the jobs shown in the chart.
373373
const bounds = timefilter.getActiveBounds();
374-
const buckets = new MlTimeBuckets();
374+
const buckets = new TimeBuckets();
375375
buckets.setInterval('auto');
376376
buckets.setBounds(bounds);
377377

@@ -1074,7 +1074,7 @@ export const Explorer = injectI18n(injectObservablesAsProps(
10741074
globalState,
10751075
intl,
10761076
jobSelectService,
1077-
MlTimeBuckets,
1077+
TimeBuckets,
10781078
} = this.props;
10791079

10801080
const {
@@ -1206,7 +1206,7 @@ export const Explorer = injectI18n(injectObservablesAsProps(
12061206
chartWidth={swimlaneWidth}
12071207
filterActive={filterActive}
12081208
maskAll={maskAll}
1209-
MlTimeBuckets={MlTimeBuckets}
1209+
TimeBuckets={TimeBuckets}
12101210
swimlaneCellClick={this.swimlaneCellClick}
12111211
swimlaneData={overallSwimlaneData}
12121212
swimlaneType={SWIMLANE_TYPE.OVERALL}
@@ -1282,7 +1282,7 @@ export const Explorer = injectI18n(injectObservablesAsProps(
12821282
chartWidth={swimlaneWidth}
12831283
filterActive={filterActive}
12841284
maskAll={maskAll}
1285-
MlTimeBuckets={MlTimeBuckets}
1285+
TimeBuckets={TimeBuckets}
12861286
swimlaneCellClick={this.swimlaneCellClick}
12871287
swimlaneData={viewBySwimlaneData}
12881288
swimlaneType={SWIMLANE_TYPE.VIEW_BY}

x-pack/legacy/plugins/ml/public/explorer/explorer_charts/explorer_chart_distribution.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ import {
2929
removeLabelOverlap
3030
} from '../../util/chart_utils';
3131
import { LoadingIndicator } from '../../components/loading_indicator/loading_indicator';
32-
import { MlTimeBuckets } from '../../util/ml_time_buckets';
32+
import { TimeBuckets } from '../../util/time_buckets';
3333
import { mlEscape } from '../../util/string_utils';
3434
import { mlFieldFormatService } from '../../services/field_format_service';
3535
import { mlChartTooltipService } from '../../components/chart_tooltip/chart_tooltip_service';
@@ -248,7 +248,7 @@ export const ExplorerChartDistribution = injectI18n(class ExplorerChartDistribut
248248

249249
function drawRareChartAxes() {
250250
// Get the scaled date format to use for x axis tick labels.
251-
const timeBuckets = new MlTimeBuckets();
251+
const timeBuckets = new TimeBuckets();
252252
const bounds = { min: moment(config.plotEarliest), max: moment(config.plotLatest) };
253253
timeBuckets.setBounds(bounds);
254254
timeBuckets.setInterval('auto');

x-pack/legacy/plugins/ml/public/explorer/explorer_charts/explorer_chart_distribution.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import './explorer_chart_distribution.test.mocks';
88
import { chartData as mockChartData } from './__mocks__/mock_chart_data_rare';
99
import seriesConfig from './__mocks__/mock_series_config_rare.json';
1010

11-
// Mock MlTimeBuckets and mlFieldFormatService, they don't play well
11+
// Mock TimeBuckets and mlFieldFormatService, they don't play well
1212
// with the jest based test setup yet.
13-
jest.mock('../../util/ml_time_buckets', () => ({
14-
MlTimeBuckets: function () {
13+
jest.mock('../../util/time_buckets', () => ({
14+
TimeBuckets: function () {
1515
this.setBounds = jest.fn();
1616
this.setInterval = jest.fn();
1717
this.getScaledDateFormat = jest.fn();

x-pack/legacy/plugins/ml/public/explorer/explorer_charts/explorer_chart_single_metric.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import {
3737
showMultiBucketAnomalyTooltip,
3838
} from '../../util/chart_utils';
3939
import { LoadingIndicator } from '../../components/loading_indicator/loading_indicator';
40-
import { MlTimeBuckets } from '../../util/ml_time_buckets';
40+
import { TimeBuckets } from '../../util/time_buckets';
4141
import { mlEscape } from '../../util/string_utils';
4242
import { mlFieldFormatService } from '../../services/field_format_service';
4343
import { mlChartTooltipService } from '../../components/chart_tooltip/chart_tooltip_service';
@@ -187,7 +187,7 @@ export const ExplorerChartSingleMetric = injectI18n(class ExplorerChartSingleMet
187187

188188
function drawLineChartAxes() {
189189
// Get the scaled date format to use for x axis tick labels.
190-
const timeBuckets = new MlTimeBuckets();
190+
const timeBuckets = new TimeBuckets();
191191
const bounds = { min: moment(config.plotEarliest), max: moment(config.plotLatest) };
192192
timeBuckets.setBounds(bounds);
193193
timeBuckets.setInterval('auto');

x-pack/legacy/plugins/ml/public/explorer/explorer_charts/explorer_chart_single_metric.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import './explorer_chart_single_metric.test.mocks';
88
import { chartData as mockChartData } from './__mocks__/mock_chart_data';
99
import seriesConfig from './__mocks__/mock_series_config_filebeat.json';
1010

11-
// Mock MlTimeBuckets and mlFieldFormatService, they don't play well
11+
// Mock TimeBuckets and mlFieldFormatService, they don't play well
1212
// with the jest based test setup yet.
13-
jest.mock('../../util/ml_time_buckets', () => ({
14-
MlTimeBuckets: function () {
13+
jest.mock('../../util/time_buckets', () => ({
14+
TimeBuckets: function () {
1515
this.setBounds = jest.fn();
1616
this.setInterval = jest.fn();
1717
this.getScaledDateFormat = jest.fn();

x-pack/legacy/plugins/ml/public/explorer/explorer_charts/explorer_charts_container.test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ import { chartData } from './__mocks__/mock_chart_data';
99
import seriesConfig from './__mocks__/mock_series_config_filebeat.json';
1010
import seriesConfigRare from './__mocks__/mock_series_config_rare.json';
1111

12-
// Mock MlTimeBuckets and mlFieldFormatService, they don't play well
12+
// Mock TimeBuckets and mlFieldFormatService, they don't play well
1313
// with the jest based test setup yet.
14-
jest.mock('../../util/ml_time_buckets', () => ({
15-
MlTimeBuckets: function () {
14+
jest.mock('../../util/time_buckets', () => ({
15+
TimeBuckets: function () {
1616
this.setBounds = jest.fn();
1717
this.setInterval = jest.fn();
1818
this.getScaledDateFormat = jest.fn();

x-pack/legacy/plugins/ml/public/explorer/explorer_controller.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { getAnomalyExplorerBreadcrumbs } from './breadcrumbs';
2424
import { checkFullLicense } from '../license/check_license';
2525
import { checkGetJobsPrivilege } from '../privilege/check_privilege';
2626
import { getIndexPatterns, loadIndexPatterns } from '../util/index_utils';
27-
import { MlTimeBuckets } from 'plugins/ml/util/ml_time_buckets';
27+
import { TimeBuckets } from 'plugins/ml/util/time_buckets';
2828
import { explorer$ } from './explorer_dashboard_service';
2929
import { mlTimefilterRefresh$ } from '../services/timefilter_refresh_service';
3030
import { mlFieldFormatService } from 'plugins/ml/services/field_format_service';
@@ -74,7 +74,7 @@ module.controller('MlExplorerController', function (
7474
timefilter.enableTimeRangeSelector();
7575
timefilter.enableAutoRefreshSelector();
7676

77-
$scope.MlTimeBuckets = MlTimeBuckets;
77+
$scope.TimeBuckets = TimeBuckets;
7878

7979
let resizeTimeout = null;
8080

x-pack/legacy/plugins/ml/public/explorer/explorer_react_wrapper_directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.directive('mlExplorerReactWrapper', function (config, globalState) {
3939
dateFormatTz,
4040
globalState,
4141
jobSelectService,
42-
MlTimeBuckets: scope.MlTimeBuckets,
42+
TimeBuckets: scope.TimeBuckets,
4343
}}
4444
/>
4545
</I18nContext>,

x-pack/legacy/plugins/ml/public/explorer/explorer_swimlane.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
3939
chartWidth: PropTypes.number.isRequired,
4040
filterActive: PropTypes.bool,
4141
maskAll: PropTypes.bool,
42-
MlTimeBuckets: PropTypes.func.isRequired,
42+
TimeBuckets: PropTypes.func.isRequired,
4343
swimlaneCellClick: PropTypes.func.isRequired,
4444
swimlaneData: PropTypes.shape({
4545
laneLabels: PropTypes.array.isRequired
@@ -248,7 +248,7 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
248248
chartWidth,
249249
filterActive,
250250
maskAll,
251-
MlTimeBuckets,
251+
TimeBuckets,
252252
swimlaneCellClick,
253253
swimlaneData,
254254
swimlaneType,
@@ -285,7 +285,7 @@ export const ExplorerSwimlane = injectI18n(class ExplorerSwimlane extends React.
285285
.range([0, xAxisWidth]);
286286

287287
// Get the scaled date format to use for x axis tick labels.
288-
const timeBuckets = new MlTimeBuckets();
288+
const timeBuckets = new TimeBuckets();
289289
timeBuckets.setInterval(`${stepSecs}s`);
290290
const xAxisTickFormat = timeBuckets.getScaledDateFormat();
291291

0 commit comments

Comments
 (0)