# File lib/puppet/util/metric.rb, line 29
29:   def create(start = nil)
30:     Puppet.settings.use(:main, :metrics)
31: 
32:     start ||= Time.now.to_i - 5
33: 
34:     args = []
35: 
36:     if Puppet.features.rrd_legacy? && ! Puppet.features.rrd?
37:       @rrd = RRDtool.new(self.path)
38:     end
39: 
40:     values.each { |value|
41:       # the 7200 is the heartbeat -- this means that any data that isn't
42:       # more frequently than every two hours gets thrown away
43:       args.push "DS:#{value[0]}:GAUGE:7200:U:U"
44:     }
45:     args.push "RRA:AVERAGE:0.5:1:300"
46: 
47:     begin
48:       if Puppet.features.rrd_legacy? && ! Puppet.features.rrd?
49:         @rrd.create( Puppet[:rrdinterval].to_i, start, args)
50:       else
51:         RRD.create( self.path, '-s', Puppet[:rrdinterval].to_i.to_s, '-b', start.to_i.to_s, *args)
52:       end
53:     rescue => detail
54:       raise "Could not create RRD file #{path}: #{detail}"
55:     end
56:   end