summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorglasschef <glass@getchef.com>2019-07-19 09:49:12 -0500
committerGitHub <noreply@github.com>2019-07-19 09:49:12 -0500
commit4666bd4670515c72cd9a191338d53242a816e9ca (patch)
tree070364372bb42d7617cdd9fbeb63c4c9636b6bb2
parent37f0c23e93a346428919da44b85d22e11c3d8fb1 (diff)
downloadchef-reporting-compatibility.tar.gz
Stringify duration field for a reported resourcereporting-compatibility
Legacy Reporting products will only accept a stringified integer for the duration field.
-rw-r--r--lib/chef/resource_reporter.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/resource_reporter.rb b/lib/chef/resource_reporter.rb
index e63459388d..bbb4fa2e83 100644
--- a/lib/chef/resource_reporter.rb
+++ b/lib/chef/resource_reporter.rb
@@ -35,7 +35,7 @@ class Chef
as_hash["id"] = new_resource.identity.to_s
as_hash["after"] = new_resource.state_for_resource_reporter
as_hash["before"] = current_resource ? current_resource.state_for_resource_reporter : {}
- as_hash["duration"] = ( action_record.elapsed_time * 1000 ).to_i
+ as_hash["duration"] = ( action_record.elapsed_time * 1000 ).to_i.to_s
as_hash["delta"] = new_resource.diff if new_resource.respond_to?("diff")
as_hash["delta"] = "" if as_hash["delta"].nil?