Skip to content

Commit

Permalink
Revert "feat: calculate total usage for plugin"
Browse files Browse the repository at this point in the history
  • Loading branch information
raviteja83 authored Mar 15, 2024
1 parent 764c784 commit 83c45af
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 81 deletions.
18 changes: 0 additions & 18 deletions packages/hms-video-store/src/analytics/AnalyticsEventFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { AdditionalAnalyticsProperties } from './AdditionalAnalyticsProperties';
import AnalyticsEvent from './AnalyticsEvent';
import { AnalyticsEventLevel } from './AnalyticsEventLevel';
import { IAnalyticsPropertiesProvider } from './IAnalyticsPropertiesProvider';
import { pluginUsageTracker } from '../common';
import { HMSException } from '../error/HMSException';
import { DeviceMap, SelectedDevices } from '../interfaces';
import { HMSTrackSettings } from '../media/settings/HMSTrackSettings';
Expand Down Expand Up @@ -236,23 +235,6 @@ export default class AnalyticsEventFactory {
});
}

static getKrispUsage(sessionID: string) {
const duration = pluginUsageTracker.getPluginUsage('HMSKrispPlugin', sessionID);
return new AnalyticsEvent({
name: 'krisp.usage',
level: AnalyticsEventLevel.INFO,
properties: { duration },
});
}

static transportLeave() {
return new AnalyticsEvent({
name: 'transport.leave',
level: AnalyticsEventLevel.INFO,
properties: {},
});
}

private static eventNameFor(name: string, ok: boolean) {
const suffix = ok ? 'success' : 'failed';
return `${name}.${suffix}`;
Expand Down
53 changes: 0 additions & 53 deletions packages/hms-video-store/src/common/PluginUsageTracker.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/hms-video-store/src/common/index.ts

This file was deleted.

1 change: 0 additions & 1 deletion packages/hms-video-store/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ export type {
HMSQuizLeaderboardSummary,
} from './internal';

export { pluginUsageTracker } from './common';
export { HMSReactiveStore } from './reactive-store/HMSReactiveStore';
export { HMSPluginUnsupportedTypes, HMSRecordingState, HLSPlaylistType } from './internal';
export type {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ export class AudioPluginsAnalytics {
this.addedTimestamps[name] = Date.now();
this.initTime[name] = 0;
this.pluginSampleRate[name] = sampleRate;
this.eventBus.analytics.publish(MediaPluginsAnalyticsFactory.added(name, this.addedTimestamps[name]));
}

removed(name: string) {
Expand Down
5 changes: 1 addition & 4 deletions packages/hms-video-store/src/sdk/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import { HMSAnalyticsLevel } from '../analytics/AnalyticsEventLevel';
import { AnalyticsEventsService } from '../analytics/AnalyticsEventsService';
import { AnalyticsTimer, TimedEvent } from '../analytics/AnalyticsTimer';
import { AudioSinkManager } from '../audio-sink-manager';
import { pluginUsageTracker } from '../common/PluginUsageTracker';
import { DeviceManager } from '../device-manager';
import { AudioOutputManager } from '../device-manager/AudioOutputManager';
import { DeviceStorageManager } from '../device-manager/DeviceStorage';
Expand Down Expand Up @@ -182,6 +181,7 @@ export class HMSSdk implements HMSInterface {
);
this.sessionStore = new SessionStore(this.transport);
this.interactivityCenter = new InteractivityCenter(this.transport, this.store, this.listener);

/**
* Note: Subscribe to events here right after creating stores and managers
* to not miss events that are published before the handlers are subscribed.
Expand Down Expand Up @@ -498,7 +498,6 @@ export class HMSSdk implements HMSInterface {
this.errorListener?.onError(error);
};

// eslint-disable-next-line complexity
async join(config: HMSConfig, listener: HMSUpdateListener) {
validateMediaDevicesExistence();
validateRTCPeerConnection();
Expand Down Expand Up @@ -572,8 +571,6 @@ export class HMSSdk implements HMSInterface {
throw error;
}
HMSLogger.timeEnd(`join-room-${roomId}`);
const sessionID = this.store.getRoom()?.sessionId || '';
this.eventBus.analytics.subscribe(e => pluginUsageTracker.updatePluginUsageData(e, sessionID));
}

private stringifyMetadata(config: HMSConfig) {
Expand Down
3 changes: 0 additions & 3 deletions packages/hms-video-store/src/transport/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -495,9 +495,6 @@ export default class HMSTransport {
this.joinParameters = undefined;
HMSLogger.d(TAG, 'leaving in transport');
try {
const sessionID = this.store.getRoom()?.sessionId || '';
this.eventBus.analytics.publish(AnalyticsEventFactory.getKrispUsage(sessionID));
this.eventBus.analytics.publish(AnalyticsEventFactory.transportLeave());
this.state = TransportState.Leaving;
this.publishStatsAnalytics?.stop();
this.subscribeStatsAnalytics?.stop();
Expand Down

0 comments on commit 83c45af

Please sign in to comment.