bipbip 0.6.19 → 0.6.20

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7efe14db26fdb686587f554dd72757c42718088e
4
- data.tar.gz: f14b4b9f4c443ec24dd618c9305c3613b9bfd41a
3
+ metadata.gz: 5172b62b72e5a295a8e1c207e542a1c85bc895be
4
+ data.tar.gz: d84c068a561ca1fbc40ac41e3ef8ceb392f1dd24
5
5
  SHA512:
6
- metadata.gz: 4c8603306bfd005af5c29aea68d2fa15d6d181ff32f223427009567e69781849081fd8b5615105049c55767910bcc6db7405e3cf4eeacb3de39572599d8f1e75
7
- data.tar.gz: af47fc94a2092474fae3ac26b3ab9386861a39a6f1bc5a772ecd7f8990a0176b09f20804590c5b37c883aa35e0962dc1d9391149855fa70a9315222e559acb0f
6
+ metadata.gz: c25d82cac3eb33051656668e088b941ac35b56216318e3dcdb769a3c80be37a5a498afe022e1da35bb89e357afec2151ae237ace16213720e7e09a8b99385755
7
+ data.tar.gz: 39907caf4fd5323536ca36393fcc70e2e31631a22afd5531c07185ca6646a480fdd5421b254d133acdb92e63d2301809aadd1e942dec19fb2e3dfdac021c1b9a
@@ -23,20 +23,20 @@ module Bipbip
23
23
  mountpoints = data['data']['list']
24
24
  streams = mountpoints.map { |mp| mp['streams'] }.flatten
25
25
 
26
- packet_loss_audio_avg = streams.count != 0 ? streams.map { |s| s['stats']['audio']['packet-loss'] }.reduce(0, :+) / streams.count : 0
27
- packet_loss_video_avg = streams.count != 0 ? streams.map { |s| s['stats']['video']['packet-loss'] }.reduce(0, :+) / streams.count : 0
26
+ packet_loss_audio_avg = streams.count != 0 ? streams.map { |s| s['stats']['audio']['packet-loss'] || 0 }.reduce(0, :+) / streams.count : 0
27
+ packet_loss_video_avg = streams.count != 0 ? streams.map { |s| s['stats']['video']['packet-loss'] || 0 }.reduce(0, :+) / streams.count : 0
28
28
 
29
29
  {
30
30
  'mountpoint_count' => mountpoints.count,
31
31
  'stream_count' => streams.count,
32
32
  'streams_listener_count' => streams.map { |s| s['webrtc-endpoint']['listeners'] }.reduce(0, :+),
33
33
  'streams_waiter_count' => streams.map { |s| s['webrtc-endpoint']['waiters'] }.reduce(0, :+),
34
- 'streams_bandwidth' => streams.map { |s| s['stats']['video']['bitrate'] + s['stats']['audio']['bitrate'] }.reduce(0, :+),
34
+ 'streams_bandwidth' => streams.map { |s| (s['stats']['video']['bitrate'] || 0) + (s['stats']['audio']['bitrate'] || 0) }.reduce(0, :+),
35
35
  'streams_zero_fps_count' => streams.count { |s| s['frame']['fps'] == 0 },
36
- 'streams_zero_bitrate_count' => streams.count { |s| s['stats']['video']['bitrate'] == 0 || s['stats']['audio']['bitrate'] == 0 },
37
- 'streams_packet_loss_audio_max' => streams.map { |s| s['stats']['audio']['packet-loss'] * 100 }.max,
36
+ 'streams_zero_bitrate_count' => streams.count { |s| s['stats']['video']['bitrate'].nil? || s['stats']['video']['bitrate'] == 0 },
37
+ 'streams_packet_loss_audio_max' => streams.map { |s| (s['stats']['audio']['packet-loss'] || 0) * 100 }.max,
38
38
  'streams_packet_loss_audio_avg' => packet_loss_audio_avg * 100,
39
- 'streams_packet_loss_video_max' => streams.map { |s| s['stats']['video']['packet-loss'] * 100 }.max,
39
+ 'streams_packet_loss_video_max' => streams.map { |s| (s['stats']['video']['packet-loss'] || 0) * 100 }.max,
40
40
  'streams_packet_loss_video_avg' => packet_loss_video_avg * 100
41
41
  }
42
42
  end
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.6.19'.freeze
2
+ VERSION = '0.6.20'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bipbip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.19
4
+ version: 0.6.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media