From f6c8e98cbc06b6e14d97600761cb9b30896a5bcc Mon Sep 17 00:00:00 2001 From: Eric Amodio Date: Mon, 28 Nov 2022 17:56:30 +0100 Subject: [PATCH] Consolidates activate & config events --- src/extension.ts | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 0ff9304..50700a9 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1,5 +1,6 @@ import type { ExtensionContext } from 'vscode'; import { version as codeVersion, env, extensions, window, workspace } from 'vscode'; +import { hrtime } from '@env/hrtime'; import { isWeb } from '@env/platform'; import { Api } from './api/api'; import type { CreatePullRequestActionContext, GitLensApi, OpenPullRequestActionContext } from './api/gitlens'; @@ -188,35 +189,36 @@ export async function activate(context: ExtensionContext): Promise { + sw.stop({ + message: ` activated${exitMessage != null ? `, ${exitMessage}` : ''}${ + mode != null ? `, mode: ${mode.name}` : '' + }`, + }); + + setTimeout(() => { + // TODO@eamodio do we want to capture any vscode settings that are relevant to GitLens? + const config = flatten(configuration.getAll(true), { prefix: 'config', stringify: 'all' }); container.telemetry.sendEvent( 'activate', { 'activation.elapsed': elapsed, 'activation.mode': mode?.name, + ...config, }, - sw.startTime, + startTime, + endTime, ); - setTimeout(() => { - const data = flatten(configuration.getAll(true), { prefix: 'config', stringify: 'all' }); - // TODO@eamodio do we want to capture any vscode settings that are relevant to GitLens? - container.telemetry.sendEvent('config', data); - }, 5000); - }); + setTimeout(() => uninstallDeprecatedAuthentication(), 25000); + }, 5000); - sw.stop({ - message: ` activated${exitMessage != null ? `, ${exitMessage}` : ''}${ - mode != null ? `, mode: ${mode.name}` : '' - }`, - }); - - setTimeout(() => uninstallDeprecatedAuthentication(), 30000); - - const api = new Api(container); return Promise.resolve(api); }