stats method

  1. @override
Future<KeyStoreStats> stats()
override

Diagnostic snapshot of the keystore's state — total counts, TTL/TTB key counts, approximate size, oldest/newest timestamps. Intended for operator dashboards, not for runtime decisions on a hot path.

Implementation

@override
Future<KeyStoreStats> stats() async {
  final total = _db.raw
      .select('SELECT COUNT(*) c FROM notifications;')
      .first['c'] as int;
  return KeyStoreStats(
    totalKeys: total,
    ttlKeys: 0,
    ttbKeys: 0,
    sizeBytes: 0,
    oldestCreatedAt: null,
    newestCreatedAt: null,
  );
}