Skip to content

Commit

Permalink
[Main][Task]28966399: Separate critical events and non-critical event…
Browse files Browse the repository at this point in the history
…s for Offline Support (#2401)

* add in memery split for offline support

* update

* update

* update

* update

* update

* update
  • Loading branch information
Karlie-777 authored Sep 14, 2024
1 parent cd9b894 commit 3a1fdb1
Show file tree
Hide file tree
Showing 6 changed files with 713 additions and 231 deletions.
4 changes: 2 additions & 2 deletions AISKU/Tests/Unit/src/applicationinsights.e2e.tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { AITestClass, Assert, PollingAssert, EventValidator, TraceValidator, Exc
import { SinonSpy } from 'sinon';
import { ApplicationInsights } from '../../../src/applicationinsights-web'
import { Sender } from '@microsoft/applicationinsights-channel-js';
import { IDependencyTelemetry, ContextTagKeys, Event, Trace, Exception, Metric, PageView, PageViewPerformance, RemoteDependencyData, DistributedTracingModes, RequestHeaders, IAutoExceptionTelemetry, BreezeChannelIdentifier, IConfig } from '@microsoft/applicationinsights-common';
import { IDependencyTelemetry, ContextTagKeys, Event, Trace, Exception, Metric, PageView, PageViewPerformance, RemoteDependencyData, DistributedTracingModes, RequestHeaders, IAutoExceptionTelemetry, BreezeChannelIdentifier, IConfig, EventPersistence } from '@microsoft/applicationinsights-common';
import { ITelemetryItem, getGlobal, newId, dumpObj, BaseTelemetryPlugin, IProcessTelemetryContext, __getRegisteredEvents, arrForEach, IConfiguration, ActiveStatus, FeatureOptInMode } from "@microsoft/applicationinsights-core-js";
import { TelemetryContext } from '@microsoft/applicationinsights-properties-js';
import { createAsyncResolvedPromise } from '@nevware21/ts-async';
Expand Down Expand Up @@ -677,7 +677,7 @@ export class ApplicationInsightsTests extends AITestClass {
this._ai.trackEvent({ name: "offline event", properties: { "prop2": "value2" }, measurements: { "measurement2": 200 } });
inMemoTimer = offlineChannel["_getDbgPlgTargets"]()[3];
Assert.ok(inMemoTimer, "in memo timer should not be null");
let inMemoBatch = offlineChannel["_getDbgPlgTargets"]()[1];
let inMemoBatch = offlineChannel["_getDbgPlgTargets"]()[1][EventPersistence.Normal];
Assert.equal(inMemoBatch && inMemoBatch.count(), 1, "should have one event");

return true
Expand Down
Loading

0 comments on commit 3a1fdb1

Please sign in to comment.