fluent-plugin-pi 0.0.6 → 0.0.7

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
  SHA1:
3
- metadata.gz: 75bbfde0f15018f51670dc8da342ab3304699ce8
4
- data.tar.gz: 4199d62180542895fa05e7d78dc5a951ca199b2f
3
+ metadata.gz: 7bf76ce7b3249ee407f42cbe8fbfa929fbdd4063
4
+ data.tar.gz: f9fe90f5e89e6204416df92145f02e2f3be8924c
5
5
  SHA512:
6
- metadata.gz: 6d7f95a06f77e3b2ad313f793fa254bcb83f23864657eb23e78d75274a3bd9460d1131c8e3e887ab00be5db318706f6bca53f97adb635f5606e36ffd91f5c790
7
- data.tar.gz: 4c409b04defa7af7970b8eeeb8a0f9eedf8d28367afd8aba2096d5d9fb552c6bd7c082fee1823e6257818ae72ef6ba1bc1a939b32b279ed1c2cbb1b79c4d5c7e
6
+ metadata.gz: fc62087f56aeeb9f5700e3612f4f0d97c1d322deab056c5c2a7494fe985ff4656a7e6e21885a506aa5482353c9ce398d2f4ad7aec5e421f7d63250070e25231c
7
+ data.tar.gz: c529ec0cf4ce09605f8c3e755e5a4e1253ae02a4d2efdc4f3ab59abf4b035b0c1657b5f4b76d28ab0a13dd8dfd391fa7bc698a480969a62b1d923b1a2e7ebf15
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-pi (0.0.6)
4
+ fluent-plugin-pi (0.0.7)
5
5
  adal (~> 1.0.0)
6
6
  certified (~> 1.0.0)
7
7
  rest-client (~> 1.6.9)
@@ -3,7 +3,7 @@
3
3
 
4
4
  Gem::Specification.new do |spec|
5
5
  spec.name = "fluent-plugin-pi"
6
- spec.version = "0.0.6"
6
+ spec.version = "0.0.7"
7
7
  spec.authors = ["Derek Endres"]
8
8
  spec.email = ["dendres@osisoft.com"]
9
9
 
@@ -90,11 +90,24 @@ module Fluent
90
90
  super
91
91
  gettoken(true)
92
92
  @secondWriteAttempt = false
93
+ @three = false
93
94
  end
94
95
 
95
96
  def write(chunk)
97
+ if(@three)
98
+ return
99
+ end
96
100
  data = chunk.read
97
- jsonObj = "[" + data.chop + "]" # removes trailing ',' and makes a valid json object
101
+
102
+ jsonObj = nil
103
+
104
+ if(@valuetag != nil)
105
+ jsonObj = "[" + data.chop + "]" # removes trailing ',' and makes a valid json object
106
+ else
107
+ time = Time.now.utc
108
+ jsonObj = "[{\"Timestamp\":\"#{time}\",\"Value\":\"#{data}\"}]"
109
+ end
110
+ $log.write(jsonObj)
98
111
 
99
112
  if(Time.at(@full_token.expires_on).utc < (Time.now.utc + 30))
100
113
  gettoken(false) #the refresh token isn't working so when we are withing 30 seconds get a new token
@@ -109,13 +122,15 @@ module Fluent
109
122
  #201 means it is created, 302 means it was created and it was just retrieved.
110
123
  secondWriteAttempt=false
111
124
  else
112
- $log.write("Failed to write the value. Regetting stream and type to see if this helps.")
113
- if(!secondWriteAttempt)
114
- secondWriteAttempt=true
125
+ $log.write(response.to_s)
126
+ $log.write("\nFailed to write the value. Regetting stream and type to see if this helps.\n")
127
+ if(!@secondWriteAttempt)
128
+ @secondWriteAttempt=true
115
129
  createTypeAndStream()
116
130
  write(chunk)
117
131
  else
118
- $log.write("Failed to write the value. Regetting stream and type did not help.")
132
+ $log.write("Failed to write the value. Regetting stream and type did not help.\n")
133
+ @three = true
119
134
  raise "Writing Values failed"
120
135
  end
121
136
  end
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-pi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Derek Endres
@@ -102,6 +102,7 @@ files:
102
102
  - pkg/fluent-plugin-pi-0.0.3.gem
103
103
  - pkg/fluent-plugin-pi-0.0.4.gem
104
104
  - pkg/fluent-plugin-pi-0.0.5.gem
105
+ - pkg/fluent-plugin-pi-0.0.6.gem
105
106
  homepage: https://github.com/osisoftresearch
106
107
  licenses:
107
108
  - OSISoft LLC