]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
common: ModeCollector: locating the value of the mode
authorRonen Friedman <rfriedma@redhat.com>
Mon, 29 Sep 2025 07:16:13 +0000 (02:16 -0500)
committerRonen Friedman <rfriedma@redhat.com>
Mon, 29 Sep 2025 14:31:35 +0000 (09:31 -0500)
commit4d99dba25f892686c744eaa991402a77d830bc7f
treef20a5c8052f02e630aa288d9e9c1ab7da9a797c5
parentf42d7dbea97e13d700633ea31b4e1ad068fea72d
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]