MCPcopy Create free account
hub / github.com/Marus/cortex-debug / endSession

Function endSession

src/reporting.ts:104–115  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

102}
103
104function endSession(id: string) {
105 if (!telemetryEnabled()) { return; }
106
107 const startTime = sessionStarts[id];
108 if (startTime) {
109 const endTime = new Date();
110 const time = (endTime.getTime() - startTime.getTime()) / 1000;
111 delete sessionStarts[id];
112
113 setTimeout(() => { analytics.event('Session', 'Completed', '', Math.round(time), { sessionControl: 'end' }).send(); }, 500);
114 }
115}
116
117export default {
118 beginSession: beginSession,

Callers

nothing calls this directly

Calls 1

telemetryEnabledFunction · 0.85

Tested by

no test coverage detected