diff options
author | Scott Moser <smoser@ubuntu.com> | 2013-07-30 15:10:55 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2013-07-30 15:10:55 -0400 |
commit | 219191673b5491fab683ca5ff1befe845c81f6cf (patch) | |
tree | 4afcc24f3d00a08b5cd442fc0a0e81a15a653e36 /bin | |
parent | 88b2a8ef062398499a2c14d309c132a081cac26b (diff) | |
parent | 0ca150b08433fbc57e10d599a46e300142c955c5 (diff) | |
download | vyos-cloud-init-219191673b5491fab683ca5ff1befe845c81f6cf.tar.gz vyos-cloud-init-219191673b5491fab683ca5ff1befe845c81f6cf.zip |
add util.log_time helper
The reason for this is that more and more things I was wanting to be able to
see how long they took. This puts that time logic into a single place. It
also supports from /proc/uptime as the timing mechanism.
While reading /proc/uptime is almost certainly slower than time.time(), it does
give millisecond granularity and is not affected by 'ntpdate' having run in
between the two events.
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/cloud-init | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/bin/cloud-init b/bin/cloud-init index c5a5b949..b4f9fd07 100755 --- a/bin/cloud-init +++ b/bin/cloud-init @@ -502,7 +502,9 @@ def main(): signal_handler.attach_handlers() (name, functor) = args.action - return functor(name, args) + + return util.log_time(logfunc=LOG.debug, msg="cloud-init mode '%s'" % name, + get_uptime=True, func=functor, args=(name, args)) if __name__ == '__main__': |