Skip to content

Instantly share code, notes, and snippets.

@ohadlevy
Created September 19, 2009 15:47
Show Gist options
  • Save ohadlevy/189507 to your computer and use it in GitHub Desktop.
Save ohadlevy/189507 to your computer and use it in GitHub Desktop.
#! /usr/bin/env ruby
#
require 'puppet'
if ARGV[0].nil?
warn "usage: #{$0} provide a puppet report"
exit 1
end
report = YAML::load(File.read(ARGV[0]))
raise "Invalid report" unless report.is_a?(Puppet::Transaction::Report)
puts "total changes are #{report.metrics["changes"][:total]}"
puts "total runtime is #{report.metrics["time"][:total]}"
puts "This report was generated at #{report.time}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment