Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PURIFY] Removes Telemetry network call and disabled it #25

Merged
merged 2 commits into from
Feb 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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