bipbip 0.6.9 → 0.6.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/bipbip/plugin/coturn.rb +35 -0
- data/lib/bipbip/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba1333bd9339a8fb4155875b45e5ffb0a3ed9496
|
4
|
+
data.tar.gz: e7cd5f54342e4d34df93544f20067212d3d78bb2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92161e4fbfe0490ffe6caeecab46d77733b4a791fcd094d7963f5c19a47fcad77d6c7a9212f1ebcd09e05141ad4ce6a6423ee84ecb13dc0428c9cee8c3b01738
|
7
|
+
data.tar.gz: 59cb2a4abc959bb09484506a6fdb22b6bb11c2dce52783e68f6cfeb15b38e6dfa1c41906709ab715045f77a42ecbb74b4ac5f40d842716380392727d95aaad46
|
data/README.md
CHANGED
@@ -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
|
data/lib/bipbip/version.rb
CHANGED
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.
|
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:
|
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
|