1140 lines
38 KiB
Groff
1140 lines
38 KiB
Groff
.\" Man page generated from reStructuredText.
|
||
.
|
||
.TH "GULIK" "1" "Oct 06, 2018" "0.0.0.1" "gulik"
|
||
.SH NAME
|
||
gulik \- gulik Documentation
|
||
.
|
||
.nr rst2man-indent-level 0
|
||
.
|
||
.de1 rstReportMargin
|
||
\\$1 \\n[an-margin]
|
||
level \\n[rst2man-indent-level]
|
||
level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||
-
|
||
\\n[rst2man-indent0]
|
||
\\n[rst2man-indent1]
|
||
\\n[rst2man-indent2]
|
||
..
|
||
.de1 INDENT
|
||
.\" .rstReportMargin pre:
|
||
. RS \\$1
|
||
. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
|
||
. nr rst2man-indent-level +1
|
||
.\" .rstReportMargin post:
|
||
..
|
||
.de UNINDENT
|
||
. RE
|
||
.\" indent \\n[an-margin]
|
||
.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||
.nr rst2man-indent-level -1
|
||
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
|
||
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
|
||
..
|
||
.sp
|
||
\fBNOTE:\fP
|
||
.INDENT 0.0
|
||
.INDENT 3.5
|
||
This documentation is still a work in progress and as such subject
|
||
to sudden changes, cataclysms and various other FNORDs. The software it
|
||
describes is still in alpha and may cause undue frustration if not taken
|
||
in moderation.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
[image]
|
||
.nf
|
||
This is ST. GULIK. He is the Messenger of the Goddess.
|
||
A different age from ours called him Hermes.
|
||
Many people called him by many names.
|
||
He is a Roach.
|
||
.fi
|
||
.sp
|
||
.SH QUICKSTART
|
||
.SS Install!
|
||
.nf
|
||
\fB[pkg|apt|dnf|fnord] install gtk3\fP
|
||
\fBpip[\-3.6] install \-\-user https://rnd.phryk.net/phryk\-evil\-mad\-sciences\-llc/gulik\fP
|
||
.fi
|
||
.sp
|
||
.SS Run!
|
||
.sp
|
||
\fBgulik\fP
|
||
.SS Done!
|
||
.sp
|
||
That\(aqs literally everything needed to get \fBgulik\fP to run.
|
||
If you want to go deeper, you can…
|
||
.SS Configure!
|
||
.sp
|
||
\fB$EDITOR ~/.config/gulik/config.py\fP
|
||
.sp
|
||
See also: \fI\%Configuration file\fP\&.
|
||
.SH DEFINITIONAL BULLSHIT
|
||
.sp
|
||
\fBgulik\fP is a highly configurable graphical system monitor.
|
||
.sp
|
||
\fBgulik\fP is a framework for custom graphical system monitors.
|
||
.sp
|
||
Both of these statements are true in some sense, false in some sense,
|
||
meaningless in some sense, true and false in some sense, true and meaningless
|
||
in some sense, false and meaningless in some sense and true and false and
|
||
meaningless in some sense.
|
||
.sp
|
||
This incarnation of our most holy saint \fBgulik\fP is software licensed
|
||
under the GPLv3 license, see \fBCOPYING\fP for more details.
|
||
.nf
|
||
The official git repository for \fBgulik\fP can be found at:
|
||
\fI\%https://rnd.phryk.net/phryk\-evil\-mad\-sciences\-llc/gulik/\fP
|
||
.fi
|
||
.sp
|
||
.sp
|
||
The PNG \fBgulik\fP logo is based on a nice public domain trace of the sacred
|
||
roach crafted by toa267 who is definitely not a cabbage.
|
||
.SH COMPATIBILITY AND DEPENDENCIES
|
||
.sp
|
||
\fBgulik\fP should skitter just fine on FreeBSD and the Linuxoids.
|
||
It will probably™ crawl into problems on OSX and other BSDs, but
|
||
\fI\%give us a holler\fP
|
||
if it doesn\(aqt run on your *nix flavor of choice and you\(aqre willing
|
||
to do some testing.
|
||
.sp
|
||
All bets are off on Windows®™ʷᵗᶠ unless someone else is willing to do a PR,
|
||
which we expect will be a long march through the valley of pain that we do not
|
||
wish upon anyone.
|
||
.sp
|
||
\fBgulik\fP runs only on python 3.6 or newer.
|
||
All python dependencies are noted in \fBsetup.py\fP, ready for use in pip.
|
||
.sp
|
||
The only other dependency is gtk3. It does run with X11 and \fIshould\fP run
|
||
with wayland, but the latter hasn\(aqt been tested.
|
||
.sp
|
||
To get partial transparency working (on X11) you need to have a compositing
|
||
manager like \fBxcompmgr\fP running.
|
||
.SH INSTALLATION
|
||
.nf
|
||
You can use pip to install \fBgulik\fP and all python dependencies in one go:
|
||
\fBpip install \-\-user git+https://rnd.phryk.net/phryk\-evil\-mad\-sciences\-llc/gulik/\fP
|
||
.fi
|
||
.sp
|
||
.sp
|
||
If you insist on manual installation, just clone the repository and copy the
|
||
\fBgulik\fP subdirectory into your \fBsite\-packages\fP directory and \fBbin/gulik\fP
|
||
to a directory in your \fB$PATH\fP\&.
|
||
.sp
|
||
The master branch of the repository always holds the most current release.
|
||
.SH RUNNING
|
||
.sp
|
||
You run \fBgulik\fP simply by running the \fBgulik\fP executable that comes with
|
||
the installation.
|
||
.SH CONFIGURATION AND CUSTOMIZATION
|
||
.SS Default behavior
|
||
.sp
|
||
By default, \fBgulik\fP will occupy a 200 pixel wide area over the full height
|
||
of the screen, placed at the left border of it and fill it with a few
|
||
\fI\%visualizer\fPs to grant you a good overview of what\(aqs happening on
|
||
your system.
|
||
.sp
|
||
It will use a black/white/green color scheme with a hue\-rotation palette
|
||
ranging from lime green to magenta\-ish pink and try to use the League of
|
||
Movable Type font \fI\%Orbitron\fP
|
||
which we very much recommend you install to get the right dystopian vibe.
|
||
.SS Configuration file
|
||
.sp
|
||
You can modify the settings for \fBgulik\fP by creating a configuration file
|
||
at \fB~/.config/gulik/config.py\fP\&. This file, as it\(aqs name suggests, is a
|
||
python code file. \fBgulik\fP will import and \fBexec()\fP it, loading all
|
||
\fBUPPERCASE\fP variables into its configuration.
|
||
.SS Lock and reload
|
||
.sp
|
||
When \fBgulik\fP is running, you can send \fBSIGUSR1\fP to its main process
|
||
at any time to tell it to reload the configuration file and apply its
|
||
settings. If your configuration file is broken, \fBgulik\fP will keep
|
||
running with the previous settings.
|
||
.sp
|
||
Sending the signal is currently a bit clunky, as you\(aqll have to do
|
||
something like: \fBkill \-s SIGUSR1 \(gapgrep \-f \(aqpython3.6.*gulik$\(aq\(ga\fP
|
||
since python applications always have the process name of the python
|
||
interpreter.
|
||
.SS Explaining ALL THE CONFIGURATION OPTIONS (not really, tho)
|
||
.INDENT 0.0
|
||
.IP \(bu 2
|
||
\fBFPS\fP (\fBint\fP or \fBfloat\fP): Frames Per Second; How often to redraw the window (and update system data). Default value: \fB1\fP
|
||
.IP \(bu 2
|
||
\fBWIDTH\fP (\fBint\fP): The width of the window in pixels. Default value: \fB200\fP
|
||
.IP \(bu 2
|
||
\fBHEIGHT\fP (\fBint\fP): The height of the window in pixels. Default value: \fBGdk.Screen().get_default().get_height()\fP
|
||
.IP \(bu 2
|
||
\fBX\fP (\fBint\fP): X coordinate of the windows top left corner. Default value: \fB0\fP
|
||
.IP \(bu 2
|
||
\fBY\fP (\fBint\fP): Y coordinate of the windows top left corner. Default value: \fB0\fP
|
||
.IP \(bu 2
|
||
\fBNETDATA_HOSTS\fP (\fBlist\fP): \fI\%netdata\fP hosts to connect to. Hosts as hostnames or \fB(host, port)\fP tuples. Default value: \fB[]\fP
|
||
.IP \(bu 2
|
||
\fBNETDATA_RETRY\fP (\fBint\fP or \fBfloat\fP): How long a defective \fI\%NetdataMonitor\fP will wait before retrying to contact the \fBnetdata\fP server, in seconds. Default value: \fB5\fP
|
||
.IP \(bu 2
|
||
\fBBSD_ACCURATE_MEMORY\fP (\fBbool\fP): Use accurate but expensive memory data collection on BSD. Default value: \fBFalse\fP
|
||
.IP \(bu 2
|
||
\fBMARGIN\fP (\fBint\fP or \fBfloat\fP): Margin around all \fI\%Visualizer\fPs. Default value: \fB5\fP
|
||
.IP \(bu 2
|
||
\fBPADDING\fP (\fBint\fP or \fBfloat\fP): Padding around all \fI\%Visualizer\fPs. Default value: \fB5\fP
|
||
.IP \(bu 2
|
||
\fBFONT\fP (\fBstr\fP): Font family to use in captions, legends and the like. Default value: \fB"Orbitron"\fP
|
||
.IP \(bu 2
|
||
\fBFONT_WEIGHT\fP (\fBstr\fP): Font weight. Default value: \fB"Light"\fP
|
||
.IP \(bu 2
|
||
\fBFONT_SIZE\fP (\fBint\fP or \fBfloat\fP): Font size in pixels. Default value: \fB10\fP
|
||
.IP \(bu 2
|
||
\fBCOLOR_WINDOW_BACKGROUND\fP (\fI\%Color\fP): Background color of the window. Default value: \fBColor(0.05, 0.05, 0.05, 0.8)\fP
|
||
.IP \(bu 2
|
||
\fBCOLOR_BACKGROUND\fP (\fI\%Color\fP): Background color for \fI\%Visualizer\fPs. Default value: \fBColor(1,1,1, 0.1)\fP
|
||
.IP \(bu 2
|
||
\fBCOLOR_FOREGROUND\fP (\fI\%Color\fP): Foreground color. This is used as base color for most \fI\%palette\fPs. Default value: \fBColor(0.5, 1, 0, 0.6)\fP
|
||
.IP \(bu 2
|
||
\fBCOLOR_CAPTION\fP (\fI\%Color\fP): Text color for captions. Default value: \fBColor(1,1,1, 0.6)\fP
|
||
.IP \(bu 2
|
||
\fBPALETTE\fP (\fBfunction\fP): The default \fI\%palette\fP generator. Default value: \fBfunctools.partial(\fP \fI\%palette_hue()\fP \fB, distance=\-120)\fP
|
||
.IP \(bu 2
|
||
\fBPATTERN\fP (\fBfunction\fP): The default \fI\%pattern\fP generator. Default value: \fBstripe45\fP
|
||
.IP \(bu 2
|
||
\fBCAPTION_PLACEMENT\fP (\fBstr\fP): \fB"padding"\fP to have captions placed in the paddings of \fI\%Visualizer\fPs, \fB"inner"\fP to place them within the drawing region of the \fI\%Visualizer\fP\&. Default value: \fB"inner"\fP
|
||
.IP \(bu 2
|
||
\fBLEGEND\fP (\fBbool\fP): Whether \fI\%Visualizer\fPs should attempt automatically creating a legend for themselves in their bottom padding. Default value: \fBTrue\fP
|
||
.IP \(bu 2
|
||
\fBLEGEND_ORDER\fP (\fBstr\fP): Whether to reverse the legend order. Can be \fB"normal"\fP or \fB"reverse"\fP\&. Default value: \fB"normal"\fP
|
||
.IP \(bu 2
|
||
\fBLEGEND_SIZE\fP (\fBint\fP or \fBfloat\fP): Pixel height of one legend cell, including its own margin and padding. Legend font size is inferred from this. Default value: \fB20\fP
|
||
.IP \(bu 2
|
||
\fBLEGEND_PLACEMENT\fP (\fBstr\fP): Where to place legends within the \fI\%Visualizer\fPs drawing region. Can be \fB"inner"\fP or \fB"padding"\fP\&. Default value: \fB"padding"\fP
|
||
.IP \(bu 2
|
||
\fBLEGEND_MARGIN\fP (\fBint\fP or \fBfloat\fP): Margin around legends. Default value: \fB2.5\fP
|
||
.IP \(bu 2
|
||
\fBLEGEND_PADDING\fP: Padding around legends. Default value: \fB0\fP
|
||
.IP \(bu 2
|
||
\fBOPERATOR\fP: The blending operator used by \fI\%Visualizer\fPs. Default value: \fBOperator.OVER\fP
|
||
.UNINDENT
|
||
.SS Explaining ALL THE ᴀʟʟ ᴛʜᴇ ᴄᴏɴꜰɪɢᴜʀᴀᴛɪᴏɴ ᴏᴘᴛɪᴏɴꜱ (ya rly)
|
||
.sp
|
||
The above list doesn\(aqt really cover all the possible configuration variables
|
||
you can set, as \fBgulik\fP features a perversion of cascading styles.
|
||
.sp
|
||
Every single option except for \fBFPS\fP, \fBX\fP, \fBY\fP, \fBNETDATA_HOSTS\fP,
|
||
\fBNETDATA_RETRY\fP and \fBBSD_ACCURATE_MEMORY\fP can be overriden on a per\-class
|
||
basis by appending an underscore and the class name in uppercase to the
|
||
variable name. To disable legends on all \fI\%Plot\fPs for example, you
|
||
would use \fBLEGEND_PLOT = False\fP\&.
|
||
.sp
|
||
Additionally, \fBMARGIN\fP and \fBPADDING\fP can be set for each side by
|
||
appending an underscore and one of \fBLEFT\fP, \fBRIGHT\fP, \fBTOP\fP or \fBBOTTOM\fP\&.
|
||
.sp
|
||
If you want to mix both of these things, the resulting string follows the
|
||
pattern \fI<name>_<class>_<subname>\fP, for example \fBPADDING_PLOT_RIGHT\fP or
|
||
\fBLEGEND_MARGIN_ARC_BOTTOM\fP\&.
|
||
.SS Custom setups
|
||
.sp
|
||
By default, gulik will run \fBGulik.autosetup()\fP to set up a reasonable
|
||
collection of \fI\%Visualizer\fPs that gives you a good overview of your
|
||
system – but you can add your own \fBsetup\fP function to the configuration
|
||
file that will be used in stead of the autosetup.
|
||
.INDENT 0.0
|
||
.INDENT 3.5
|
||
.sp
|
||
.nf
|
||
.ft C
|
||
import gulik
|
||
|
||
def setup(app):
|
||
|
||
box = app.box()
|
||
|
||
box.place(
|
||
\(aqcpu\(aq,
|
||
gulik.Plot,
|
||
elements=[\(aqcore_0\(aq, \(aqcore_1\(aq],
|
||
width=box.width,
|
||
height=box.width + 40
|
||
)
|
||
.ft P
|
||
.fi
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.sp
|
||
Let\(aqs look at the code, line by line:
|
||
.INDENT 0.0
|
||
.TP
|
||
.B \fBdef setup(app)\fP
|
||
The name of the setup function \fImust\fP be \fBsetup\fP, otherwise \fBgulik\fP won\(aqt recognize it.
|
||
The passed \fBapp\fP parameter is a \fI\%Gulik\fP object.
|
||
.TP
|
||
.B \fBbox = app.box()\fP
|
||
\fBGulik.box()\fP creates a \fI\%Box\fP, a little helper to make layouting
|
||
easier. You can limit its size via \fBwidth\fP and \fBheight\fP keyword parameters.
|
||
If these aren\(aqt supplied, the box will fill the whole window.
|
||
.TP
|
||
.B \fBbox.place(\fP
|
||
\fI\%Box.place()\fP places a new \fI\%visualizer\fP\&. \fI\%Box\fP orders
|
||
visualizers from left to right and top to bottom.
|
||
.TP
|
||
.B \fB\(aqcpu\(aq\fP
|
||
This is the monitored \fI\%component\fP we want to visualize \fI\%element\fPs
|
||
of. It is needed to look up the right \fI\%Monitor\fP object for
|
||
\fI\%Visualizer\fP instantiation.
|
||
.TP
|
||
.B \fBgulik.Plot\fP
|
||
The \fI\%visualizer\fP class to be instantiated.
|
||
A subclass of \fI\%Visualizer\fP\&.
|
||
.UNINDENT
|
||
.sp
|
||
All keyword arguments below this are just passed on to the visualizer class,
|
||
so in this case, \fI\%Plot\fP\&. Here, these are:
|
||
.INDENT 0.0
|
||
.TP
|
||
.B \fBelements=[\(aqcore_0\(aq, \(aqcore_1\(aq],\fP
|
||
Defines the \fI\%element\fPs to be visualized. These two values refer
|
||
to the first and second CPU cores.
|
||
.TP
|
||
.B \fBwidth=box.width,\fP
|
||
Defines the width of the \fI\%visualizer\fP\&.
|
||
.TP
|
||
.B \fBheight=box.width + 40\fP
|
||
Defines the height of the \fI\%visualizer\fP\&. Has 40 pixel added to it,
|
||
because by default, \fBgulik\fP adds 40 pixel bottom padding to every
|
||
visualizer to allow 2 lines of legend.
|
||
.UNINDENT
|
||
.sp
|
||
\fI\%Box.place()\fP uses the \fBwidth\fP and \fBheight\fP keyword parameters
|
||
(if passed) to make its layouting decisions. If they aren\(aqt passed, all
|
||
remaining space is used.
|
||
.sp
|
||
And with that, you hopefully know enough to get started with your custom
|
||
setup. You can consult \fI\%Monitor\fP and its subclasses to find out
|
||
\fIwhat\fP you can visualize and \fI\%Visualizer\fP and its subclasses to
|
||
find out \fIhow\fP you can visualize that data.
|
||
.sp
|
||
If you want to extend the original setup instead of doing a completely
|
||
custom one, you can call \fBGulik.autosetup()\fP from your custom \fBsetup\fP
|
||
function and limit its area by using \fBwidth\fP and \fBheight\fP as well as
|
||
\fBx\fP and \fBy\fP keyword parameters.
|
||
.SH MODULE REFERENCE
|
||
.SS Architecture
|
||
.INDENT 0.0
|
||
.INDENT 3.5
|
||
.sp
|
||
.nf
|
||
.ft C
|
||
+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
|
||
| |
|
||
| gulik process | collector processes
|
||
| |
|
||
| (main thread) (monitor threads) |
|
||
| Gulik\-\-\-\-\-\-\-\-\-\-\- CPUMonitor <\-\-\-\-\-ø\-\-\-\-\-> CPUCollector
|
||
| | | \(ga\- MemoryMonitor <\-\-\-\-\-ø\-\-\-\-\-> MemoryCollector
|
||
| | |\(ga\-\- NetworkMonitor <\-\-\-\-\-ø\-\-\-\-\-> NetworkCollector
|
||
| | \(ga\-\-\- … <\-\-\-\-\-ø\-\-\-\-\-> …
|
||
| | | |
|
||
| | | |
|
||
| \(ga\-\- visualizers | (visualizers |
|
||
| | \(ga\- Arc | access |
|
||
| |\(ga\-\- Plot <\' monitors) |
|
||
| \(ga\-\-\- … |
|
||
| |
|
||
+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+
|
||
.ft P
|
||
.fi
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.sp
|
||
In \fBgulik\fP, there is one central \fI\%Gulik\fP object.
|
||
It manages \fI\%Monitor\fPs and \fI\%Visualizer\fPs.
|
||
.sp
|
||
Visualizers use the \fBMonitor.normalize()\fP and \fBMonitor.caption()\fP
|
||
functions to utilize the collected data.
|
||
.sp
|
||
Communication between the \fI\%Monitor\fPs within the gulik process and
|
||
\fBCollector\fP processes is done via queues. Every monitor/collector
|
||
pair shares two queues. One "update queue" that monitors use to send update
|
||
requests to collectors and one "data queue" that collectors use to send the
|
||
next datapoint to their respective monitor.
|
||
.SS Box model
|
||
.INDENT 0.0
|
||
.INDENT 3.5
|
||
.sp
|
||
.nf
|
||
.ft C
|
||
+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ ↑
|
||
| | |
|
||
| margin | |
|
||
| | |
|
||
| +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | |
|
||
| | | |
|
||
| | padding | | h
|
||
| | | | e
|
||
| | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ ↑ | | i
|
||
| | | | | inner | | g
|
||
| | | inner drawing region | | height | | h
|
||
| | | | | | | t
|
||
| | +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ ↓ | |
|
||
| | | | |
|
||
| | ←\-\-\-\-\-\-\-\-\-\-\-\- inner width \-\-\-\-\-\-\-\-\-\-→ | | |
|
||
| | | | |
|
||
| +\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ | |
|
||
| | |
|
||
+\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-+ ↓
|
||
|
||
←\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\- width \-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-\-→
|
||
.ft P
|
||
.fi
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.sp
|
||
\fBgulik\fPs box model is pretty similar to the one CSS has, with
|
||
one important distinction: margins and paddings are included in
|
||
\fBwidth\fP and \fBheight\fP in order to make layouting easier.
|
||
.SS Concepts
|
||
.SS visualizer
|
||
.sp
|
||
Visualizers are instances of any subclass of \fI\%Visualizer\fP\&.
|
||
.sp
|
||
A visualizer is assigned a \fI\%Monitor\fP and a list of \fI\%element\fPs.
|
||
.sp
|
||
\fI\%Gulik\fP will periodically call all visualizers \fBupdate\fP methods
|
||
(see source of \fI\%Visualizer.update()\fP).
|
||
.sp
|
||
What exactly happens in the \fBupdate\fP function of a visualizer differs
|
||
between the different classes, but usually it queries the instance\-assigned
|
||
monitor for the most recent data about its \fI\%element\fPs by calling
|
||
\fBMonitor.normalize()\fP and then does some drawing on the passed
|
||
\fBcairo.Context\fP to visualize the data in some manner.
|
||
.INDENT 0.0
|
||
.TP
|
||
.B Currently, there are 7 built\-in visualizers:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fI\%Text\fP
|
||
.IP \(bu 2
|
||
\fI\%Rect\fP
|
||
.IP \(bu 2
|
||
\fI\%Arc\fP
|
||
.IP \(bu 2
|
||
\fI\%Plot\fP
|
||
.IP \(bu 2
|
||
\fI\%MirrorRect\fP
|
||
.IP \(bu 2
|
||
\fI\%MirrorArc\fP
|
||
.IP \(bu 2
|
||
\fI\%MirrorPlot\fP
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.sp
|
||
You are, however, welcome to implement your own visualizers by subclassing
|
||
\fI\%Visualizer\fP and overriding \fBVisualizer.draw()\fP\&.
|
||
.SS monitor
|
||
.sp
|
||
Monitors are instances of any subclass of \fI\%Monitor\fP,
|
||
which itself is a subclass of \fBmultithreading.Thread\fP\&.
|
||
.sp
|
||
Every monitor acts as one half of a monitor\-\fI\%collector\fP pair,
|
||
each of which collects and transforms data on a specific \fI\%component\fP\&.
|
||
.sp
|
||
The monitors responsibility in this pair is to take data from the collector
|
||
and offer it in a form that is usable by \fI\%visualizer\fPs. This is mainly
|
||
done through the functions \fBMonitor.normalize()\fP and \fBMonitor.caption()\fP\&.
|
||
.INDENT 0.0
|
||
.TP
|
||
.B Currently, there are 6 built\-in monitors:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fI\%CPUMonitor\fP
|
||
.IP \(bu 2
|
||
\fI\%MemoryMonitor\fP
|
||
.IP \(bu 2
|
||
\fI\%NetworkMonitor\fP
|
||
.IP \(bu 2
|
||
\fI\%BatteryMonitor\fP
|
||
.IP \(bu 2
|
||
\fI\%DiskMonitor\fP
|
||
.IP \(bu 2
|
||
\fI\%NetdataMonitor\fP
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.SS collector
|
||
.sp
|
||
Collectors are instances of any subclass of \fBCollector\fP,
|
||
which itself is a subclass of \fBmultiprocessing.Process\fP\&.
|
||
.sp
|
||
Every collector acts as one half of a \fI\%monitor\fP\-collector pair.
|
||
.sp
|
||
The collectors responsibility in this pair is to collect system usage
|
||
data and send them to its associated \fI\%monitor\fP\&.
|
||
.SS component
|
||
.sp
|
||
A string identifying a data source.
|
||
.INDENT 0.0
|
||
.TP
|
||
.B Valid values are:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fB\(aqcpu\(aq\fP
|
||
.IP \(bu 2
|
||
\fB\(aqmemory\(aq\fP
|
||
.IP \(bu 2
|
||
\fB\(aqnetwork\(aq\fP
|
||
.IP \(bu 2
|
||
\fB\(aqbattery\(aq\fP
|
||
.IP \(bu 2
|
||
\fB\(aqdisk\(aq\fP
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.sp
|
||
Besides that, \fB\(aqnetdata\-<hostname>\(aq\fP is valid, but only if \fB<hostname>\fP
|
||
exists in the \fBNETDATA_HOSTS\fP configuration option.
|
||
.SS element
|
||
.sp
|
||
A string identifying a (sub) element of a data source.
|
||
Valid values are defined within the respective \fI\%Monitor\fPs.
|
||
.SS alignment
|
||
.INDENT 0.0
|
||
.TP
|
||
.B A string in the shape of \fB<x\-align>_<y\-align>\fP, where:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fB<x\-align>\fP can be any of \fBleft\fP, \fBcenter\fP, \fBright\fP
|
||
.IP \(bu 2
|
||
\fB<y\-align>\fP can be any of \fBtop\fP, \fBcenter\fP, \fBbottom\fP
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.sp
|
||
alignments are used both for text positioning relative to its respective
|
||
allowed borders as well as positioning captions within \fI\%Visualizer\fPs.
|
||
.SS caption description
|
||
.sp
|
||
A dictionary describing a caption to be rendered by a \fI\%Visualizer\fP\&.
|
||
.INDENT 0.0
|
||
.TP
|
||
.B Required items:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBtext\fP: The text to be rendered
|
||
.UNINDENT
|
||
.TP
|
||
.B Optional items:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBposition\fP: Either an \fB(x,y)\fP coordinate tuple or an \fI\%alignment\fP
|
||
.IP \(bu 2
|
||
\fBalign\fP: An \fI\%alignment\fP
|
||
.IP \(bu 2
|
||
\fBfont_size\fP: A number (int or float) denoting vertical font size in pixels
|
||
.IP \(bu 2
|
||
\fBfont_weight\fP: A string. \fBNormal\fP, \fBBold\fP, \fBLight\fP, etc.
|
||
.IP \(bu 2
|
||
\fBoperator\fP: One of cairos blending operators (See \fBcairo.Operator\fP)
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.SS pattern
|
||
.sp
|
||
A function taking one \fI\%Color\fP as parameter returning a cairo surface for
|
||
use as fill. See \fBstripe45()\fP for an example.
|
||
.SS palette
|
||
.sp
|
||
A function taking one \fI\%Color\fP and one \fIint\fP parameter returning a
|
||
\fBlist\fP of \fI\%Color\fP objects with its length being equal to the passed
|
||
\fIint\fP parameter.
|
||
.sp
|
||
\fBNOTE:\fP
|
||
.INDENT 0.0
|
||
.INDENT 3.5
|
||
\fI\%palette_hue()\fP and \fI\%palette_value()\fP have extra parameters
|
||
you won\(aqt be able to use without wrapping them in \fBfunctools.partial()\fP
|
||
first!
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.SS combination
|
||
.sp
|
||
A string denoting how multiple \fI\%element\fPs are displayed within a \fI\%Visualizer\fP\&.
|
||
.INDENT 0.0
|
||
.TP
|
||
.B Valid values are:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBseparate\fP: separate elements visually
|
||
.IP \(bu 2
|
||
\fBcumulative\fP: show values cumulatively, assume data is normalized for that (i.e. all values added max out at 1.0)
|
||
.IP \(bu 2
|
||
\fBcumulative_force\fP: like \fBcumulative\fP, but assumes every single value can go up to 1.0
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.Color(red=None, green=None, blue=None, alpha=None, hue=None, saturation=None, value=None)
|
||
Magic color class implementing and supplying on\-the\-fly manipulation of
|
||
RGB and HSV (and alpha) attributes.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B tuple_rgb()
|
||
return color (without alpha) as tuple, channels being float 0.0\-1.0
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B tuple_rgba()
|
||
return color (\fIwith\fP alpha) as tuple, channels being float 0.0\-1.0
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.DotDict
|
||
A dictionary with its data being readable through faked attributes.
|
||
Used to avoid [[[][][][][]] in caption formatting.
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B gulik.palette_hue(base, count, distance=180)
|
||
Creates a hue\-rotation palette.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Parameters
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBbase\fP (\fI\%Color\fP) \-\- Color on which the palette will be based (i.e. the starting point of the hue\-rotation).
|
||
.IP \(bu 2
|
||
\fBcount\fP (\fIint\fP) \-\- number of colors the palette should hold.
|
||
.IP \(bu 2
|
||
\fBdistance\fP (\fIint\fP\fI or \fP\fIfloat\fP) \-\- angular distance on a 360° hue circle thingamabob.
|
||
.UNINDENT
|
||
.TP
|
||
.B Returns
|
||
A list of length \fBcount\fP of \fI\%Color\fP objects.
|
||
.TP
|
||
.B Return type
|
||
list
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B gulik.palette_value(base, count, min=None, max=None)
|
||
Creates a value\-stepped palette
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Parameters
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBbase\fP (\fI\%Color\fP) \-\- Color on which the palette will be based (i.e. source of hue and saturation)
|
||
.IP \(bu 2
|
||
\fBcount\fP (\fIint\fP) \-\- number of colors the palette should hold
|
||
.IP \(bu 2
|
||
\fBmin\fP (\fIfloat >= 0 and <= 1\fP) \-\- minimum value (the v in hsv)
|
||
.IP \(bu 2
|
||
\fBmax\fP (\fIfloat >= 0 and <= 1\fP) \-\- maximum value
|
||
.UNINDENT
|
||
.TP
|
||
.B Returns
|
||
A list of length \fBcount\fP of \fI\%Color\fP objects.
|
||
.TP
|
||
.B Return type
|
||
list
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B gulik.pretty_si(number)
|
||
Return a SI\-postfixed string representation of a number (int or float).
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B gulik.pretty_bytes(bytecount)
|
||
Return a human\-readable representation given a size in bytes.
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B gulik.pretty_bits(bytecount)
|
||
Return a human\-readable representation in bits given a size in bytes.
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B gulik.ignore_none(*args)
|
||
Return the first passed value that isn\(aqt \fBNone\fP\&.
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.Monitor(app, component)
|
||
The base class for all \fI\%monitor\fPs.
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.CPUMonitor(app, component)
|
||
Memory for CPU usage.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B normalize(element)
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Elements exposed:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBaggregate\fP: average cpu use, sum of all core loads divided by number of cores
|
||
.IP \(bu 2
|
||
\fBcore_<n>\fP: load of core \fB<n>\fP, with possible values of \fB<n>\fP being 0 to number of cores \- 1
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B caption(fmt)
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Exposed keys:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBaggregate\fP: average cpu use, sum of all core loads divided by number of cores
|
||
.IP \(bu 2
|
||
\fBcore_<n>\fP: load of core \fB<n>\fP, with possible values of \fB<n>\fP being 0 to number of cores \- 1
|
||
.IP \(bu 2
|
||
\fBcount\fP: number of cores
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.MemoryMonitor(app, component)
|
||
Monitor for memory usage
|
||
.INDENT 7.0
|
||
.TP
|
||
.B normalize(element)
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Elements exposed:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBpercent\fP: memory use of all processes.
|
||
.IP \(bu 2
|
||
\fBtop_<n>\fP: memory use of the \fB<n>\fP h\-biggest process. Valid values of \fB<n>\fP are 1\-3.
|
||
.IP \(bu 2
|
||
\fBother\fP: memory use of all processes except the top 3
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B caption(fmt)
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Exposed keys:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBtotal\fP: how much memory this machine has in total,
|
||
.IP \(bu 2
|
||
\fBpercent\fP: total memory usage in percent.
|
||
.IP \(bu 2
|
||
\fBavailable\fP: how much memory can be malloc\(aqd without going into swap (roughly).
|
||
.IP \(bu 2
|
||
\fBtop_<n>\fP: access information about the 3 "biggest" processes. possible subkeys are \fBname\fP, \fBsize\fP and \fBpercent\fP\&.
|
||
.IP \(bu 2
|
||
\fBother\fP: aggregate information for all processes \fIexcept\fP the top 3. Same subkeys as those, plus \fB\(aqcount\fP\&.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.NetworkMonitor(app, component)
|
||
Monitor for network interfaces.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B count_sec(interface, key)
|
||
get a specified count for a given interface
|
||
as calculated for the last second.
|
||
.sp
|
||
EXAMPLE: \fBself.count_sec(\(aqeth0\(aq, \(aqbytes_sent\(aq)\fP
|
||
(will return count of bytes sent in the last second)
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B normalize(element)
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Exposed elements:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fB<if>.bytes_sent\fP: upload of network interface \fB<if>\fP\&.
|
||
.IP \(bu 2
|
||
\fB<if>.bytes_recv\fP: download of network interface \fB<if>\fP\&.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.sp
|
||
\fI<if>\fP can be any local network interface as well as \fI\(aqaggregate\(aq\fP\&.
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B caption(fmt)
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Exposed keys:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fB<if>.bytes_sent\fP: upload of network interface \fB<if>\fP\&.
|
||
.IP \(bu 2
|
||
\fB<if>.bytes_recv\fP: download of network interface \fB<if>\fP\&.
|
||
.IP \(bu 2
|
||
\fB<if>.if_up\fP: Boolean, whether the interface is up.
|
||
.IP \(bu 2
|
||
\fB<if>.speed\fP: interface speed in Mbit/s
|
||
.IP \(bu 2
|
||
.INDENT 2.0
|
||
.TP
|
||
.B \fB<if>.counters\fP: supplies access to interface counters. Possible sub\-elements are:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBbytes_sent\fP
|
||
.IP \(bu 2
|
||
\fBbytes_recv\fP
|
||
.IP \(bu 2
|
||
\fBpackets_sent\fP
|
||
.IP \(bu 2
|
||
\fBpackets_recv\fP
|
||
.IP \(bu 2
|
||
\fBerrin\fP
|
||
.IP \(bu 2
|
||
\fBerrout\fP
|
||
.IP \(bu 2
|
||
\fBdropin\fP
|
||
.IP \(bu 2
|
||
\fBdropout\fP
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.sp
|
||
\fI<if>\fP can be any local network interface as well as \fB\(aqaggregate\(aq\fP\&.
|
||
.sp
|
||
Additionally, the \fB\(aqaggregate\(aq\fP interface exposes the total
|
||
count of network interfaces as \fBif_count\fP\&.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.BatteryMonitor(app, component)
|
||
Monitor laptop batteries.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B normalize(element)
|
||
This function exposes no explicit elements, but always just returns
|
||
the current fill of the battery.
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B caption(fmt)
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Exposed keys:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBpower_plugged\fP: Boolean, whether the AC cable is connected.
|
||
.IP \(bu 2
|
||
\fBpercent\fP: current fill of the battery in percent.
|
||
.IP \(bu 2
|
||
\fBsecsleft\fP: seconds left till battery is completely drained.
|
||
.IP \(bu 2
|
||
\fBstate\fP: Current state of the battery, one of \fB\(aqfull\(aq\fP, \fB\(aqcharging\(aq\fP or \fB\(aqdraining\(aq\fP\&.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.DiskMonitor(*args, **kwargs)
|
||
Monitors disk I/O and partitions.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B normalize(element)
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Elements exposed:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
.INDENT 2.0
|
||
.TP
|
||
.B \fBio\fP
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
Valid subelements are disk device file names as found in
|
||
\fB/dev\fP\&. Examples: \fBada0\fP, \fBsda\fP\&.
|
||
.INDENT 2.0
|
||
.TP
|
||
.B Valid subsubelements are as follows:
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBread_bytes\fP
|
||
.IP \(bu 2
|
||
\fBwrite_bytes\fP
|
||
.IP \(bu 2
|
||
\fBread_time\fP
|
||
.IP \(bu 2
|
||
\fBwrite_time\fP
|
||
.IP \(bu 2
|
||
\fBbusy_time\fP
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.IP \(bu 2
|
||
.INDENT 2.0
|
||
.TP
|
||
.B \fBpartitions\fP
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
Valid subelements are partition device file names as
|
||
found in \fB/dev\fP, with dots (\fB\&.\fP) being replaced
|
||
with dashes (\fB\-\fP). Examples: \fBroot\-eli\fP, \fBsda1\fP\&.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B caption(fmt)
|
||
Exposed keys are the same as for \fI\%DiskMonitor.normalize()\fP\&.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.NetdataMonitor(app, component, host, port)
|
||
Monitor that interfaces with (remote) netdata instances.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B normalize(element)
|
||
Exposed elements correspond to \fIchart names\fP and their datapoint
|
||
|
||
.nf
|
||
*
|
||
.fi
|
||
dimension*s. For a list of valid chart and dimensions names, consult
|
||
\fB/api/v1/charts\fP of the netdata instance in question.
|
||
Examples.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBsystem.cpu.nice\fP
|
||
.IP \(bu 2
|
||
\fBdisk.ada0.writes\fP
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B caption(fmt)
|
||
Exposed keys are the same as for \fI\%NetdataMonitor.normalize()\fP\&.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.Visualizer(app, monitor, x=0, y=0, width=None, height=None, margin=None, margin_left=None, margin_right=None, margin_top=None, margin_bottom=None, padding=None, padding_left=None, padding_right=None, padding_top=None, padding_bottom=None, elements=None, captions=None, caption_placement=None, legend=None, legend_order=None, legend_format=None, legend_size=None, legend_placement=None, legend_margin=None, legend_margin_left=None, legend_margin_right=None, legend_margin_top=None, legend_margin_bottom=None, legend_padding=None, legend_padding_left=None, legend_padding_right=None, legend_padding_top=None, legend_padding_bottom=None, foreground=None, background=None, pattern=None, palette=None, combination=None, operator=None)
|
||
The base class for all visualizers. Not called widget to avoid naming
|
||
confusion with gtk widgets (which aren\(aqt even used in gulik).
|
||
.sp
|
||
Usually you won\(aqt instantiate this by yourself but use \fI\%Box.place()\fP\&.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Parameters
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBapp\fP (\fI\%Gulik\fP) \-\- The app managing visualizers and monitors
|
||
.IP \(bu 2
|
||
\fBmonitor\fP (\fI\%Monitor\fP) \-\- The monitor managing data collection for this visualizer
|
||
.IP \(bu 2
|
||
\fBx\fP (\fIint\fP) \-\- leftmost coordinate on the x\-axis
|
||
.IP \(bu 2
|
||
\fBy\fP (\fIint\fP) \-\- topmost coordinate on the y\-axis
|
||
.IP \(bu 2
|
||
\fBwidth\fP (\fIint\fP) \-\- overall width (including \fBmargin\fP and \fBpadding\fP)
|
||
.IP \(bu 2
|
||
\fBheight\fP (\fIint\fP) \-\- overall height (including \fBmargin\fP and \fBpadding\fP)
|
||
.IP \(bu 2
|
||
\fBmargin\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied around all sides
|
||
.IP \(bu 2
|
||
\fBmargin_left\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied to the left side
|
||
.IP \(bu 2
|
||
\fBmargin_right\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied to the right side
|
||
.IP \(bu 2
|
||
\fBmargin_top\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied to the top side
|
||
.IP \(bu 2
|
||
\fBmargin_bottom\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied to the bottom side
|
||
.IP \(bu 2
|
||
\fBpadding\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied around all sides
|
||
.IP \(bu 2
|
||
\fBpadding_left\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied to the left side
|
||
.IP \(bu 2
|
||
\fBpadding_right\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied to the right side
|
||
.IP \(bu 2
|
||
\fBpadding_top\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied to the top side
|
||
.IP \(bu 2
|
||
\fBpadding_bottom\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied to the bottom side
|
||
.IP \(bu 2
|
||
\fBelements\fP (\fIlist of str\fP) \-\- A list of \fI\%element\fPs to visualize
|
||
.IP \(bu 2
|
||
\fBcaptions\fP (\fIlist of dict\fP\fI, \fP\fIoptional\fP) \-\- A list of \fI\%caption descriptions\fP
|
||
.IP \(bu 2
|
||
\fBlegend\fP (\fIbool\fP) \-\- Whether to try to automatically create a legend of elements
|
||
.IP \(bu 2
|
||
\fBlegend_order\fP (\fI\(aqnormal\(aq\fP\fI or \fP\fI\(aqreverse\(aq\fP\fI, \fP\fIoptional\fP) \-\- Whether to reverse the legend order
|
||
.IP \(bu 2
|
||
\fBlegend_format\fP (\fIstr\fP) \-\- A format string, can contain \fB{element}\fP to refer to the element legend items refer to.
|
||
.IP \(bu 2
|
||
\fBlegend_size\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- height of a single legend item
|
||
.IP \(bu 2
|
||
\fBlegend_placement\fP (\fI\(aqpadding\(aq\fP\fI or \fP\fI\(aqinner\(aq\fP) \-\- Where to place the legend
|
||
.IP \(bu 2
|
||
\fBlegend_margin\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied around all sides of the legend
|
||
.IP \(bu 2
|
||
\fBlegend_margin_left\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied to the left side of the legend
|
||
.IP \(bu 2
|
||
\fBlegend_margin_right\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied to the right side of the legend
|
||
.IP \(bu 2
|
||
\fBlegend_margin_top\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied to the top side of the legend
|
||
.IP \(bu 2
|
||
\fBlegend_margin_bottom\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- margin applied to the bottom side of the legend
|
||
.IP \(bu 2
|
||
\fBlegend_padding\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied around all sides of the legend
|
||
.IP \(bu 2
|
||
\fBlegend_padding_left\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied to the left side of the legend
|
||
.IP \(bu 2
|
||
\fBlegend_padding_right\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied to the right side of the legend
|
||
.IP \(bu 2
|
||
\fBlegend_padding_top\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied to the top side of the legend
|
||
.IP \(bu 2
|
||
\fBlegend_padding_bottom\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- padding applied to the bottom side of the legend
|
||
.IP \(bu 2
|
||
\fBforeground\fP (\fI\%Color\fP, optional) \-\- The foreground color, base\-color for generated palettes
|
||
.IP \(bu 2
|
||
\fBbackground\fP (\fI\%Color\fP, optional) \-\- The background color
|
||
.IP \(bu 2
|
||
\fBpattern\fP (\fIfunction\fP\fI, \fP\fIoptional\fP) \-\- An executable \fI\%pattern\fP
|
||
.IP \(bu 2
|
||
\fBpalette\fP (\fIfunction\fP\fI, \fP\fIoptional\fP) \-\- An executable \fI\%palette\fP
|
||
.IP \(bu 2
|
||
\fBcombination\fP (\fIstr\fP\fI, \fP\fIoptional\fP) \-\- The \fI\%combination\fP mode used when displaying multiple \fI\%element\fPs
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B get_style(name, subname=None)
|
||
load the most specific style setting available given a name and optional subname.
|
||
usage examples: self.get_style(\(aqmargin\(aq, \(aqleft\(aq),
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B legend_info()
|
||
defines colors for legend elements
|
||
.UNINDENT
|
||
.INDENT 7.0
|
||
.TP
|
||
.B update(context)
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Parameters
|
||
\fBcontext\fP (\fBcairo.Context\fP) \-\- cairo context of the window
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.Text(app, monitor, text, speed=25, align=None, **kwargs)
|
||
Scrollable text using monitors\(aq \fBcaption\fP function to give textual
|
||
representations of values, prettified where necessary.
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.Rect(app, monitor, x=0, y=0, width=None, height=None, margin=None, margin_left=None, margin_right=None, margin_top=None, margin_bottom=None, padding=None, padding_left=None, padding_right=None, padding_top=None, padding_bottom=None, elements=None, captions=None, caption_placement=None, legend=None, legend_order=None, legend_format=None, legend_size=None, legend_placement=None, legend_margin=None, legend_margin_left=None, legend_margin_right=None, legend_margin_top=None, legend_margin_bottom=None, legend_padding=None, legend_padding_left=None, legend_padding_right=None, legend_padding_top=None, legend_padding_bottom=None, foreground=None, background=None, pattern=None, palette=None, combination=None, operator=None)
|
||
[image]
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.MirrorRect(app, monitor, **kwargs)
|
||
Mirrored variant of \fI\%Rect\fP\&.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B legend_info()
|
||
defines colors for legend elements
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.Arc(app, monitor, stroke_width=5, **kwargs)
|
||
[image]
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Parameters
|
||
\fBstroke_width\fP (\fIint\fP) \-\- width of the arc in pixels.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.MirrorArc(app, monitor, **kwargs)
|
||
Mirrored variant of \fI\%Arc\fP\&.
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.Plot(app, monitor, num_points=None, autoscale=None, markers=None, line=None, grid=None, **kwargs)
|
||
[image]
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Parameters
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBnum_points\fP (\fIint\fP\fI, \fP\fIoptional\fP) \-\- The number of datapoints to show.
|
||
.IP \(bu 2
|
||
\fBautoscale\fP (\fIbool\fP\fI, \fP\fIoptional\fP) \-\- Whether to automatically "zoom" into the data.
|
||
.IP \(bu 2
|
||
\fBmarkers\fP (\fIbool\fP\fI, \fP\fIoptional\fP) \-\- Whether tho render markers at data point coordinates.
|
||
.IP \(bu 2
|
||
\fBline\fP (\fIbool\fP\fI, \fP\fIoptional\fP) \-\- Whether to draw a line.
|
||
.IP \(bu 2
|
||
\fBgrid\fP (\fIbool\fP\fI, \fP\fIoptional\fP) \-\- Whether to draw a grid. The grid automatically adapts if \fBautoscale\fP is \fBTrue\fP\&.
|
||
.IP \(bu 2
|
||
\fB**kwargs\fP \-\- passed on to \fI\%Visualizer\fP\&.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.MirrorPlot(app, monitor, scale_lock=True, **kwargs)
|
||
Mirrored variant of \fI\%Plot\fP\&.
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.Box(app, x, y, width, height)
|
||
Can wrap multiple \fI\%Visualizer\fPs, used for layouting.
|
||
Orders added visualizers from left to right and top to bottom.
|
||
.sp
|
||
This is basically a smart helper for \fBGulik.add_visualizer()\fP\&.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B place(component, cls, **kwargs)
|
||
place a new \fI\%Visualizer\fP\&.
|
||
.INDENT 7.0
|
||
.TP
|
||
.B Parameters
|
||
.INDENT 7.0
|
||
.IP \(bu 2
|
||
\fBcomponent\fP (\fIstr\fP) \-\- The \fI\%component\fP string identifying the data source.
|
||
.IP \(bu 2
|
||
\fBcls\fP (\fBtype\fP, child of \fI\%Visualizer\fP) \-\- The visualizer class to instantiate.
|
||
.IP \(bu 2
|
||
\fB**kwargs\fP \-\- passed on to \fBcls\fP\(aq constructor. width and height defined in here are honored.
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.TP
|
||
.B class gulik.Gulik(configpath)
|
||
The main object thingamabob.
|
||
.UNINDENT
|
||
.INDENT 0.0
|
||
.IP \(bu 2
|
||
genindex
|
||
.IP \(bu 2
|
||
search
|
||
.UNINDENT
|
||
.SH AUTHOR
|
||
phryk
|
||
.SH COPYRIGHT
|
||
YOLD 3184, phryk
|
||
.\" Generated by docutils manpage writer.
|
||
.
|