How can I get the number of items stored under a cache group

Here is an untested one-liner, counting the cache data array returned from the magic __get method, with a fallback to an empty array if the group key is not set:

'numberOfEntries' => count( $wp_object_cache->cache[$group] ?? [] );

Another approach is to consider bindTo to access the private cache array of the $wp_object_cache instance via closure.

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)