Visualise Ansible execution time across playbooks, tasks, and hosts.

Overview

ansible-trace

Visualise where time is spent in your Ansible playbooks: what tasks, and what hosts, so you can find where to optimise and decrease playbook latency.

An Ansible Callback Function which traces the execution time of Ansible playooks, outputting Chrome's Trace Event Format for visualising in the Perfetto in-browser trace UI.

Here's a trace of me deploying to my home Raspberry Pi cluster, with the default strategy: linear. You can see that now all the tasks are synchronized across hosts, with each host waiting for the slowest host before proceeding to the next task:

Perfetto window showing tasks all happening synchronized

Here's the same playbook ran with strategy: free so fast hosts run to completion without waiting for slow hosts:

Perfetto window showing durations

You can click on tasks to see details about them:

Perfetto window showing details showing arguments and filename of task

Interactive Example

  1. Download (Right-click -> Save Link As) example-trace.json.
  2. Open https://ui.perfetto.dev/, and drag and drop in the downloaded example-trace.json.

Usage

  1. Copy trace.py into your Ansible's callback_plugins directory, or in other positions Ansible accepts, e.g.:

    ansible-root
    ├── ansible.cfg
    ├── site.yml
    └── callback_plugins
        └── trace.py
    
  2. Enable the trace callback plugin in your ansible.cfg:

    [defaults]
    callback_enabled = trace

    Or, enable it at the top of your playbook yml:

    ansible:
      env:
        CALLBACKS_ENABLED: trace
        TRACE_OUTPUT_DIR: .
        TRACE_HIDE_TASK_ARGUMENTS: True
  3. Run your Ansible Playbook:

    $ ansible-playbook site.yml

    This will output trace.json in the TRACE_OUTPUT_DIR, defaulting to your current working directory.

  4. Open https://ui.perfetto.dev/, and drag-and-drop in the trace.json.

    You don't have to wait for the trace to finish; you can open in-progress trace files.

Other Trace Viewers

Perfetto is the most mature trace viewer, but here are some other options:

  • chrome://tracing (aka Catapult Trace Viewer) is the older version of Perfetto. Supports generating a standalone HTML page.
  • Speedscope can open the traces, but only shows one host at a time.
  • Firefox Profiler can open the traces, showing trace spans in the "Marker Chart" tab: example.

Other Ansible Profiling Tools

profile_tasks

ansible.posix.profile_tasks displays task timing as console output, but can't visualise gaps in the timing (e.g. with strategy: linear when fast hosts wait for slow hosts).

ansible-playbook -vvvv

Adding extra vs adds more debug info, -vvvv enables connection debugging.

Mitogen for Ansible

Mitogen promises to speed up your Ansible playbooks with a persistent interpreter. They profile their runs for bandwidth an time by analysing network packet captures.

You need to install from HEAD to support latest Ansible versions, because there hasn't been a tagged release since 2019.

Owner
Mark Hansen
Mark Hansen
A Jupyter - Leaflet.js bridge

ipyleaflet A Jupyter / Leaflet bridge enabling interactive maps in the Jupyter notebook. Usage Selecting a basemap for a leaflet map: Loading a geojso

Jupyter Widgets 1.3k Dec 27, 2022
哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看、waifu2x等功能。

picacomic-windows 哔咔漫画window客户端,界面使用PySide2,已实现分类、搜索、收藏夹、下载、在线观看等功能。 功能介绍 登陆分流,还原安卓端的三个分流入口 分类,搜索,排行,收藏夹使用同一的逻辑,滚轮下滑自动加载下一页,双击打开 漫画详情,章节列表和评论列表 下载功能,目

1.8k Dec 31, 2022
The official colors of the FAU as matplotlib/seaborn colormaps

FAU - Colors The official colors of Friedrich-Alexander-Universität Erlangen-Nürnberg (FAU) as matplotlib / seaborn colormaps. We support the old colo

Machine Learning and Data Analytics Lab FAU 9 Sep 05, 2022
A python script editor for napari based on PyQode.

napari-script-editor A python script editor for napari based on PyQode. This napari plugin was generated with Cookiecutter using with @napari's cookie

Robert Haase 9 Sep 20, 2022
Splore - a simple graphical interface for scrolling through and exploring data sets of molecules

Scroll through and exPLORE molecule sets The splore framework aims to offer a si

3 Jun 18, 2022
Tools for calculating and visualizing Elo-like ratings of MLB teams using Retosheet data

Overview This project uses historical baseball games data to calculate an Elo-like rating for MLB teams based on regular season match ups. The Elo rat

Lukas Owens 0 Aug 25, 2021
A filler visualizer built using python

filler-visualizer 42 filler のログをビジュアライズしてスポーツさながら楽しむことができます! Usage (標準入力でvisualizer.pyに渡せばALL OK) 1. 既にあるログをビジュアライズする $ ./filler_vm -t 3 -p1 john_fill

Takumi Hara 1 Nov 04, 2021
web application for flight log analysis & review

Flight Review This is a web application for flight log analysis. It allows users to upload ULog flight logs, and analyze them through the browser. It

PX4 Drone Autopilot 145 Dec 20, 2022
Interactive Data Visualization in the browser, from Python

Bokeh is an interactive visualization library for modern web browsers. It provides elegant, concise construction of versatile graphics, and affords hi

Bokeh 17.1k Dec 31, 2022
在原神中使用围栏绘图

yuanshen_draw 在原神中使用围栏绘图 文件说明 toLines.py 将一张图片转换为对应的线条集合,视频可以按帧转换。 draw.py 在原神家园里绘制一张线条图。 draw_video.py 在原神家园里绘制视频(自动按帧摆放,截图(win)并回收) cat_to_video.py

14 Oct 08, 2022
a python function to plot a geopandas dataframe

Pretty GeoDataFrame A minimum python function (~60 lines) to draw pretty geodataframe. Based on matplotlib, shapely, descartes. Installation just use

haoming 27 Dec 05, 2022
Python script to generate a visualization of various sorting algorithms, image or video.

sorting_algo_visualizer Python script to generate a visualization of various sorting algorithms, image or video.

146 Nov 12, 2022
Schema validation for Xarray objects

xarray-schema Schema validation for Xarray installation This package is in the early stages of development. Install it from source: pip install git+gi

carbonplan 22 Oct 31, 2022
🐍PyNode Next allows you to easily create beautiful graph visualisations and animations

PyNode Next A complete rewrite of PyNode for the modern era. Up to five times faster than the original PyNode. PyNode Next allows you to easily create

ehne 3 Feb 12, 2022
A python visualization of the A* path finding algorithm

A python visualization of the A* path finding algorithm. It allows you to pick your start, end location and make obstacles and then view the process of finding the shortest path. You can also choose

Kimeon 4 Aug 02, 2022
Create 3d loss surface visualizations, with optimizer path. Issues welcome!

MLVTK A loss surface visualization tool Simple feed-forward network trained on chess data, using elu activation and Adam optimizer Simple feed-forward

7 Dec 21, 2022
Colormaps for astronomers

cmastro: colormaps for astronomers 🔭 This package contains custom colormaps that have been used in various astronomical applications, similar to cmoc

Adrian Price-Whelan 12 Oct 11, 2022
An(other) implementation of JSON Schema for Python

jsonschema jsonschema is an implementation of JSON Schema for Python. from jsonschema import validate # A sample schema, like what we'd get f

Julian Berman 4k Jan 04, 2023
Parse Robinhood 1099 Tax Document from PDF into CSV

Robinhood 1099 Parser This project converts Robinhood Securities 1099 tax document from PDF to CSV file. This tool will be helpful for those who need

Keun Tae (Kevin) Park 52 Jun 10, 2022
Realtime Viewer Mandelbrot set with Python and Taichi (cpu, opengl, cuda, vulkan, metal)

Mandelbrot-set-Realtime-Viewer- Realtime Viewer Mandelbrot set with Python and Taichi (cpu, opengl, cuda, vulkan, metal) Control: "WASD" - movement, "

22 Oct 31, 2022