# 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: @rrd = RRDtool.new(self.path) 35: args = [] 36: 37: values.each { |value| 38: # the 7200 is the heartbeat -- this means that any data that isn't 39: # more frequently than every two hours gets thrown away 40: args.push "DS:%s:GAUGE:7200:U:U" % [value[0]] 41: } 42: args.push "RRA:AVERAGE:0.5:1:300" 43: 44: begin 45: @rrd.create( Puppet[:rrdinterval].to_i, start, args) 46: rescue => detail 47: raise "Could not create RRD file %s: %s" % [path,detail] 48: end 49: end