meter 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/meter/backend.rb +4 -3
- data/lib/meter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 688dc1d6ce53a1ec04070fa4ad47ae7a98bae4a5
|
4
|
+
data.tar.gz: e14023b80be493860f28bd39dbdf06b871db639c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32ba671175cdd0fc8986e237ec9183c2c1692274166bb7443c80d27e64f39037d0f4a0eca2c50eadd146a3e47d7361f8e87f3a10047050cc6f449646beb96edc
|
7
|
+
data.tar.gz: 8d06e1fd962172fe08c908f3239d27b1e2a74c653fc07e2f3662894116044145c0b55f5eb4bc64c5f1b1f95aec7842d0a1990bd7866f7142fe58703324ff81f4
|
data/lib/meter/backend.rb
CHANGED
@@ -8,7 +8,7 @@ module Meter
|
|
8
8
|
|
9
9
|
def initialize(host = '127.0.0.1', port = 8125)
|
10
10
|
@host, @port = host, port
|
11
|
-
|
11
|
+
|
12
12
|
@socket = UDPSocket.new
|
13
13
|
end
|
14
14
|
|
@@ -43,8 +43,9 @@ module Meter
|
|
43
43
|
return unless sample_rate == 1 or rand < sample_rate
|
44
44
|
stat = stat.to_s.gsub('::', '.').tr(':|@', '_')
|
45
45
|
rate = "|@#{sample_rate}" unless sample_rate == 1
|
46
|
-
|
47
|
-
|
46
|
+
app_tag = ["app:#{::Meter.config.namespace}"]
|
47
|
+
tags = "|##{(Array(options[:tags]) + app_tag).join(",")}"
|
48
|
+
send_to_socket "#{stat}:#{delta}|#{type}#{rate}#{tags}"
|
48
49
|
end
|
49
50
|
|
50
51
|
def send_to_socket(message)
|
data/lib/meter/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: meter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- bukowskis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-02-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|