Skip to content

Commit

Permalink
quantile: Add manpage
Browse files Browse the repository at this point in the history
  • Loading branch information
shramov committed Jan 15, 2024
1 parent 33ce04a commit 6f1ae77
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
1 change: 1 addition & 0 deletions debian/libtll-bin.install
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
/usr/lib/*/libtll-logic*.so
/usr/share/tll/scheme/tll/logic
/usr/share/man/*/tll-bench-channel.*
/usr/share/man/*/tll-logic-*
14 changes: 14 additions & 0 deletions src/logic/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,17 @@ shared_library('tll-logic-control'
, dependencies : [fmt, tll, rapidjson]
, install: true
)

mansources = [
'quantile.rst',
]

foreach f : mansources
custom_target('logic-man-@0@'.format(f)
, input: f
, output : 'tll-logic-@[email protected]'
, command : [rst2man, '@INPUT@', '@OUTPUT@']
, install_dir: get_option('mandir') / 'man7'
, install: true
)
endforeach
66 changes: 66 additions & 0 deletions src/logic/quantile.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
tll-logic-quantile
==================

:Manual Section: 7
:Manual Group: TLL
:Subtitle: Quantile calculation logic

Synopsis
--------

::

tll.proto: quantile
skip: <int>
quantiles: <list>
tll.channel.timer: <timer-channel>
tll.channel.input: <data-channel>


Description
-----------

Logic implements calculation of quantiles for the stream of input data with result dumped to logs on
each event from timer channel. Two types of quantiles are gathered - "global", covering all data
seen since logic open and "local", for data from last timer event. Input stream can contain
different types of values distinguished by short string tag. When a tag is seen first time new
quantile group is started and included in next dump.

Calculations are performed in constant memory and time using logarithmic aggregation with precision
of ``0.001 * value`` and are not exact. In practice this type of error is tolerable.

Channels
~~~~~~~~

``input`` - stream of input data

``timer`` - timer events

Init parameters
~~~~~~~~~~~~~~~

``quantiles=<list of int>`` (default ``95``) - list of quantiles (in percents), list of integer
values in range (0, 100] separated by comma, for example ``95,90,50``.

``skip=<int>`` (default ``0``) - amount of timer ticks to skip before recording global quantile
values. Useful to ignore inital stabilization time of measured system.

Input scheme
------------

.. code-block:: yaml
- name: Data
id: 10
fields:
- {name: name, type: byte8, options.type: string}
- {name: value, type: uint64}
See also
--------

``tll-logic-common(7)``

..
vim: sts=4 sw=4 et tw=100

0 comments on commit 6f1ae77

Please sign in to comment.