persistence-providers 0.0.2.2 → 0.0.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8136cc320cf5d2ad265d4a3c966a7838f1c6a1d09d13a1e5aad7143fe510ea2a
4
- data.tar.gz: b64999cabad79d62721921049e71f8b2e45b0b4c70256aeb8d496e157ae556bb
3
+ metadata.gz: 9ef2d4539ee594c0fb786be1ee20ceb0a9a2b79743ee6f02702b2c28f49b3fd2
4
+ data.tar.gz: 43347f89e40adb8701fc82ae6f214cf34c37c058b8692e6707efad399f34bb8a
5
5
  SHA512:
6
- metadata.gz: c2fea0ace3f115d3c1168952f6664bf1f2618df80c4f7ce6b53dae51a41f81e91c3ae452f9d11afd050e9c5a219d3537d43cadb947155aa55e53a724e11fb5ad
7
- data.tar.gz: 8e0c57d6e478f9db48e1e548a0ada0a9974e4cf68799d5adf55f00e8f4aeac9c47cd6c26252d030df9bba4c36895c188e098db5881282ae9311861ee1fad230a
6
+ metadata.gz: 19d06a2a39e86b386a991f2157db68ffdc228a2ca3ecd8f25da6eed429b9a058c3e12613bbb83bc6feb899d00c17cd9b08e04157d52835198073cba45adae97f
7
+ data.tar.gz: 81390b3e8c7ba7579b39f0e0d16826f93e0e9f6d5965a984e9973c037b298adfa967ebb2b8d6b6fa043eb1927a07f3c93c99f44f218f296c50184bf1d644d4b5
@@ -17,12 +17,14 @@ module DTK::State
17
17
  end
18
18
 
19
19
  def write(namespace, crd_component_name, component_instance_name, attribute_name, value, opts = {}, timestamp = nil)
20
- begin
21
- fail "Bad timestamp input, write operation wont be completed" if timestamp > Time.new
20
+ if opts[:provider] == "correlation"
21
+ errors = client.measurement_helper(:errors)
22
+ required_tags = get_required_tags(namespace, crd_component_name, component_instance_name, attribute_name)
23
+ required_tags.merge!({ correlator_type: opts[:entrypoint].split("/").last.split(".")[0] })
24
+ errors.write(value.to_s, required_tags, timestamp)
25
+ elsif
22
26
  required_tags = get_required_tags(namespace, crd_component_name, component_instance_name, attribute_name)
23
27
  measurement.write(value, required_tags, timestamp)
24
- rescue => error
25
- puts error
26
28
  end
27
29
  end
28
30
 
@@ -83,7 +85,7 @@ module DTK::State
83
85
  crd_component_name: crd_component_name,
84
86
  component_instance_name: component_instance_name,
85
87
  attribute_name: attribute_name,
86
- task_id: 1
88
+ task_id: "1"
87
89
  }
88
90
  end
89
91
  end
@@ -4,6 +4,7 @@ module DTK::State
4
4
  require_relative('measurement/attribute_measurement')
5
5
  require_relative('measurement/events')
6
6
  require_relative('measurement/states')
7
+ require_relative('measurement/errors')
7
8
 
8
9
  def initialize(name, client)
9
10
  @name = name
@@ -0,0 +1,20 @@
1
+ module DTK::State
2
+ class Component::Attribute::Influxdb
3
+ class Measurement
4
+ class Errors < self
5
+
6
+ def write(value, params_hash = {}, timestamp)
7
+ checked_params_hash = check_params_hash(params_hash)
8
+ write_point(value, checked_params_hash, timestamp)
9
+ end
10
+
11
+ protected
12
+
13
+ def required_params
14
+ [:namespace, :crd_component_name, :component_instance_name, :task_id, :attribute_name, :task_id, :correlator_type]
15
+ end
16
+
17
+ end
18
+ end
19
+ end
20
+ end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = 'persistence-providers'
3
- spec.version = '0.0.2.2'
3
+ spec.version = '0.0.2.3'
4
4
  spec.author = 'Reactor8'
5
5
  spec.email = 'support@reactor8.com'
6
6
  spec.description = %q{Persistence providers plugin}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: persistence-providers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2.2
4
+ version: 0.0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reactor8
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-30 00:00:00.000000000 Z
11
+ date: 2020-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: kubeclient
@@ -67,6 +67,7 @@ files:
67
67
  - lib/state/component/providers/influxdb/client.rb
68
68
  - lib/state/component/providers/influxdb/measurement.rb
69
69
  - lib/state/component/providers/influxdb/measurement/attribute_measurement.rb
70
+ - lib/state/component/providers/influxdb/measurement/errors.rb
70
71
  - lib/state/component/providers/influxdb/measurement/events.rb
71
72
  - lib/state/component/providers/influxdb/measurement/states.rb
72
73
  - lib/state/component/providers/kube_crd.rb