Skip to content

Commit

Permalink
feat(ts) TypeScript enum for statistics Events
Browse files Browse the repository at this point in the history
  • Loading branch information
garyhuntddn authored Feb 21, 2022
1 parent 5c07660 commit 993e0ba
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 70 deletions.
37 changes: 0 additions & 37 deletions service/statistics/Events.js

This file was deleted.

46 changes: 46 additions & 0 deletions service/statistics/Events.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
export enum Events {
/**
* Notifies about audio level in RTP statistics by SSRC.
*
* @param ssrc - The synchronization source identifier (SSRC) of the
* endpoint/participant whose audio level is being reported.
* @param {number} audioLevel - The audio level of <tt>ssrc</tt> according to
* RTP statistics.
* @param {boolean} isLocal - <tt>true</tt> if <tt>ssrc</tt> identifies the
* local endpoint/participant; otherwise, <tt>false</tt>.
*/
AUDIO_LEVEL = 'statistics.audioLevel',

/**
* An event fired just before the statistics module gets disposes and it's
* the last chance to submit some logs that will end up in stats services like
* CallStats (if enabled).
*/
BEFORE_DISPOSED = 'statistics.before_disposed',

/**
* An event carrying all statistics by ssrc.
*/
BYTE_SENT_STATS = 'statistics.byte_sent_stats',

/**
* An event carrying connection statistics.
*
* @param {object} connectionStats - The connection statistics carried by the
* event such as <tt>bandwidth</tt>, <tt>bitrate</tt>, <tt>packetLoss</tt>,
* <tt>resolution</tt>, and <tt>transport</tt>.
*/
CONNECTION_STATS = 'statistics.connectionstats',

/**
* An event carrying performance stats.
*/
LONG_TASKS_STATS = 'statistics.long_tasks_stats'
};

// exported for backward compatibility
export const AUDIO_LEVEL = Events.AUDIO_LEVEL;
export const BEFORE_DISPOSED = Events.BEFORE_DISPOSED;
export const BYTE_SENT_STATS = Events.BYTE_SENT_STATS;
export const CONNECTION_STATS = Events.CONNECTION_STATS;
export const LONG_TASKS_STATS = Events.LONG_TASKS_STATS;
73 changes: 40 additions & 33 deletions types/auto/service/statistics/Events.d.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,40 @@
/**
* Notifies about audio level in RTP statistics by SSRC.
*
* @param ssrc - The synchronization source identifier (SSRC) of the
* endpoint/participant whose audio level is being reported.
* @param {number} audioLevel - The audio level of <tt>ssrc</tt> according to
* RTP statistics.
* @param {boolean} isLocal - <tt>true</tt> if <tt>ssrc</tt> identifies the
* local endpoint/participant; otherwise, <tt>false</tt>.
*/
export const AUDIO_LEVEL: "statistics.audioLevel";
/**
* An event fired just before the statistics module gets disposes and it's
* the last chance to submit some logs that will end up in stats services like
* CallStats (if enabled).
*/
export const BEFORE_DISPOSED: "statistics.before_disposed";
/**
* An event carrying all statistics by ssrc.
*/
export const BYTE_SENT_STATS: "statistics.byte_sent_stats";
/**
* An event carrying connection statistics.
*
* @param {object} connectionStats - The connection statistics carried by the
* event such as <tt>bandwidth</tt>, <tt>bitrate</tt>, <tt>packetLoss</tt>,
* <tt>resolution</tt>, and <tt>transport</tt>.
*/
export const CONNECTION_STATS: "statistics.connectionstats";
/**
* An event carrying performance stats.
*/
export const LONG_TASKS_STATS: "statistics.long_tasks_stats";
export declare enum Events {
/**
* Notifies about audio level in RTP statistics by SSRC.
*
* @param ssrc - The synchronization source identifier (SSRC) of the
* endpoint/participant whose audio level is being reported.
* @param {number} audioLevel - The audio level of <tt>ssrc</tt> according to
* RTP statistics.
* @param {boolean} isLocal - <tt>true</tt> if <tt>ssrc</tt> identifies the
* local endpoint/participant; otherwise, <tt>false</tt>.
*/
AUDIO_LEVEL = "statistics.audioLevel",
/**
* An event fired just before the statistics module gets disposes and it's
* the last chance to submit some logs that will end up in stats services like
* CallStats (if enabled).
*/
BEFORE_DISPOSED = "statistics.before_disposed",
/**
* An event carrying all statistics by ssrc.
*/
BYTE_SENT_STATS = "statistics.byte_sent_stats",
/**
* An event carrying connection statistics.
*
* @param {object} connectionStats - The connection statistics carried by the
* event such as <tt>bandwidth</tt>, <tt>bitrate</tt>, <tt>packetLoss</tt>,
* <tt>resolution</tt>, and <tt>transport</tt>.
*/
CONNECTION_STATS = "statistics.connectionstats",
/**
* An event carrying performance stats.
*/
LONG_TASKS_STATS = "statistics.long_tasks_stats"
}
export declare const AUDIO_LEVEL = Events.AUDIO_LEVEL;
export declare const BEFORE_DISPOSED = Events.BEFORE_DISPOSED;
export declare const BYTE_SENT_STATS = Events.BYTE_SENT_STATS;
export declare const CONNECTION_STATS = Events.CONNECTION_STATS;
export declare const LONG_TASKS_STATS = Events.LONG_TASKS_STATS;

0 comments on commit 993e0ba

Please sign in to comment.