influxer 1.1.4 → 1.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +98 -0
- data/{MIT-LICENSE → LICENSE.txt} +1 -1
- data/README.md +106 -47
- data/lib/influxer.rb +10 -9
- data/lib/influxer/client.rb +1 -1
- data/lib/influxer/config.rb +19 -6
- data/lib/influxer/engine.rb +1 -1
- data/lib/influxer/metrics/active_model3/model.rb +2 -4
- data/lib/influxer/metrics/metrics.rb +10 -13
- data/lib/influxer/metrics/quoting/timestamp.rb +23 -11
- data/lib/influxer/metrics/relation.rb +33 -17
- data/lib/influxer/metrics/relation/calculations.rb +1 -1
- data/lib/influxer/metrics/relation/time_query.rb +15 -13
- data/lib/influxer/metrics/relation/where_clause.rb +19 -11
- data/lib/influxer/metrics/scoping.rb +4 -4
- data/lib/influxer/metrics/scoping/current_scope.rb +2 -1
- data/lib/influxer/metrics/scoping/default.rb +1 -1
- data/lib/influxer/metrics/scoping/named.rb +2 -1
- data/lib/influxer/model.rb +4 -9
- data/lib/influxer/rails/client.rb +6 -6
- data/lib/influxer/version.rb +1 -1
- metadata +30 -95
- data/.gitignore +0 -37
- data/.rspec +0 -2
- data/.rubocop.yml +0 -77
- data/.travis.yml +0 -10
- data/Changelog.md +0 -111
- data/Gemfile +0 -10
- data/Rakefile +0 -13
- data/gemfiles/rails32.gemfile +0 -7
- data/gemfiles/rails42.gemfile +0 -7
- data/gemfiles/rails5.gemfile +0 -7
- data/influxer.gemspec +0 -33
- data/spec/cases/points_spec.rb +0 -36
- data/spec/cases/write_points_spec.rb +0 -85
- data/spec/client_spec.rb +0 -46
- data/spec/fixtures/empty_result.json +0 -21
- data/spec/fixtures/single_series.json +0 -29
- data/spec/metrics/metrics_spec.rb +0 -283
- data/spec/metrics/relation_spec.rb +0 -477
- data/spec/metrics/scoping_spec.rb +0 -66
- data/spec/model/user_spec.rb +0 -46
- data/spec/spec_helper.rb +0 -64
- data/spec/support/metrics/action_metrics.rb +0 -5
- data/spec/support/metrics/custom_metrics.rb +0 -6
- data/spec/support/metrics/dummy_metrics.rb +0 -12
- data/spec/support/metrics/user_metrics.rb +0 -6
- data/spec/support/metrics/visits_metrics.rb +0 -8
- data/spec/support/shared_contexts/shared_query.rb +0 -16
- data/spec/support/user.rb +0 -16
data/lib/influxer/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: influxer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vlad Dem
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|
@@ -42,14 +42,14 @@ dependencies:
|
|
42
42
|
name: anyway_config
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '1.0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - "
|
52
|
+
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '1.0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
@@ -66,20 +66,6 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: simplecov
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - ">="
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 0.3.8
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - ">="
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 0.3.8
|
83
69
|
- !ruby/object:Gem::Dependency
|
84
70
|
name: rake
|
85
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -95,61 +81,47 @@ dependencies:
|
|
95
81
|
- !ruby/object:Gem::Version
|
96
82
|
version: '10.1'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
99
|
-
requirement: !ruby/object:Gem::Requirement
|
100
|
-
requirements:
|
101
|
-
- - ">="
|
102
|
-
- !ruby/object:Gem::Version
|
103
|
-
version: '0'
|
104
|
-
type: :development
|
105
|
-
prerelease: false
|
106
|
-
version_requirements: !ruby/object:Gem::Requirement
|
107
|
-
requirements:
|
108
|
-
- - ">="
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
112
|
-
name: activerecord
|
84
|
+
name: rspec
|
113
85
|
requirement: !ruby/object:Gem::Requirement
|
114
86
|
requirements:
|
115
87
|
- - ">="
|
116
88
|
- !ruby/object:Gem::Version
|
117
|
-
version: 3.
|
89
|
+
version: 3.1.0
|
118
90
|
type: :development
|
119
91
|
prerelease: false
|
120
92
|
version_requirements: !ruby/object:Gem::Requirement
|
121
93
|
requirements:
|
122
94
|
- - ">="
|
123
95
|
- !ruby/object:Gem::Version
|
124
|
-
version: 3.
|
96
|
+
version: 3.1.0
|
125
97
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
98
|
+
name: standard
|
127
99
|
requirement: !ruby/object:Gem::Requirement
|
128
100
|
requirements:
|
129
|
-
- - "
|
101
|
+
- - "~>"
|
130
102
|
- !ruby/object:Gem::Version
|
131
|
-
version:
|
103
|
+
version: 0.0.39
|
132
104
|
type: :development
|
133
105
|
prerelease: false
|
134
106
|
version_requirements: !ruby/object:Gem::Requirement
|
135
107
|
requirements:
|
136
|
-
- - "
|
108
|
+
- - "~>"
|
137
109
|
- !ruby/object:Gem::Version
|
138
|
-
version:
|
110
|
+
version: 0.0.39
|
139
111
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
112
|
+
name: rubocop-md
|
141
113
|
requirement: !ruby/object:Gem::Requirement
|
142
114
|
requirements:
|
143
|
-
- - "
|
115
|
+
- - "~>"
|
144
116
|
- !ruby/object:Gem::Version
|
145
|
-
version:
|
117
|
+
version: 0.2.0
|
146
118
|
type: :development
|
147
119
|
prerelease: false
|
148
120
|
version_requirements: !ruby/object:Gem::Requirement
|
149
121
|
requirements:
|
150
|
-
- - "
|
122
|
+
- - "~>"
|
151
123
|
- !ruby/object:Gem::Version
|
152
|
-
version:
|
124
|
+
version: 0.2.0
|
153
125
|
- !ruby/object:Gem::Dependency
|
154
126
|
name: webmock
|
155
127
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,20 +136,6 @@ dependencies:
|
|
164
136
|
- - "~>"
|
165
137
|
- !ruby/object:Gem::Version
|
166
138
|
version: '2.1'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: rubocop
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - "~>"
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '0.52'
|
174
|
-
type: :development
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - "~>"
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '0.52'
|
181
139
|
description: InfluxDB the Rails way
|
182
140
|
email:
|
183
141
|
- dementiev.vm@gmail.com
|
@@ -185,19 +143,9 @@ executables: []
|
|
185
143
|
extensions: []
|
186
144
|
extra_rdoc_files: []
|
187
145
|
files:
|
188
|
-
-
|
189
|
-
-
|
190
|
-
- ".rubocop.yml"
|
191
|
-
- ".travis.yml"
|
192
|
-
- Changelog.md
|
193
|
-
- Gemfile
|
194
|
-
- MIT-LICENSE
|
146
|
+
- CHANGELOG.md
|
147
|
+
- LICENSE.txt
|
195
148
|
- README.md
|
196
|
-
- Rakefile
|
197
|
-
- gemfiles/rails32.gemfile
|
198
|
-
- gemfiles/rails42.gemfile
|
199
|
-
- gemfiles/rails5.gemfile
|
200
|
-
- influxer.gemspec
|
201
149
|
- lib/influxer.rb
|
202
150
|
- lib/influxer/client.rb
|
203
151
|
- lib/influxer/config.rb
|
@@ -217,28 +165,16 @@ files:
|
|
217
165
|
- lib/influxer/model.rb
|
218
166
|
- lib/influxer/rails/client.rb
|
219
167
|
- lib/influxer/version.rb
|
220
|
-
- spec/cases/points_spec.rb
|
221
|
-
- spec/cases/write_points_spec.rb
|
222
|
-
- spec/client_spec.rb
|
223
|
-
- spec/fixtures/empty_result.json
|
224
|
-
- spec/fixtures/single_series.json
|
225
|
-
- spec/metrics/metrics_spec.rb
|
226
|
-
- spec/metrics/relation_spec.rb
|
227
|
-
- spec/metrics/scoping_spec.rb
|
228
|
-
- spec/model/user_spec.rb
|
229
|
-
- spec/spec_helper.rb
|
230
|
-
- spec/support/metrics/action_metrics.rb
|
231
|
-
- spec/support/metrics/custom_metrics.rb
|
232
|
-
- spec/support/metrics/dummy_metrics.rb
|
233
|
-
- spec/support/metrics/user_metrics.rb
|
234
|
-
- spec/support/metrics/visits_metrics.rb
|
235
|
-
- spec/support/shared_contexts/shared_query.rb
|
236
|
-
- spec/support/user.rb
|
237
168
|
homepage: http://github.com/palkan/influxer
|
238
169
|
licenses:
|
239
170
|
- MIT
|
240
|
-
metadata:
|
241
|
-
|
171
|
+
metadata:
|
172
|
+
bug_tracker_uri: http://github.com/palkan/influxer/issues
|
173
|
+
changelog_uri: https://github.com/palkan/influxer/blob/master/Changelog.md
|
174
|
+
documentation_uri: http://github.com/palkan/influxer
|
175
|
+
homepage_uri: http://github.com/palkan/influxer
|
176
|
+
source_code_uri: http://github.com/palkan/influxer
|
177
|
+
post_install_message:
|
242
178
|
rdoc_options: []
|
243
179
|
require_paths:
|
244
180
|
- lib
|
@@ -246,16 +182,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
246
182
|
requirements:
|
247
183
|
- - ">="
|
248
184
|
- !ruby/object:Gem::Version
|
249
|
-
version:
|
185
|
+
version: 2.4.0
|
250
186
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
251
187
|
requirements:
|
252
188
|
- - ">="
|
253
189
|
- !ruby/object:Gem::Version
|
254
190
|
version: '0'
|
255
191
|
requirements: []
|
256
|
-
|
257
|
-
|
258
|
-
signing_key:
|
192
|
+
rubygems_version: 3.1.2
|
193
|
+
signing_key:
|
259
194
|
specification_version: 4
|
260
195
|
summary: InfluxDB for Rails
|
261
196
|
test_files: []
|
data/.gitignore
DELETED
@@ -1,37 +0,0 @@
|
|
1
|
-
# Numerous always-ignore extensions
|
2
|
-
*.diff
|
3
|
-
*.err
|
4
|
-
*.orig
|
5
|
-
*.log
|
6
|
-
*.rej
|
7
|
-
*.swo
|
8
|
-
*.swp
|
9
|
-
*.vi
|
10
|
-
*~
|
11
|
-
*.sass-cache
|
12
|
-
*.iml
|
13
|
-
.idea/
|
14
|
-
|
15
|
-
# Sublime
|
16
|
-
*.sublime-project
|
17
|
-
*.sublime-workspace
|
18
|
-
|
19
|
-
# OS or Editor folders
|
20
|
-
.DS_Store
|
21
|
-
.cache
|
22
|
-
.project
|
23
|
-
.settings
|
24
|
-
.tmproj
|
25
|
-
Thumbs.db
|
26
|
-
|
27
|
-
.bundle/
|
28
|
-
log/*.log
|
29
|
-
pkg/
|
30
|
-
spec/dummy/db/*.sqlite3
|
31
|
-
spec/dummy/db/*.sqlite3-journal
|
32
|
-
spec/dummy/tmp/
|
33
|
-
tmp/
|
34
|
-
|
35
|
-
Gemfile.lock
|
36
|
-
Gemfile.local
|
37
|
-
*.gem
|
data/.rspec
DELETED
data/.rubocop.yml
DELETED
@@ -1,77 +0,0 @@
|
|
1
|
-
AllCops:
|
2
|
-
# Include gemspec and Rakefile
|
3
|
-
Include:
|
4
|
-
- 'lib/**/*.rb'
|
5
|
-
- 'lib/**/*.rake'
|
6
|
-
- 'spec/**/*.rb'
|
7
|
-
Exclude:
|
8
|
-
- 'bin/**/*'
|
9
|
-
- 'spec/dummy/**/*'
|
10
|
-
- 'vendor/**/*'
|
11
|
-
- 'gemfiles/vendor/**/*'
|
12
|
-
- Gemfile
|
13
|
-
- Rakefile
|
14
|
-
DisplayCopNames: true
|
15
|
-
StyleGuideCopsOnly: false
|
16
|
-
TargetRubyVersion: 2.3
|
17
|
-
|
18
|
-
Rails:
|
19
|
-
Enabled: false
|
20
|
-
|
21
|
-
Style/SymbolArray:
|
22
|
-
Enabled: false
|
23
|
-
|
24
|
-
Style/SafeNavigation:
|
25
|
-
Enabled: false
|
26
|
-
|
27
|
-
Naming/AccessorMethodName:
|
28
|
-
Enabled: false
|
29
|
-
|
30
|
-
Style/TrivialAccessors:
|
31
|
-
Enabled: false
|
32
|
-
|
33
|
-
Style/Documentation:
|
34
|
-
Exclude:
|
35
|
-
- 'spec/**/*.rb'
|
36
|
-
|
37
|
-
Style/StringLiterals:
|
38
|
-
Enabled: false
|
39
|
-
|
40
|
-
Style/DateTime:
|
41
|
-
Exclude:
|
42
|
-
- 'spec/**/*.rb'
|
43
|
-
|
44
|
-
Naming/SpaceInsideStringInterpolation:
|
45
|
-
EnforcedStyle: no_space
|
46
|
-
|
47
|
-
Style/BlockDelimiters:
|
48
|
-
Exclude:
|
49
|
-
- 'spec/**/*.rb'
|
50
|
-
|
51
|
-
Lint/MissingCopEnableDirective:
|
52
|
-
Enabled: false
|
53
|
-
|
54
|
-
Lint/AmbiguousRegexpLiteral:
|
55
|
-
Enabled: false
|
56
|
-
|
57
|
-
Metrics/BlockLength:
|
58
|
-
Exclude:
|
59
|
-
- 'spec/**/*.rb'
|
60
|
-
|
61
|
-
Metrics/MethodLength:
|
62
|
-
Exclude:
|
63
|
-
- 'spec/**/*.rb'
|
64
|
-
|
65
|
-
Metrics/LineLength:
|
66
|
-
Max: 100
|
67
|
-
Exclude:
|
68
|
-
- 'spec/**/*.rb'
|
69
|
-
|
70
|
-
Rails/Date:
|
71
|
-
Enabled: false
|
72
|
-
|
73
|
-
Rails/TimeZone:
|
74
|
-
Enabled: false
|
75
|
-
|
76
|
-
Gemspec/OrderedDependencies:
|
77
|
-
Enabled: false
|
data/.travis.yml
DELETED
data/Changelog.md
DELETED
@@ -1,111 +0,0 @@
|
|
1
|
-
# Change log
|
2
|
-
|
3
|
-
## master
|
4
|
-
|
5
|
-
## 1.1.4
|
6
|
-
|
7
|
-
- [Fixes [#35](https://github.com/palkan/influxer/issues/35)] Support time duration suffix and handle `'s'` and `'ms'` precisions. ([@palkan][])
|
8
|
-
|
9
|
-
[PR](https://github.com/palkan/influxer/pull/36)
|
10
|
-
|
11
|
-
**BREAKING:** `Time`-like value are only typecasted for `time` key.
|
12
|
-
|
13
|
-
## 1.1.2
|
14
|
-
|
15
|
-
- Support exclusive ranges as `where` arguments. ([@MPursche][])
|
16
|
-
|
17
|
-
```ruby
|
18
|
-
# range including the end
|
19
|
-
where(a: 1..4)
|
20
|
-
#=> ... WHERE a >= 1 AND a <= 4
|
21
|
-
|
22
|
-
#range excluding the end
|
23
|
-
where(a: 1...4)
|
24
|
-
#=> ... WHERE a >= 1 AND a < 4
|
25
|
-
```
|
26
|
-
|
27
|
-
## 1.1.1
|
28
|
-
|
29
|
-
- [Fixes [#31](https://github.com/palkan/influxer/issues/31)] Fix bug with empty arrays in `where` clause
|
30
|
-
|
31
|
-
- Introduce `Relation#none` method
|
32
|
-
|
33
|
-
## 1.1.0
|
34
|
-
|
35
|
-
### Features
|
36
|
-
|
37
|
-
- Add ability to specify per-metrics retention-policy, precision and database
|
38
|
-
|
39
|
-
Now you can override default configuration for a specific metrics class:
|
40
|
-
|
41
|
-
```ruby
|
42
|
-
class CustomMetrics < Influxer::Metrics
|
43
|
-
set_database "custom_db"
|
44
|
-
set_retention_policy :yearly
|
45
|
-
set_precision "ms"
|
46
|
-
end
|
47
|
-
```
|
48
|
-
|
49
|
-
### Fixes
|
50
|
-
|
51
|
-
- [Fixes [#30](https://github.com/palkan/influxer/issues/30)] Fix writing points with custom retention policy
|
52
|
-
|
53
|
-
### Misc
|
54
|
-
|
55
|
-
- Update Rubocop configuration and add Rubocop Rake task to defaults
|
56
|
-
|
57
|
-
## 1.0.1
|
58
|
-
|
59
|
-
- Fix missing `#delegate` in ActiveRecord 3.2
|
60
|
-
|
61
|
-
## 0.5.4
|
62
|
-
- Add `set_retention_policy` method
|
63
|
-
|
64
|
-
## 0.5.3
|
65
|
-
- Fix `where.not` with ranges typo
|
66
|
-
|
67
|
-
## 0.5.2
|
68
|
-
- Fix bug with query logging
|
69
|
-
|
70
|
-
## 0.5.1
|
71
|
-
- Fix whitespace around operators
|
72
|
-
- Add `Relation#from` method to redefine series
|
73
|
-
- Handle nil values for tags in #where clause
|
74
|
-
|
75
|
-
## 0.5.0
|
76
|
-
- Update `timestamp` support
|
77
|
-
- Add `epoch` method
|
78
|
-
|
79
|
-
## 0.4.0
|
80
|
-
- Rename default `time` attribute to `timestamp`
|
81
|
-
|
82
|
-
## 0.2.3
|
83
|
-
- Parse fanout queries points to handle _fanouted_ values
|
84
|
-
- Add Rubocop config and cleanup code style
|
85
|
-
|
86
|
-
## 0.1.1
|
87
|
-
- Add [anyway_config](https://github.com/palkan/anyway_config)
|
88
|
-
- Add `empty?` method
|
89
|
-
|
90
|
-
## 0.1.0
|
91
|
-
- Add logs
|
92
|
-
- Add `foreign_key` param to `has_metrics` options
|
93
|
-
|
94
|
-
## 0.1.0-rc
|
95
|
-
- Fix `Relation#to_a` (now returns array of points correctrly)
|
96
|
-
- Fix fanout queries with array args (now use `merge(Regexp)`)
|
97
|
-
|
98
|
-
## 0.1.0-alpha
|
99
|
-
- Add `time` method to Relation to group by time with constants (`:hour`, `:day`, etc) and fill support
|
100
|
-
- Series names now properly quoted with double-quotes
|
101
|
-
- Using regexps, ranges and arrays within `where` clause
|
102
|
-
- `where.not(...)` support
|
103
|
-
- Add `past` and `since` methods
|
104
|
-
- Add `merge` method and support for regexp series
|
105
|
-
- Add `delete_all` support
|
106
|
-
- Add cache support (using `Rails.cache`)
|
107
|
-
- Scopes (default and named)
|
108
|
-
- Support for fanout series
|
109
|
-
|
110
|
-
[@palkan]: https://github.com/palkan
|
111
|
-
[@MPursche]: https://github.com/MPursche
|