Skip to content

Commit 1a2a0f2

Browse files
committed
rename debug to statsSamples
1 parent 8ead388 commit 1a2a0f2

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

src/NetworkScoresCalculator.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,23 @@ import {
44
NetworkScores,
55
INetworkScoresCalculator,
66
WebRTCStatsParsed,
7-
NetworkQualityStats,
7+
NetworkQualityStatsSample,
88
} from './types';
99
import { scheduleTask } from './utils/tasks';
1010
import { CLEANUP_PREV_STATS_TTL_MS } from './utils/constants';
1111

1212
type MosCalculatorResult = {
1313
mos: NetworkScore,
14-
stats: NetworkQualityStats,
14+
stats: NetworkQualityStatsSample,
1515
};
1616

1717
class NetworkScoresCalculator implements INetworkScoresCalculator {
1818
#lastProcessedStats: { [connectionId: string]: WebRTCStatsParsed } = {};
1919

2020
calculate(data: WebRTCStatsParsed): NetworkScores {
2121
const { connection: { id: connectionId } } = data;
22-
const { mos: outbound, stats: outboundStats } = this.calculateOutboundScore(data) || {};
23-
const { mos: inbound, stats: inboundStats } = this.calculateInboundScore(data) || {};
22+
const { mos: outbound, stats: outboundStatsSample } = this.calculateOutboundScore(data) || {};
23+
const { mos: inbound, stats: inboundStatsSample } = this.calculateInboundScore(data) || {};
2424
this.#lastProcessedStats[connectionId] = data;
2525

2626
scheduleTask({
@@ -32,9 +32,9 @@ class NetworkScoresCalculator implements INetworkScoresCalculator {
3232
return {
3333
outbound,
3434
inbound,
35-
debug: {
36-
inboundStats,
37-
outboundStats,
35+
statsSamples: {
36+
inboundStatsSample,
37+
outboundStatsSample,
3838
},
3939
};
4040
}

src/types.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export type DetectIssuesPayload = {
9999

100100
export type NetworkScore = number;
101101

102-
export type NetworkQualityStats = {
102+
export type NetworkQualityStatsSample = {
103103
avgJitter: number;
104104
rtt: number;
105105
packetsLoss: number;
@@ -108,9 +108,9 @@ export type NetworkQualityStats = {
108108
export type NetworkScores = {
109109
outbound?: NetworkScore,
110110
inbound?: NetworkScore,
111-
debug: {
112-
outboundStats?: NetworkQualityStats,
113-
inboundStats?: NetworkQualityStats,
111+
statsSamples: {
112+
outboundStatsSample?: NetworkQualityStatsSample,
113+
inboundStatsSample?: NetworkQualityStatsSample,
114114
},
115115
};
116116

0 commit comments

Comments
 (0)