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 +4 -4
- data/CHANGELOG.md +12 -0
- data/CONTRIBUTING.md +5 -0
- data/README.md +0 -8
- data/lib/tremolo/tracker.rb +5 -1
- data/lib/tremolo/version.rb +1 -1
- data/spec/lib/tremolo/tracker_spec.rb +12 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fbdd16e238e1f60c1f736026e2fea2f0141c0a8
|
4
|
+
data.tar.gz: cd7391271043a42fef25b07588ba6c7401beecab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d3b5ddb9b60b9d76086cfafa62fd200e2e68564e47fcdb1af4937de7ce930851fba7e2b826c15f2894a7e7ced8026f5bf1ea516b4c6119bc52fa3f3f1869ef
|
7
|
+
data.tar.gz: 44b376b21eb2bd047593baf355d918e5ee9aa6fa526cc5f6a76619084bfba8afcc4d94e7595c1fac1fd413f8a4211a86b7f8bba9b59606edc47336e15594ac38
|
data/CHANGELOG.md
ADDED
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
|
data/lib/tremolo/tracker.rb
CHANGED
@@ -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
|
data/lib/tremolo/version.rb
CHANGED
@@ -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.
|
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
|