This commit:
- Changes to Python 3 template string rather than the formatted string
syntax.
- Calls the Deluge API once per plugin run for the "states" mode, rather
than once per torrent. Lines of code are reduced. The readability is
improved too, since the API call is similar to how the "peers" mode
works.
- Updates the label for the "state" entry "paused" to match it's name in the
libtorrent API: "stopped". "Queued" is split into "Queued seeding" and
"Queued downloads" to match the libtorrent API too.
Version 1.0.0 of this plugin requires version 1 of Deluge. Deluge 2 was
released in June 2019.
This commits bumps the plugin to version 2.0.0.
This plugin has three modes. The modes "bandwidth" and "states" are
working equally to the previous version. The third mode, "connections",
is changed.
The connections mode previously printed one value: the total number of
connections. That RPC call is removed in Deluge 2, and I'm instead
using `get_session_status`, which delegates the call to libtorrent [1].
libtorrent is much better documented, so it's easier to work with
compared to Deluge.
"Number of peers" replaces the previous "number of connections", and
I've added half open peers, and peers interested in download and upload
slots to the same graph.
[1]. https://libtorrent.org/manual-ref.html#session-statistics
From a summary comment in the code:
If a stacked graph is requested, plot the total. Rather than
aggregating them with CDEFs of SUMs, we sum them in the script, which
allows us to create real series than can be easily borrowed by other
loaning graphs.
Those series are recv_bits and send_bits.
There are longstanding bugs with them (dating back to snmp__if). This
has been documented, as well as some potential ad hoc fixes for the
data.
Some outdated bug were also removed from the doc.
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
Also, don't use mathlib with `bc`, as it's not needed, and only adds
spurious fractional bytes to the computed ideal usage.
Signed-off-by: Olivier Mehani <shtrom@ssji.net>
All temperatures are displayed in a single graph.
This should provide more convenience than the "w1_" plugin (being a
"suggest"-based wildcard plugin).
Additionally the label of each sensor can be overridden.