HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/output/__pycache__/profile.cpython-310.pyc
o

�N�gA	�@s8dZddlmmZdZdd�Zddd�Zd	d
�ZdS)a�
Display profiling data in a table format
========================================

Show profile data for returners that would normally show a highstate output.

CLI Example:

.. code-block:: bash

    salt '*' state.apply something --out=profile

Attempt to output the returns of state.sls and state.highstate as a table of
names, modules and durations that looks somewhat like the following::

    name                mod.fun                duration (ms)
    --------------------------------------------------------
    I-fail-unless-stmt  other.function               -1.0000
    old-minion-config   grains.list_present           1.1200
    salt-data           group.present                48.3800
    /etc/salt/minion    file.managed                 63.1450


To get the above appearance, use settings something like these::

    out.table.separate_rows: False
    out.table.justify: left
    out.table.delim: '  '
    out.table.prefix: ''
    out.table.suffix: ''
�NZprofilecCsdS)NT�rrr�G/opt/saltstack/salt/lib/python3.10/site-packages/salt/output/profile.py�__virtual__&sr�<c
Cs2g}td�}|D]w}||D]p}z|||}Wnty#i}Ynwt|t�s/dt|�i}t|��d�}|d}|d}	|�d|�d��}
t|�dd��}|
durUd}
t|
�|kre|
d|d	�d
}
t|d��}||krq|}|�||
|�d|	��g�qq|D]
}
d
j	|
d|d�|
d<q�dd�t
|�D�S)N�
duration (ms)�namez_|-r���Z__id__Zdurationz<>�z...z0.4f�.z
{0:{w}.4f})�wcSs$g|]}|dd�|dd��qS)�Nrr)�.0�xrrr�
<listcomp>Js$z#_find_durations.<locals>.<listcomp>)�len�	TypeError�
isinstance�dict�str�split�get�float�append�format�sorted)�dataZname_max�ret�ml�hostZsidZdat�ts�modZfunrZdur�l�rowrrr�_find_durations*s8�
�r#cKs@t|�}t|d<d|d<d|d<gd�|d�}tj|fi|��S)z7
    Display the profiling data in a table format.
    �opts�rowsZrows_key�labelsZ
labels_key)rzmod.funr)r&r%)r#Z__opts__�	table_out�output)r�kwargsr%Zto_showrrrr(Msr()r)�__doc__Zsalt.output.table_outr(r'Z__virtualname__rr#rrrr�<module>s 
#