measures 3.0.0 → 4.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -3
- data/lib/measures.rb +2 -2
- data/lib/measures/client.rb +4 -2
- data/lib/measures/{transport → transports}/http.rb +1 -1
- data/lib/measures/{transport → transports}/udp.rb +1 -1
- data/lib/measures/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70eaeeaaca44acefa72f3e07d7218c475c1c9f95
|
4
|
+
data.tar.gz: 4488c134898b88fe1076eb539f12a08ece7560d2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ee94661fec3b5fbe4f5a61ab2ee7e2fdb4f25d755950d01c9c17c3c988f9ea6fcbc5ddff0b4fcc865b956a7e9a1241d8e2513efd5e0b571fd55976f7414367c
|
7
|
+
data.tar.gz: aab1674c92d8406477f50e57e40d423dbb951acfeaca8b08460e9ffa8b015b4a1f909a5419bdfcd8a3fa15580377644bec56a9109ea124e8552d0a52ead73302
|
data/README.md
CHANGED
@@ -25,11 +25,11 @@ $ gem install measures
|
|
25
25
|
```ruby
|
26
26
|
require "measures"
|
27
27
|
|
28
|
-
# Creates the transport
|
29
|
-
transport = Measures::
|
28
|
+
# Creates the transport (UDP/HTTP/...)
|
29
|
+
transport = Measures::Transports::UDP.new("logstash.foo.bar", 30)
|
30
30
|
|
31
31
|
# Creates the measure client instance
|
32
|
-
measures = Measures::Client.new(transport, "my-app")
|
32
|
+
measures = Measures::Client.new(transport, "my-app", "my-team")
|
33
33
|
|
34
34
|
# Sends count metric
|
35
35
|
measures.count("my_count_metric")
|
data/lib/measures.rb
CHANGED
data/lib/measures/client.rb
CHANGED
@@ -3,9 +3,10 @@ require "benchmark"
|
|
3
3
|
|
4
4
|
module Measures
|
5
5
|
class Client
|
6
|
-
def initialize(transport, client)
|
6
|
+
def initialize(transport, client, owner)
|
7
7
|
@client = client
|
8
8
|
@transport = transport
|
9
|
+
@owner = owner
|
9
10
|
end
|
10
11
|
|
11
12
|
def count(metric, data = {})
|
@@ -28,8 +29,9 @@ module Measures
|
|
28
29
|
|
29
30
|
def send(metric, data = {})
|
30
31
|
default = {
|
32
|
+
"owner" => @owner,
|
31
33
|
"client" => @client,
|
32
|
-
"metric" => metric
|
34
|
+
"metric" => metric
|
33
35
|
}
|
34
36
|
|
35
37
|
default.merge!(data)
|
data/lib/measures/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: measures
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 4.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marcelo Boeira
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-06-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: faraday
|
@@ -142,8 +142,8 @@ files:
|
|
142
142
|
- bin/setup
|
143
143
|
- lib/measures.rb
|
144
144
|
- lib/measures/client.rb
|
145
|
-
- lib/measures/
|
146
|
-
- lib/measures/
|
145
|
+
- lib/measures/transports/http.rb
|
146
|
+
- lib/measures/transports/udp.rb
|
147
147
|
- lib/measures/version.rb
|
148
148
|
- measures.gemspec
|
149
149
|
homepage: ''
|