1 | <?php |
||
17 | class SanityCheck { |
||
18 | |||
19 | /** |
||
20 | * The per-collection-size statistics buckets. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $buckets; |
||
25 | |||
26 | /** |
||
27 | * The module configuration. |
||
28 | * |
||
29 | * @var \Drupal\Core\Config\ImmutableConfig |
||
30 | */ |
||
31 | protected $config; |
||
32 | |||
33 | /** |
||
34 | * The mongodb.database_factory service. |
||
35 | * |
||
36 | * @var \Drupal\mongodb\DatabaseFactory |
||
37 | */ |
||
38 | protected $dbFactory; |
||
39 | |||
40 | /** |
||
41 | * The bucket size values. |
||
42 | * |
||
43 | * @var array |
||
44 | */ |
||
45 | protected $items; |
||
46 | |||
47 | /** |
||
48 | * SanityCheck constructor. |
||
49 | * |
||
50 | * @param \Drupal\mongodb\DatabaseFactory $dbFactory |
||
51 | * The mongodb.database_factory service. |
||
52 | * @param \Drupal\Core\Config\ConfigFactoryInterface $configFactory |
||
53 | * The config.factory service. |
||
54 | */ |
||
55 | public function __construct( |
||
64 | |||
65 | /** |
||
66 | * Build a list of the number of entries per collection in the default DB. |
||
67 | */ |
||
68 | public function buildCollectionstats(): array { |
||
85 | |||
86 | /** |
||
87 | * Prepare a table of bucket to hold the statistics. |
||
88 | */ |
||
89 | protected function initBucketsList(): void { |
||
106 | |||
107 | /** |
||
108 | * Store a collection document count in its statistics bucket. |
||
109 | * |
||
110 | * @param int $value |
||
111 | * The value to store. |
||
112 | */ |
||
113 | protected function store(int $value): void { |
||
127 | |||
128 | } |
||
129 |