influxer 1.2.1 → 1.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/influxer/config.rb +16 -3
- data/lib/influxer/metrics/relation.rb +1 -1
- data/lib/influxer/rails/client.rb +4 -4
- data/lib/influxer/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cee4a4e35b41eda0936d8f7344a2a06d1dc251a0c9a7303723413f1c3a702d25
|
4
|
+
data.tar.gz: 8d027da03e9bae2a76351f1cdd0a21f7f5ccf32eb73282fac95a09fbd8771aad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34fab113906dfeb113cff12cc6bfb0654891502d8ee8382717a1cae7b90d484cdf2933d283a9497a9fd2c2b946ad77f647c0096822d5c61f41368f21fd898f68
|
7
|
+
data.tar.gz: 8c30816022d49e8aa74db8945fc9f7bcd5cf73334cf92f886d469f6cc6ca7b11bbe855a876a17bd3898b2db434c2e5b29712606b5c5685ed1bb93e0982e959f6
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## master (unreleased)
|
4
4
|
|
5
|
+
## 1.2.2 (2020-10-27)
|
6
|
+
|
7
|
+
- Fixes [#49](https://github.com/palkan/influxer/issues/49) Cache hash configuration cannot be applied.([@AlexanderShvaykin][])
|
8
|
+
- Fixes [#47](https://github.com/palkan/influxer/issues/47) Can't delete data when retention policy is set for a metric. ([@MPursche][])
|
9
|
+
|
5
10
|
## 1.2.1 (2020-07-09)
|
6
11
|
|
7
12
|
- Support for setting timezone in queries to configure influx time calculations, e.g., time epoch aggregation ([@jklimke][])
|
@@ -90,3 +95,4 @@ See [changelog](https://github.com/palkan/influxer/blob/1.0.0/Changelog.md) for
|
|
90
95
|
[@MPursche]: https://github.com/MPursche
|
91
96
|
[@jklimke]: https://github.com/jklimke
|
92
97
|
[@dimiii]: https://github.com/dimiii
|
98
|
+
[@AlexanderShvaykin]: https://github.com/AlexanderShvaykin
|
data/lib/influxer/config.rb
CHANGED
@@ -28,15 +28,28 @@ module Influxer
|
|
28
28
|
:denormalize,
|
29
29
|
:udp,
|
30
30
|
:async,
|
31
|
+
:cache_enabled,
|
32
|
+
:cache,
|
31
33
|
database: "db",
|
32
34
|
time_precision: "ns",
|
33
|
-
cache: false,
|
34
35
|
time_duration_suffix_enabled: false
|
35
36
|
|
36
37
|
def load(*)
|
37
38
|
super
|
38
|
-
|
39
|
-
|
39
|
+
if cache_enabled.nil?
|
40
|
+
self.cache_enabled = cache_enabled_value
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
44
|
+
def cache=(value)
|
45
|
+
super
|
46
|
+
self.cache_enabled = cache_enabled_value
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
|
51
|
+
def cache_enabled_value
|
52
|
+
!!cache
|
40
53
|
end
|
41
54
|
end
|
42
55
|
end
|
@@ -6,10 +6,10 @@ module Influxer
|
|
6
6
|
class Client
|
7
7
|
def query(sql, options = {})
|
8
8
|
log_sql(sql) do
|
9
|
-
if !options.fetch(:cache, true)
|
10
|
-
super(sql, options)
|
9
|
+
if !(options.fetch(:cache, true) && Influxer.config.cache_enabled)
|
10
|
+
super(sql, **options)
|
11
11
|
else
|
12
|
-
Rails.cache.fetch(normalized_cache_key(sql), cache_options(sql)) { super(sql, options) }
|
12
|
+
Rails.cache.fetch(normalized_cache_key(sql), **cache_options(sql)) { super(sql, **options) }
|
13
13
|
end
|
14
14
|
end
|
15
15
|
end
|
@@ -34,7 +34,7 @@ module Influxer
|
|
34
34
|
def cache_options(sql = nil)
|
35
35
|
options = Influxer.config.cache.dup
|
36
36
|
options[:expires_in] = (options[:cache_now_for] || 60) if /\snow\(\)/.match?(sql)
|
37
|
-
options
|
37
|
+
options.symbolize_keys
|
38
38
|
end
|
39
39
|
|
40
40
|
# add prefix; remove whitespaces
|
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.2.
|
4
|
+
version: 1.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vlad Dem
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activemodel
|