summaryrefslogtreecommitdiffstats
path: root/lib/puppet/client
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-10 22:13:10 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-04-10 22:13:10 +0000
commit201aa023dd279d2d968a97732db11a1933665562 (patch)
treed96aea85ef130b698025771ba3bedcae56f800b4 /lib/puppet/client
parent0507486ad35189c557903d0c78bd1bbd7d43b967 (diff)
Adding simple benchmarking, and using it in a few of the more obvious places. Also, fixed a bug in Scope#gennode.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1098 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/client')
-rw-r--r--lib/puppet/client/master.rb35
1 files changed, 18 insertions, 17 deletions
diff --git a/lib/puppet/client/master.rb b/lib/puppet/client/master.rb
index 390c07220..6c30a4431 100644
--- a/lib/puppet/client/master.rb
+++ b/lib/puppet/client/master.rb
@@ -26,9 +26,6 @@ class Puppet::Client::MasterClient < Puppet::Client
# objects. For now, just descend into the tree and perform and
# necessary manipulations.
def apply
- unless @local
- Puppet.notice "Beginning configuration run"
- end
dostorage()
unless defined? @objects
raise Puppet::Error, "Cannot apply; objects not defined"
@@ -67,9 +64,6 @@ class Puppet::Client::MasterClient < Puppet::Client
Metric.store
Metric.graph
end
- unless @local
- Puppet.notice "Finished configuration run"
- end
return transaction
end
@@ -181,16 +175,18 @@ class Puppet::Client::MasterClient < Puppet::Client
textfacts = CGI.escape(YAML.dump(facts))
- # error handling for this is done in the network client
- begin
- textobjects = @driver.getconfig(textfacts, "yaml")
- rescue => detail
- Puppet.err "Could not retrieve configuration: %s" % detail
-
- unless Puppet[:usecacheonfailure]
- @objects = nil
- Puppet.warning "Not using cache on failed configuration"
- return
+ benchmark(:debug, "Retrieved configuration") do
+ # error handling for this is done in the network client
+ begin
+ textobjects = @driver.getconfig(textfacts, "yaml")
+ rescue => detail
+ Puppet.err "Could not retrieve configuration: %s" % detail
+
+ unless Puppet[:usecacheonfailure]
+ @objects = nil
+ Puppet.warning "Not using cache on failed configuration"
+ return
+ end
end
end
@@ -275,7 +271,12 @@ class Puppet::Client::MasterClient < Puppet::Client
self.getconfig
if defined? @objects and @objects
- self.apply
+ unless @local
+ Puppet.notice "Starting configuration run"
+ end
+ benchmark(:notice, "Finished configuration run") do
+ self.apply
+ end
end
end
end