Zygo / bees

Best-Effort Extent-Same, a btrfs dedupe agent
GNU General Public License v3.0
630 stars 57 forks source link

Monitoring bees status via zabbix #208

Open YoSiJo opened 2 years ago

YoSiJo commented 2 years ago

First of all, thank you for this project. It is a real beautiful.

I saw that a status file is maintained by bees and started to evaluate it via Zabbix. The Repo can find here

Thereby the, very well maintained Event Counters documentation helped me a lot.

In the process, I noticed a few points:

Zygo commented 2 years ago

But what is missing is the item adjust_offset_hit. Is it possible that the file is not quite up to date?

That one is missing. Thanks for spotting it!

It seems that bees does not write the values to the file until they != 0. Is this the way it is supposed to be? I would then have to take this into account in Zabbix.

Yes. The statistics are collected by executing the line of code that increments the counter. The counters are created dynamically, so no execution means no counter is created. The code and the list of documented counters sometimes diverge (i.e. there may be undocumented counters and also documented counters with no code corresponding to them).

Note that the event counters are intended as a profiling tool for developers. They only report data from the currently running bees instance, and reset to 0 at the start of every run. The events are mostly relevant for comparing algorithms, i.e. does algorithm A spend more time on reading data or waiting for locks than algorithm B, or how often does some unusual event occur? They don't produce any useful metrics that can indicate progress or estimate completion of a dedupe cycle.

I haven't been able to quite figure out what data I can use to see how much Bees has left to go. Which statuses could I take for this, in your estimation?

bees does not calculate or track this information in any of the currently implemented scan modes. See issue #175 for a more detailed description of the challenges involved. Future scan modes may address this (e.g. by scanning in extent order instead of inode order.)