Skip to content

Commit

Permalink
[ML] Remove scatterplot streaming demo.
Browse files Browse the repository at this point in the history
  • Loading branch information
walterra committed May 26, 2021
1 parent 2bc547f commit d0028dd
Show file tree
Hide file tree
Showing 7 changed files with 3 additions and 187 deletions.
10 changes: 1 addition & 9 deletions x-pack/plugins/apm/public/components/app/correlations/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ import { i18n } from '@kbn/i18n';
import { useHistory } from 'react-router-dom';
import { LatencyCorrelations } from './latency_correlations';
import { MlCorrelations } from './ml_correlations';
import { MlScatter } from './ml_scatter';
import { ErrorCorrelations } from './error_correlations';
import { useUrlParams } from '../../../context/url_params_context/use_url_params';
import { createHref } from '../../shared/Links/url_helpers';
Expand Down Expand Up @@ -60,14 +59,7 @@ const demo1Tab = {
}),
component: MlCorrelations,
};
const demo2Tab = {
key: 'demo2',
label: i18n.translate('xpack.apm.correlations.tabs.demo2Label', {
defaultMessage: 'Demo 2',
}),
component: MlScatter,
};
const tabs = [latencyTab, errorRateTab, demo1Tab, demo2Tab];
const tabs = [latencyTab, errorRateTab, demo1Tab];

export function Correlations() {
const license = useLicenseContext();
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
*/

export { Correlations } from './correlations';
export { Scatter } from './scatter';

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ export const useCorrelations = (params: CorrelationsOptions) => {
return {
error,
histograms: rawResponse?.values ?? [],
scatter: rawResponse?.scatter ?? [],
isComplete,
isRunning,
progress: loaded / total,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ export const asyncSearchServiceProvider = (
};

let values: SearchServiceValue[] = [];
let scatter: Array<{ correlation: number; docCount: number }> = [];

const cancel = () => {
isCancelled = true;
Expand Down Expand Up @@ -172,8 +171,6 @@ export const asyncSearchServiceProvider = (
return p + c.doc_count;
}, 0);

scatter.push({ correlation, docCount });

yield {
...item,
correlation,
Expand All @@ -199,16 +196,13 @@ export const asyncSearchServiceProvider = (
fetchCorrelations();

return () => {
const scatterDelta = [...scatter];
scatter = [];
return {
error,
isRunning,
loaded: Math.floor(progress.getOverallProgress() * 100),
started: progress.started,
total: 100,
values,
scatter: scatterDelta,
cancel,
};
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,7 @@ export const mlCorrelationsSearchStrategyProvider = (): ISearchStrategy<
asyncSearchServiceMap.get(id) ??
asyncSearchServiceProvider(deps.esClient.asCurrentUser, request.params);

const {
error,
isRunning,
loaded,
started,
total,
values,
scatter,
} = getAsyncSearchServiceState();
const { error, isRunning, loaded, started, total, values } = getAsyncSearchServiceState();

if (error instanceof Error) {
asyncSearchServiceMap.delete(id);
Expand All @@ -68,7 +60,7 @@ export const mlCorrelationsSearchStrategyProvider = (): ISearchStrategy<
total,
isRunning,
isPartial: isRunning,
rawResponse: { took, values, scatter },
rawResponse: { took, values },
});
},
cancel: async (id, options, deps) => {
Expand Down

0 comments on commit d0028dd

Please sign in to comment.