Skip to content

Commit

Permalink
[PURIFY] Removes Telemetry network call and disabled it
Browse files Browse the repository at this point in the history
  • Loading branch information
Bishoy Boktor authored and mihirsoni committed Feb 15, 2021
1 parent e8050eb commit d7d511a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
8 changes: 4 additions & 4 deletions packages/kbn-analytics/src/reporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import { Report, ReportManager } from './report';
import { ApplicationUsage } from './metrics';

export interface ReporterConfig {
http: ReportHTTP;
// http: ReportHTTP;
storage?: Storage;
checkInterval?: number;
debug?: boolean;
Expand All @@ -38,7 +38,7 @@ export class Reporter {
checkInterval: number;
private interval?: NodeJS.Timer;
private lastAppId?: string;
private http: ReportHTTP;
// private http: ReportHTTP;
private reportManager: ReportManager;
private storageManager: ReportStorageManager;
private readonly applicationUsage: ApplicationUsage;
Expand All @@ -48,8 +48,8 @@ export class Reporter {
private started = false;

constructor(config: ReporterConfig) {
const { http, storage, debug, checkInterval = 90000, storageKey = 'analytics' } = config;
this.http = http;
const { storage, debug, checkInterval = 90000, storageKey = 'analytics' } = config;
// this.http = http;
this.checkInterval = checkInterval;
this.applicationUsage = new ApplicationUsage();
this.storageManager = new ReportStorageManager(storageKey, storage);
Expand Down
8 changes: 5 additions & 3 deletions src/plugins/telemetry/public/services/telemetry_sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ export class TelemetrySender {
// mark that we are working so future requests are ignored until we're done
this.isSending = true;
try {
const telemetryUrl = this.telemetryService.getTelemetryUrl();
const telemetryData: any | any[] = await this.telemetryService.fetchTelemetry();
const clusters: string[] = [].concat(telemetryData);
// const telemetryUrl = this.telemetryService.getTelemetryUrl();
// const telemetryData: any | any[] = await this.telemetryService.fetchTelemetry();
// const clusters: string[] = [].concat(telemetryData);
/*
await Promise.all(
clusters.map(
async (cluster) =>
Expand All @@ -85,6 +86,7 @@ export class TelemetrySender {
})
)
);
*/
this.lastReported = `${Date.now()}`;
this.saveToBrowser();
} catch (err) {
Expand Down
3 changes: 3 additions & 0 deletions src/plugins/telemetry/public/services/telemetry_service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ export class TelemetryService {
};

public fetchTelemetry = async ({ unencrypted = false } = {}) => {
/*
const now = moment();
return this.http.post('/api/telemetry/v2/clusters/_stats', {
body: JSON.stringify({
Expand All @@ -132,6 +133,8 @@ export class TelemetryService {
},
}),
});
*/
return;
};

public setOptIn = async (optedIn: boolean): Promise<boolean> => {
Expand Down

0 comments on commit d7d511a

Please sign in to comment.