Skip to content

Commit

Permalink
fix: removed europe region and converted jitter values from s to ms (#…
Browse files Browse the repository at this point in the history
…3417)

Co-authored-by: Kaustubh Kumar <[email protected]>
Co-authored-by: Ravi theja <[email protected]>
  • Loading branch information
3 people authored Dec 12, 2024
1 parent 7e19fbe commit ee1f70c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
5 changes: 2 additions & 3 deletions packages/roomkit-react/src/Diagnostics/ConnectivityTest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import { DiagnosticsStep, useDiagnostics } from './DiagnosticsContext';

const Regions = {
in: 'India',
eu: 'Europe',
us: 'United States',
};

Expand Down Expand Up @@ -164,7 +163,7 @@ const AudioStats = ({ stats }: { stats: DiagnosticsRTCStats | undefined }) => {
<DetailedInfo title="Bitrate Sent" value={formatBytes(stats.bitrateSent, 'b/s')} />
<DetailedInfo title="Bitrate Received" value={formatBytes(stats.bitrateReceived, 'b/s')} />
<DetailedInfo title="Round Trip Time" value={`${stats.roundTripTime} ms`} />
<DetailedInfo title="Jitter" value={`${stats.jitter} s`} />
<DetailedInfo title="Jitter" value={`${stats.jitter * 1000} ms`} />
</Flex>
)}
</ConnectivityTestStepResult>
Expand All @@ -183,7 +182,7 @@ const VideoStats = ({ stats }: { stats: DiagnosticsRTCStats | undefined }) => {
<DetailedInfo title="Bitrate Sent" value={formatBytes(stats.bitrateSent, 'b/s')} />
<DetailedInfo title="Bitrate Received" value={formatBytes(stats.bitrateReceived, 'b/s')} />
<DetailedInfo title="Round Trip Time" value={`${stats.roundTripTime} ms`} />
<DetailedInfo title="Jitter" value={`${stats.jitter} s`} />
<DetailedInfo title="Jitter" value={`${stats.jitter * 1000} ms`} />
</Flex>
)}
</ConnectivityTestStepResult>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ const LocalPeerStats = () => {
return (
<Flex css={{ flexWrap: 'wrap', gap: '$10' }}>
<StatsRow label="Packets Lost" value={stats.subscribe?.packetsLost} />
<StatsRow label="Jitter" value={stats.subscribe?.jitter} />
<StatsRow label="Jitter" value={`${((stats.subscribe?.jitter ?? 0) * 1000).toFixed(2)} ms`} />
<StatsRow label="Publish Bitrate" value={formatBytes(stats.publish?.bitrate, 'b/s')} />
<StatsRow label="Subscribe Bitrate" value={formatBytes(stats.subscribe?.bitrate, 'b/s')} />
<StatsRow
Expand Down Expand Up @@ -316,7 +316,7 @@ const TrackStats = ({ trackID, layer, local }) => {
<StatsRow label="Type" value={stats.type + ' ' + stats.kind} />
<StatsRow label="Bitrate" value={formatBytes(stats.bitrate, 'b/s')} />
<StatsRow label="Packets Lost" value={stats.packetsLost} />
<StatsRow label="Jitter" value={stats.jitter?.toFixed(3)} />
<StatsRow label="Jitter" value={`${((stats.subscribe?.jitter ?? 0) * 1000).toFixed(2)} ms`} />
<StatsRow
label={inbound ? 'Bytes Received' : 'Bytes Sent'}
value={formatBytes(inbound ? stats.bytesReceived : stats.bytesSent)}
Expand Down
13 changes: 11 additions & 2 deletions packages/roomkit-react/src/Stats/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,21 @@ const PacketLostAndJitter = ({
const isLocalPeer = audioTrackStats?.type.includes('outbound') || videoTrackStats?.type.includes('outbound');
const audioStats = isLocalPeer ? audioTrackStats?.remote : audioTrackStats;
const videoStats = isLocalPeer ? videoTrackStats?.remote : videoTrackStats;

return (
<>
<TrackPacketsLostRow label="Packet Loss(V)" stats={videoStats} />
<TrackPacketsLostRow label="Packet Loss(A)" stats={audioStats} />
<StatsRow show={isNotNullish(videoStats?.jitter)} label="Jitter(V)" value={videoStats?.jitter?.toFixed(4)} />
<StatsRow show={isNotNullish(audioStats?.jitter)} label="Jitter(A)" value={audioStats?.jitter?.toFixed(4)} />
<StatsRow
show={isNotNullish(videoStats?.jitter)}
label="Jitter(V)"
value={`${((videoStats?.jitter ?? 0) * 1000).toFixed(2)} ms`}
/>
<StatsRow
show={isNotNullish(audioStats?.jitter)}
label="Jitter(A)"
value={`${((audioStats?.jitter ?? 0) * 1000).toFixed(2)} ms`}
/>
</>
);
};
Expand Down

0 comments on commit ee1f70c

Please sign in to comment.