bipbip 0.6.18 → 0.6.19

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: d7cc0b75d36f465837c7aad1f7fa9f86abd09201
4
- data.tar.gz: dff096f90a819cd84b52c89882c2b54152cfaf97
3
+ metadata.gz: 7efe14db26fdb686587f554dd72757c42718088e
4
+ data.tar.gz: f14b4b9f4c443ec24dd618c9305c3613b9bfd41a
5
5
  SHA512:
6
- metadata.gz: 68e66b525687f045317e4a80f2a2182da484279c03783ecef5c9a6c78dff23783f90043c76504f3868575d923c214ad1070591a479e5275233f39e05c506a5b3
7
- data.tar.gz: 1f959689e5589d1dbd00449b74666f1dae5127a1a51fd27271893cf32048696ff7d8c8c795bf326b9ee789cdab2b9ec455f0a22a3c461c6a29ee83bd16e06836
6
+ metadata.gz: 4c8603306bfd005af5c29aea68d2fa15d6d181ff32f223427009567e69781849081fd8b5615105049c55767910bcc6db7405e3cf4eeacb3de39572599d8f1e75
7
+ data.tar.gz: af47fc94a2092474fae3ac26b3ab9386861a39a6f1bc5a772ecd7f8990a0176b09f20804590c5b37c883aa35e0962dc1d9391149855fa70a9315222e559acb0f
@@ -10,7 +10,11 @@ module Bipbip
10
10
  { name: 'streams_waiter_count', type: 'gauge', unit: 'Waiters' },
11
11
  { name: 'streams_bandwidth', type: 'gauge', unit: 'b/s' },
12
12
  { name: 'streams_zero_fps_count', type: 'gauge', unit: 'Streams' },
13
- { name: 'streams_zero_bitrate_count', type: 'gauge', unit: 'Streams' }
13
+ { name: 'streams_zero_bitrate_count', type: 'gauge', unit: 'Streams' },
14
+ { name: 'streams_packet_loss_audio_max', type: 'gauge', unit: '%' },
15
+ { name: 'streams_packet_loss_audio_avg', type: 'gauge', unit: '%' },
16
+ { name: 'streams_packet_loss_video_max', type: 'gauge', unit: '%' },
17
+ { name: 'streams_packet_loss_video_avg', type: 'gauge', unit: '%' }
14
18
  ]
15
19
  end
16
20
 
@@ -18,14 +22,22 @@ module Bipbip
18
22
  data = _fetch_data
19
23
  mountpoints = data['data']['list']
20
24
  streams = mountpoints.map { |mp| mp['streams'] }.flatten
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
28
+
21
29
  {
22
30
  'mountpoint_count' => mountpoints.count,
23
31
  'stream_count' => streams.count,
24
- 'streams_listener_count' => streams.map { |s| s['listeners'] }.reduce(0, :+),
25
- 'streams_waiter_count' => streams.map { |s| s['waiters'] }.reduce(0, :+),
26
- 'streams_bandwidth' => streams.map { |s| s['stats']['cur'] }.reduce(0, :+),
32
+ 'streams_listener_count' => streams.map { |s| s['webrtc-endpoint']['listeners'] }.reduce(0, :+),
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, :+),
27
35
  'streams_zero_fps_count' => streams.count { |s| s['frame']['fps'] == 0 },
28
- 'streams_zero_bitrate_count' => streams.count { |s| s['stats']['cur'] == 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,
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,
40
+ 'streams_packet_loss_video_avg' => packet_loss_video_avg * 100
29
41
  }
30
42
  end
31
43
 
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.6.18'.freeze
2
+ VERSION = '0.6.19'.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.18
4
+ version: 0.6.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2016-04-21 00:00:00.000000000 Z
13
+ date: 2016-04-26 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: copperegg-revealmetrics