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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 133625e91cd77337209b397c42266c78f09b6d44
4
- data.tar.gz: a0430d353a6ed2fce2bc1b7b72f8a592871dee62
3
+ metadata.gz: 70eaeeaaca44acefa72f3e07d7218c475c1c9f95
4
+ data.tar.gz: 4488c134898b88fe1076eb539f12a08ece7560d2
5
5
  SHA512:
6
- metadata.gz: 90b977113e99646fb238fc8ed3c72eaa81580eced5228868dff1c4b489d93bd9a363d2925327626279f2b77a793131d3d85a89a83300cdf5196124629cda417c
7
- data.tar.gz: f10a11659b891ca6ecf2d5b342f3dddd8c1447efbfe0afd31aff579c7fce5ac2690fa796270125074e5cca9a7ab7cbb2283f1be76319e52b3a5f51f1ce6e4a62
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 form (UDP/HTTP/...)
29
- transport = Measures::Transport::UDP.new("logstash.foo.bar", 30)
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")
@@ -1,6 +1,6 @@
1
1
  require "measures/version"
2
2
  require "measures/client"
3
- require "measures/transport/udp"
4
- require "measures/transport/http"
3
+ require "measures/transports/udp"
4
+ require "measures/transports/http"
5
5
 
6
6
  module Measures; end
@@ -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)
@@ -3,7 +3,7 @@ require "faraday_middleware"
3
3
  require "uri"
4
4
 
5
5
  module Measures
6
- module Transport
6
+ module Transports
7
7
  class HTTP
8
8
  def initialize(host, port = 80, url = "/")
9
9
  @host = host
@@ -1,7 +1,7 @@
1
1
  require "socket"
2
2
 
3
3
  module Measures
4
- module Transport
4
+ module Transports
5
5
  class UDP
6
6
  def initialize(host, port)
7
7
  @socket = UDPSocket.new
@@ -1,3 +1,3 @@
1
1
  module Measures
2
- VERSION = "3.0.0"
2
+ VERSION = "4.0.0"
3
3
  end
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: 3.0.0
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-04-13 00:00:00.000000000 Z
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/transport/http.rb
146
- - lib/measures/transport/udp.rb
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: ''