3
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
4
*--------------------------------------------------------------------------------------------*/
5
5
6
- import type { AppInsightsCore , IExtendedConfiguration } from "@microsoft/1ds-core-js" ;
6
+ import type { AppInsightsCore , IExtendedConfiguration , IPerfManager } from "@microsoft/1ds-core-js" ;
7
7
import type { IChannelConfiguration , IXHROverride , PostChannel } from "@microsoft/1ds-post-js" ;
8
8
import type * as vscode from "vscode" ;
9
9
import type { BaseTelemetryClient } from "./baseTelemetrySender" ;
@@ -20,6 +20,19 @@ const getAICore = async (key: string, vscodeAPI: typeof vscode, xhrOverride?: IX
20
20
const postPlugin = await import ( /* webpackMode: "eager" */ "@microsoft/1ds-post-js" ) ;
21
21
const appInsightsCore = new oneDs . AppInsightsCore ( ) ;
22
22
const collectorChannelPlugin : PostChannel = new postPlugin . PostChannel ( ) ;
23
+
24
+ // Dummy perf manager to fix memory leaks
25
+ const perfManager : IPerfManager = {
26
+ create : function ( _src , _payload , _isAsync ) {
27
+ return null ;
28
+ } ,
29
+ fire : function ( _perfEvent ) {
30
+ } ,
31
+ setCtx : function ( _key , _value ) {
32
+ } ,
33
+ getCtx : function ( _key ) {
34
+ }
35
+ } ;
23
36
// Configure the app insights core to send to collector++ and disable logging of debug info
24
37
const coreConfig : IExtendedConfiguration = {
25
38
instrumentationKey : key ,
@@ -28,6 +41,9 @@ const getAICore = async (key: string, vscodeAPI: typeof vscode, xhrOverride?: IX
28
41
loggingLevelConsole : 0 ,
29
42
disableCookiesUsage : true ,
30
43
disableDbgExt : true ,
44
+ createPerfMgr : ( ) => {
45
+ return perfManager ;
46
+ } ,
31
47
disableInstrumentationKeyValidation : true ,
32
48
channels : [ [
33
49
collectorChannelPlugin
0 commit comments