tremolo 0.0.1 → 0.0.2

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: 1ed9bd38e30071e46726f282c80b9d3acc50906a
4
- data.tar.gz: 51789cd86d95c20a916750d32f8556f69f93575a
3
+ metadata.gz: 1fbdd16e238e1f60c1f736026e2fea2f0141c0a8
4
+ data.tar.gz: cd7391271043a42fef25b07588ba6c7401beecab
5
5
  SHA512:
6
- metadata.gz: fe6e20680daf956c21d850a40d7d9a58b8fb98e7a3610f869fb4715a5e860211079ac22d6dea97ced56f134e8d14786ce9a67d2497b82a6529a16d667fd21267
7
- data.tar.gz: 8a4e40f440d6a899922f94675b9821ff704aec992dbecb77ce0ecfac1663f53410e16bdfcfff31cd557399ade9ae2d02952e80ce86401581cbe54e1e3a346c9d
6
+ metadata.gz: f8d3b5ddb9b60b9d76086cfafa62fd200e2e68564e47fcdb1af4937de7ce930851fba7e2b826c15f2894a7e7ced8026f5bf1ea516b4c6119bc52fa3f3f1869ef
7
+ data.tar.gz: 44b376b21eb2bd047593baf355d918e5ee9aa6fa526cc5f6a76619084bfba8afcc4d94e7595c1fac1fd413f8a4211a86b7f8bba9b59606edc47336e15594ac38
data/CHANGELOG.md ADDED
@@ -0,0 +1,12 @@
1
+ ## Tremolo 0.0.2 ##
2
+
3
+ * Track stats with an optional :namespace
4
+
5
+ *Tony Pitale*
6
+
7
+ ## Tremolo 0.0.1 ##
8
+
9
+ * Initial implementation
10
+ * Track stats with: increment, decrement, write_point(s), timing, and time
11
+
12
+ *Tony Pitale*
data/CONTRIBUTING.md ADDED
@@ -0,0 +1,5 @@
1
+ 1. Fork it ( https://github.com/[my-github-username]/tremolo/fork )
2
+ 2. Create your feature branch (`git checkout -b my-new-feature`)
3
+ 3. Commit your changes (`git commit -am 'Add some feature'`)
4
+ 4. Push to the branch (`git push origin my-new-feature`)
5
+ 5. Create a new Pull Request
data/README.md CHANGED
@@ -80,11 +80,3 @@ Some thought should be given to the design and structure of the namespace and se
80
80
  **Note** The default precision is `ms` it appears. So far there is no way to configure `time_precision` when using UDP. More info here: http://influxdb.com/docs/v0.7/api/reading_and_writing_data.html#time-precision-on-written-data
81
81
 
82
82
  **Note** Be careful passing data to `write_point` that includes the keys `time` or `sequence_number`, they have special meaning to InfluxDB: http://influxdb.com/docs/v0.7/api/reading_and_writing_data.html#specifying-time-and-sequence-number-on-writes
83
-
84
- ## Contributing
85
-
86
- 1. Fork it ( https://github.com/[my-github-username]/tremolo/fork )
87
- 2. Create your feature branch (`git checkout -b my-new-feature`)
88
- 3. Commit your changes (`git commit -am 'Add some feature'`)
89
- 4. Push to the branch (`git push origin my-new-feature`)
90
- 5. Create a new Pull Request
@@ -1,7 +1,11 @@
1
1
  module Tremolo
2
2
  class Tracker
3
+ attr_reader :namespace
4
+
3
5
  def initialize(host, port, options={})
4
6
  @sender = Sender.new(host, port)
7
+
8
+ @namespace = options[:namespace]
5
9
  end
6
10
 
7
11
  def series(series_name)
@@ -33,7 +37,7 @@ module Tremolo
33
37
  end
34
38
 
35
39
  def write_points(series_name, data)
36
- @sender.write_points(series_name, data)
40
+ @sender.write_points([namespace, series_name].compact.join('.'), data)
37
41
  end
38
42
  end
39
43
  end
@@ -1,3 +1,3 @@
1
1
  module Tremolo
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
@@ -58,4 +58,16 @@ describe Tremolo::Tracker do
58
58
  expect(returned).to eq('returning a thing')
59
59
  expect(socket).to have_received(:send).with(json, 0)
60
60
  end
61
+
62
+ context "with a namespace" do
63
+ let(:tracker) {Tremolo.tracker('0.0.0.0', 4444, namespace: 'alf')}
64
+
65
+ it 'tracks timing value for ms' do
66
+ tracker.timing('timing.accounts.created', 14)
67
+
68
+ json = '[{"name":"alf.timing.accounts.created","columns":["value"],"points":[[14]]}]'
69
+
70
+ expect(socket).to have_received(:send).with(json, 0)
71
+ end
72
+ end
61
73
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tremolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Pitale
@@ -118,6 +118,8 @@ files:
118
118
  - ".gitignore"
119
119
  - ".rspec"
120
120
  - ".ruby-version"
121
+ - CHANGELOG.md
122
+ - CONTRIBUTING.md
121
123
  - Gemfile
122
124
  - LICENSE.txt
123
125
  - README.md