Skip to content

Commit 86d6438

Browse files
authored
Merge pull request #1 from fluent-plugins-nursery/sf/fix-time
Fix "time" to produce collect Unix time
2 parents 8c0e72e + c4f9c0f commit 86d6438

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/fluent/plugin/node_exporter/time_collector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def run
3535

3636
def time_update
3737
current_time = Fluent::EventTime.now
38-
value = current_time.to_i / 1e9
38+
value = current_time.to_i
3939
@gauge.set(value)
4040
end
4141

test/plugin/test_time_collector.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def test_time_now
99
stub(Fluent::EventTime).now { Fluent::EventTime.new(1e9) }
1010
collector.run
1111
time_seconds = collector.cmetrics[:time_seconds]
12-
assert_equal(1.0, time_seconds.val)
12+
assert_equal(1_000_000_000, time_seconds.val)
1313
end
1414
end
1515
end

0 commit comments

Comments
 (0)