bipbip 0.2.0 → 0.2.1

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: 23a9fee96f16b13c84f67946b0e3c64c6b8624f4
4
- data.tar.gz: 1c4a817735f2e4f35cafdb1c421a141990516c09
3
+ metadata.gz: 0dddc26953a67802ee6093893f0e97dd68e74d51
4
+ data.tar.gz: e89421a5c593613ac75969a5f600aa4d419ad77c
5
5
  SHA512:
6
- metadata.gz: bc37152e3c4c278b049c71b1a9d89acca947afddf14ea8c45b31e901bf71b723effe16ef0901ee62992bd3e6478fb807f0c4a4dcc22869ffa32b3576d1687bf2
7
- data.tar.gz: 78621bb55b7465384c27dadaa0a31a5c8d347bbee9eaa1af7caf42c07a104975756ef74daec69ab04d98850f485d30887eea15600ca630900f86b20579d08b79
6
+ metadata.gz: f9916e81ad68c2592a09f0ed051bdb622005409a9ec8f5b86bcce916625388df7a3a85e1ccbdfb8a80fbb25637ca07db18954ae9cf74afe2f979cd23db5e1a80
7
+ data.tar.gz: 54f0019b468297488d327487acf90276c4d5acace60b3c0524f1a76a5443ca31f5c8961d00dd8f5258f0576d5c8c98db0e0c2d3da0442e04a80586d91f3779a3
@@ -9,8 +9,11 @@ module Bipbip
9
9
  end
10
10
 
11
11
  def monitor
12
- connections = `netstat -tn | wc -l`
13
- {:connections_total => connections.to_i}
12
+ tcp_summary = `ss -s | grep '^TCP:'`
13
+ tcp_counters = /^TCP:\s+(\d+) \(estab (\d+), closed (\d+), orphaned (\d+), synrecv (\d+), timewait (\d+)\/(\d+)\), ports (\d+)$/.match(tcp_summary)
14
+ raise "Cannot match ss-output `#{tcp_summary}`" unless tcp_counters
15
+
16
+ {:connections_total => tcp_counters[1].to_i}
14
17
  end
15
18
  end
16
19
  end
@@ -1,3 +1,3 @@
1
1
  module Bipbip
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
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.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cargo Media