Coverage for lib/ansible/plugins/callback/timer.py : 61%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
# (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Make coding more python3-ish
callback: timer callback_type: aggregate requirements: - whitelist in configuration short_description: Adds time to play stats version_added: "2.0" description: - This callback just adds total play duration to the play stats. '''
""" This callback module tells you how long your plays ran for. """
super(CallbackModule, self).__init__()
self.start_time = datetime.utcnow()
minutes = (runtime.seconds // 60) % 60 r_seconds = runtime.seconds % 60 return runtime.days, runtime.seconds // 3600, minutes, r_seconds
self.v2_playbook_on_stats(stats)
end_time = datetime.utcnow() runtime = end_time - self.start_time self._display.display("Playbook run took %s days, %s hours, %s minutes, %s seconds" % (self.days_hours_minutes_seconds(runtime))) |