# File lib/puppet/transaction.rb, line 417
417:     def initialize(resources)
418:         if resources.is_a?(Puppet::Resource::Catalog)
419:             @catalog = resources
420:         elsif resources.is_a?(Puppet::SimpleGraph)
421:             raise "Transactions should get catalogs now, not SimpleGraph"
422:         else
423:             raise "Transactions require catalogs"
424:         end
425: 
426:         @resourcemetrics = {
427:             :total => @catalog.vertices.length,
428:             :out_of_sync => 0,    # The number of resources that had changes
429:             :applied => 0,        # The number of resources fixed
430:             :skipped => 0,      # The number of resources skipped
431:             :restarted => 0,    # The number of resources triggered
432:             :failed_restarts => 0, # The number of resources that fail a trigger
433:             :scheduled => 0     # The number of resources scheduled
434:         }
435: 
436:         # Metrics for distributing times across the different types.
437:         @timemetrics = Hash.new(0)
438: 
439:         # The number of resources that were triggered in this run
440:         @triggered = Hash.new { |hash, key|
441:             hash[key] = Hash.new(0)
442:         }
443: 
444:         # Targets of being triggered.
445:         @targets = Hash.new do |hash, key|
446:             hash[key] = []
447:         end
448: 
449:         # The changes we're performing
450:         @changes = []
451: 
452:         # The resources that have failed and the number of failures each.  This
453:         # is used for skipping resources because of failed dependencies.
454:         @failures = Hash.new do |h, key|
455:             h[key] = 0
456:         end
457: 
458:         @report = Report.new
459:         @count = 0
460:     end