bipbip 0.6.9 → 0.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f7f6055107baef535ccd9d5a079752b3c1836c52
4
- data.tar.gz: de7005db500c6c76faef89422769476f92559f09
3
+ metadata.gz: ba1333bd9339a8fb4155875b45e5ffb0a3ed9496
4
+ data.tar.gz: e7cd5f54342e4d34df93544f20067212d3d78bb2
5
5
  SHA512:
6
- metadata.gz: d4a6b7544e996f4bd00c429d275da2e00cf56f3ecdf1908dacc04652ca288c71a1fee8b0983acd5f1b2b0c4df7fb7900e83e56a424278db52676e097e917fcfb
7
- data.tar.gz: 1107adf3baeffd8be0a7035bc26748652f776c044f3fcd3a61d2f99ea6b5bf58bc81c5e42b3669bfe88f2806b479826c96f30e90a87a2129c1a5cb865491f69f
6
+ metadata.gz: 92161e4fbfe0490ffe6caeecab46d77733b4a791fcd094d7963f5c19a47fcad77d6c7a9212f1ebcd09e05141ad4ce6a6423ee84ecb13dc0428c9cee8c3b01738
7
+ data.tar.gz: 59cb2a4abc959bb09484506a6fdb22b6bb11c2dce52783e68f6cfeb15b38e6dfa1c41906709ab715045f77a42ecbb74b4ac5f40d842716380392727d95aaad46
data/README.md CHANGED
@@ -108,6 +108,7 @@ These service plugins ship with bipbip:
108
108
  - puppet
109
109
  - command
110
110
  - socket-redis
111
+ - coturn
111
112
 
112
113
  Please refer to [/docu/services.md](/docu/services.md) for information about the individual plugins and their configuration options.
113
114
 
@@ -0,0 +1,35 @@
1
+ require 'net/telnet'
2
+
3
+ module Bipbip
4
+ class Plugin::Coturn < Plugin
5
+ def metrics_schema
6
+ [
7
+ { name: 'total_sessions_count', type: 'gauge', unit: 'Sessions' },
8
+ { name: 'total_bitrate_outgoing', type: 'gauge', unit: 'b/s' },
9
+ { name: 'total_bitrate_incoming', type: 'gauge', unit: 'b/s' }
10
+ ]
11
+ end
12
+
13
+ def monitor
14
+ data = _fetch_session_data
15
+ {
16
+ 'total_sessions_count' => data.match(/Total sessions: (.*)/)[1].to_i,
17
+ 'total_bitrate_outgoing' => data.scan(/ s=(\d+),/).flatten.map(&:to_i).reduce(:+) * 8,
18
+ 'total_bitrate_incoming' => data.scan(/ r=(\d+),/).flatten.map(&:to_i).reduce(:+) * 8
19
+ }
20
+ end
21
+
22
+ private
23
+
24
+ def _fetch_session_data
25
+ coturn = Net::Telnet.new(
26
+ 'Host' => config['hostname'] || 'localhost',
27
+ 'Port' => config['port'] || 5766
28
+ )
29
+ response = coturn.cmd('ps')
30
+ coturn.close
31
+
32
+ response
33
+ end
34
+ end
35
+ end
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.6.9'
2
+ VERSION = '0.6.10'
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.9
4
+ version: 0.6.10
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: 2015-12-31 00:00:00.000000000 Z
13
+ date: 2016-01-06 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: copperegg-revealmetrics
@@ -241,6 +241,7 @@ files:
241
241
  - lib/bipbip/plugin.rb
242
242
  - lib/bipbip/plugin/apache2.rb
243
243
  - lib/bipbip/plugin/command.rb
244
+ - lib/bipbip/plugin/coturn.rb
244
245
  - lib/bipbip/plugin/elasticsearch.rb
245
246
  - lib/bipbip/plugin/fastcgi_php_apc.rb
246
247
  - lib/bipbip/plugin/fastcgi_php_fpm.rb