Skip to content

Commit

Permalink
[ML] change naming for shared services
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Jul 20, 2021
1 parent 4c6d17e commit 5f886cb
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions x-pack/plugins/ml/server/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ export class MlServerPlugin

initMlServerLog({ log: this.log });

const { mlServicesProviders, shared } = createSharedServices(
const { internalServicesProviders, sharedServicesProviders } = createSharedServices(
this.mlLicense,
getSpaces,
plugins.cloud,
Expand All @@ -211,16 +211,16 @@ export class MlServerPlugin
registerMlAlerts({
alerting: plugins.alerting,
logger: this.log,
mlSharedServices: shared,
mlServicesProviders,
mlSharedServices: sharedServicesProviders,
mlServicesProviders: internalServicesProviders,
});
}

if (plugins.usageCollection) {
registerCollector(plugins.usageCollection, this.kibanaIndexConfig.kibana.index);
}

return shared;
return sharedServicesProviders;
}

public start(coreStart: CoreStart): MlPluginStart {
Expand Down
12 changes: 6 additions & 6 deletions x-pack/plugins/ml/server/shared_services/shared_services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ export function createSharedServices(
getInternalSavedObjectsClient: () => SavedObjectsClientContract | null,
isMlReady: () => Promise<void>
): {
shared: SharedServices;
mlServicesProviders: MlServicesProviders;
sharedServicesProviders: SharedServices;
internalServicesProviders: MlServicesProviders;
} {
const { isFullLicense, isMinimumLicense } = licenseChecks(mlLicense);
function getGuards(
Expand Down Expand Up @@ -128,9 +128,9 @@ export function createSharedServices(

return {
/**
* Exposed shared services for other plugins
* Exposed providers for shared services used by other plugins
*/
shared: {
sharedServicesProviders: {
...getJobServiceProvider(getGuards),
...getAnomalyDetectorsProvider(getGuards),
...getModulesProvider(getGuards),
Expand All @@ -139,9 +139,9 @@ export function createSharedServices(
...getAlertingServiceProvider(getGuards),
},
/**
* Services for ML internal usage
* Services providers for ML internal usage
*/
mlServicesProviders: {
internalServicesProviders: {
...getJobsHealthServiceProvider(getGuards),
},
};
Expand Down

0 comments on commit 5f886cb

Please sign in to comment.