]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common: ModeCollector: locating the value of the mode wip-rf-just-mode
authorRonen Friedman <rfriedma@redhat.com>
Mon, 29 Sep 2025 07:16:13 +0000 (02:16 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Mon, 10 Nov 2025 16:36:38 +0000 (10:36 -0600)
commit3efcdbf92fb29932d17e7ddca49bf6a9105bb3aa
treebd23693896d3f6fe3f8a880671e5e411f604893f
parentafa88a4a7d0c87c35b7881212f0339b1ddc671fb
common: ModeCollector: locating the value of the mode

The ModeCollector class is used to collect values
of some type 'key', each associated with some object
identified by an 'ID'. The collector reports the 'mode'
value - the value associated with the largest number
of distinct IDs.

The results structure returned by the collector specifies
one of three possible mode_status_t values:

- no_mode_value - No clear victory for any value

- mode_value - we have a winner, but it has less than half of the
  samples

- authorative_value - more than half of the samples are of the same
  value

Signed-off-by: Ronen Friedman <rfriedma@redhat.com>
src/common/mode_collector.h [new file with mode: 0644]
src/test/CMakeLists.txt
src/test/test_mode_collector.cc [new file with mode: 0644]