diff options
| author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-30 20:43:29 +0000 |
|---|---|---|
| committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-06-30 20:43:29 +0000 |
| commit | 70143d217fcf3cd2bfbcfd0e5c9c38292716de2b (patch) | |
| tree | 65bdecdf674c7c9d88065125d34d55592c9d5337 /lib/puppet/client | |
| parent | 795ec70fc1ae678178e4a7cf16ea8fa76a122ea6 (diff) | |
| download | puppet-70143d217fcf3cd2bfbcfd0e5c9c38292716de2b.tar.gz puppet-70143d217fcf3cd2bfbcfd0e5c9c38292716de2b.tar.xz puppet-70143d217fcf3cd2bfbcfd0e5c9c38292716de2b.zip | |
Trying to merge metrics and reports. There is now a separate transaction report class, and it works throughout the previously existing system. I will next go through trying to make a metric report that graphs the metrics in rrd.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1347 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/client')
| -rw-r--r-- | lib/puppet/client/master.rb | 17 | ||||
| -rw-r--r-- | lib/puppet/client/reporter.rb | 14 |
2 files changed, 11 insertions, 20 deletions
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb index 6d57a310a..2544d3aef 100644 --- a/lib/puppet/client/master.rb +++ b/lib/puppet/client/master.rb @@ -76,12 +76,7 @@ class Puppet::Client::MasterClient < Puppet::Client raise Puppet::Error, "Cannot apply; objects not defined" end - # this is a gross hack... but i don't see a good way around it - # set all of the variables to empty - Puppet::Transaction.init - transaction = @objects.evaluate - transaction.toplevel = true if tags transaction.tags = tags @@ -104,16 +99,14 @@ class Puppet::Client::MasterClient < Puppet::Client ensure Puppet::Storage.store end - Puppet::Metric.gather - Puppet::Metric.tally - if Puppet[:rrdgraph] == true - Metric.store - Metric.graph - end if Puppet[:report] + report = transaction.report() + if Puppet[:rrdgraph] == true + report.graph() + end begin - reportclient().report(transaction) + reportclient().report(report) rescue => detail Puppet.err "Reporting failed: %s" % detail end diff --git a/lib/puppet/client/reporter.rb b/lib/puppet/client/reporter.rb index ff80f367d..b0101e2fa 100644 --- a/lib/puppet/client/reporter.rb +++ b/lib/puppet/client/reporter.rb @@ -13,24 +13,22 @@ class Puppet::Client::Reporter < Puppet::Client::ProxyClient super(hash) end - # Send our report. We get the transaction, and we convert it to a report + # Send our report. We get the transaction report and convert it to YAML # as appropriate. - def report(transaction) - # We receive an array of log events, and we need to convert them into - # a single big YAML file. - - array = transaction.report - - report = YAML.dump(array) + def report(transreport) + report = YAML.dump(transreport) unless self.local report = CGI.escape(report) end # Now send the report + file = nil benchmark(:info, "Sent transaction report") do file = @driver.report(report) end + + file end end |
