Skip to content

Commit

Permalink
removed legacy task manager
Browse files Browse the repository at this point in the history
  • Loading branch information
gmmorris committed Apr 27, 2020
1 parent 7271fcc commit a43d410
Show file tree
Hide file tree
Showing 15 changed files with 67 additions and 299 deletions.
2 changes: 0 additions & 2 deletions x-pack/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import { indexManagement } from './legacy/plugins/index_management';
import { spaces } from './legacy/plugins/spaces';
import { canvas } from './legacy/plugins/canvas';
import { infra } from './legacy/plugins/infra';
import { taskManager } from './legacy/plugins/task_manager';
import { rollup } from './legacy/plugins/rollup';
import { siem } from './legacy/plugins/siem';
import { remoteClusters } from './legacy/plugins/remote_clusters';
Expand All @@ -41,7 +40,6 @@ module.exports = function(kibana) {
canvas(kibana),
indexManagement(kibana),
infra(kibana),
taskManager(kibana),
rollup(kibana),
siem(kibana),
remoteClusters(kibana),
Expand Down
8 changes: 1 addition & 7 deletions x-pack/legacy/plugins/apm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,7 @@ import mappings from './mappings.json';

export const apm: LegacyPluginInitializer = kibana => {
return new kibana.Plugin({
require: [
'kibana',
'elasticsearch',
'xpack_main',
'apm_oss',
'task_manager'
],
require: ['kibana', 'elasticsearch', 'xpack_main', 'apm_oss'],
id: 'apm',
configPrefix: 'xpack.apm',
publicDir: resolve(__dirname, 'public'),
Expand Down
7 changes: 0 additions & 7 deletions x-pack/legacy/plugins/task_manager/index.ts

This file was deleted.

57 changes: 0 additions & 57 deletions x-pack/legacy/plugins/task_manager/server/index.ts

This file was deleted.

58 changes: 0 additions & 58 deletions x-pack/legacy/plugins/task_manager/server/legacy.ts

This file was deleted.

14 changes: 7 additions & 7 deletions x-pack/plugins/actions/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,15 +171,15 @@ export class ActionsPlugin implements Plugin<Promise<PluginSetupContract>, Plugi

const usageCollection = plugins.usageCollection;
if (usageCollection) {
initializeActionsTelemetry(
this.telemetryLogger,
plugins.taskManager,
core,
await this.kibanaIndex
);

core.getStartServices().then(async ([, startPlugins]: [CoreStart, any, any]) => {
registerActionsUsageCollector(usageCollection, startPlugins.taskManager);

initializeActionsTelemetry(
this.telemetryLogger,
plugins.taskManager,
core,
await this.kibanaIndex
);
});
}

Expand Down
14 changes: 7 additions & 7 deletions x-pack/plugins/alerting/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,15 +148,15 @@ export class AlertingPlugin {

const usageCollection = plugins.usageCollection;
if (usageCollection) {
initializeAlertingTelemetry(
this.telemetryLogger,
core,
plugins.taskManager,
await this.kibanaIndex
);

core.getStartServices().then(async ([, startPlugins]: [CoreStart, any, any]) => {
registerAlertsUsageCollector(usageCollection, startPlugins.taskManager);

initializeAlertingTelemetry(
this.telemetryLogger,
core,
plugins.taskManager,
await this.kibanaIndex
);
});
}

Expand Down
30 changes: 15 additions & 15 deletions x-pack/plugins/apm/server/lib/apm_telemetry/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,21 @@ export async function createApmTelemetry({
taskManager: TaskManagerSetupContract;
logger: Logger;
}) {
taskManager.registerTaskDefinitions({
[APM_TELEMETRY_TASK_NAME]: {
title: 'Collect APM telemetry',
type: APM_TELEMETRY_TASK_NAME,
createTaskRunner: () => {
return {
run: async () => {
await collectAndStore();
},
cancel: async () => {}
};
}
}
});

const savedObjectsClient = await getInternalSavedObjectsClient(core);

const collectAndStore = async () => {
Expand Down Expand Up @@ -79,21 +94,6 @@ export async function createApmTelemetry({
);
};

taskManager.registerTaskDefinitions({
[APM_TELEMETRY_TASK_NAME]: {
title: 'Collect APM telemetry',
type: APM_TELEMETRY_TASK_NAME,
createTaskRunner: () => {
return {
run: async () => {
await collectAndStore();
},
cancel: async () => {}
};
}
}
});

const collector = usageCollector.makeUsageCollector({
type: 'apm',
fetch: async () => {
Expand Down
62 changes: 0 additions & 62 deletions x-pack/plugins/task_manager/server/create_task_manager.test.ts

This file was deleted.

42 changes: 0 additions & 42 deletions x-pack/plugins/task_manager/server/create_task_manager.ts

This file was deleted.

1 change: 0 additions & 1 deletion x-pack/plugins/task_manager/server/mocks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { TaskManagerSetupContract, TaskManagerStartContract } from './plugin';

const createSetupMock = () => {
const mock: jest.Mocked<TaskManagerSetupContract> = {
registerLegacyAPI: jest.fn(),
addMiddleware: jest.fn(),
registerTaskDefinitions: jest.fn(),
};
Expand Down
Loading

0 comments on commit a43d410

Please sign in to comment.