    # File lib/chef/resource_reporter.rb, line 51
          def for_json
            as_hash = {}
            as_hash["type"]   = new_resource.class.dsl_name
            as_hash["name"]   = new_resource.name
            as_hash["id"]     = new_resource.identity
            as_hash["after"]  = new_resource.state
            as_hash["before"] = current_resource ? current_resource.state : {}
            as_hash["duration"] = (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?

            # TODO: rename as "action"
            as_hash["result"] = action.to_s
            if success?
            else
              #as_hash["result"] = "failed"
            end
            as_hash["cookbook_name"] = new_resource.cookbook_name
            as_hash["cookbook_version"] = new_resource.cookbook_version.version
            as_hash

          end