fluent-plugin-cadvisor 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/fluent-plugin-cadvisor.gemspec +1 -1
- data/lib/fluent/plugin/in_cadvisor.rb +13 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f95eea068db5b25ff24eb37c74dfa039e6cc0db
|
4
|
+
data.tar.gz: 1aa56d3786f3bb54279ba48a217206c36fb3cdd0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 409c4ac8cb54280a251a3eb70932ab980b266c1927916d8f54c17fda4d8bb9de3e0f3c9bfdb92b00aefc0127689b1b48086129d88a2120135e81928c8ab624e3
|
7
|
+
data.tar.gz: ee88cae019e4406221493d133364d4a630553b20196dd6a9405d98365b35661e7858d9091d0517c2ab2e557c536c61bc732858bb151e3d94e3e359bd02f0556e
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = "fluent-plugin-cadvisor"
|
7
|
-
spec.version = "0.2.
|
7
|
+
spec.version = "0.2.2"
|
8
8
|
spec.authors = ["Woorank"]
|
9
9
|
spec.email = ["dev@woorank.com"]
|
10
10
|
spec.summary = "cadvisor input plugin for Fluent event collector"
|
@@ -109,25 +109,25 @@ class CadvisorInput < Fluent::Input
|
|
109
109
|
|
110
110
|
latest_timestamp = @dict[id] ||= 0
|
111
111
|
|
112
|
-
#
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
# Break if it's the last item
|
117
|
-
# We need 2 items to create the percentage, in this case the prev will be
|
118
|
-
# out of the array
|
119
|
-
break if index == (rev_stats.count - 1)
|
112
|
+
# Remove already sent elements
|
113
|
+
res['stats'].reject! do | stats |
|
114
|
+
Time.parse(stats['timestamp']).to_i <= latest_timestamp
|
115
|
+
end
|
120
116
|
|
117
|
+
res['stats'].each_with_index do | stats, index |
|
121
118
|
timestamp = Time.parse(stats['timestamp']).to_i
|
122
|
-
#
|
123
|
-
|
124
|
-
|
125
|
-
|
119
|
+
# Break on last element
|
120
|
+
# We need 2 elements to create the percentage, in this case the prev will be
|
121
|
+
# out of the array
|
122
|
+
if index == (res['stats'].count - 1)
|
123
|
+
@dict[id] = timestamp
|
124
|
+
break
|
125
|
+
end
|
126
126
|
|
127
127
|
num_cores = stats['cpu']['usage']['per_cpu_usage'].count
|
128
128
|
|
129
129
|
# CPU percentage variables
|
130
|
-
prev =
|
130
|
+
prev = res['stats'][index + 1];
|
131
131
|
raw_usage = stats['cpu']['usage']['total'] - prev['cpu']['usage']['total']
|
132
132
|
interval_in_ns = get_interval(stats['timestamp'], prev['timestamp'])
|
133
133
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-cadvisor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Woorank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-11-
|
11
|
+
date: 2014-11-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest_client
|