message: Removing own bucket impl in favour of ageCounter
diff: @@ -248,34 +248,14 @@ ClientPool.prototype.totalReconnectsWaiting = function (serverDomain) {
  return 0;
  };
  -ClientPool.prototype.getIdleConnectionMetrics = function(server) {
  - const SEVEN_DAYS_MS = 1000 * 60 * 60 * 24 * 7;
  - const periodBucketTimes = {
  - "7d": Date.now() - SEVEN_DAYS_MS,
  - "14d": Date.now() - SEVEN_DAYS_MS*2,
  - "21d": Date.now() - SEVEN_DAYS_MS*3,
  - };
  -
  - const _idleConnectionMetrics = {
  - "7d": 0,
  - "14d": 0,
  - "21d": 0,
  - };
  +ClientPool.prototype.updateActiveConnectionMetrics = function(server, ageCounter) {
  const clients = Object.values(this._virtualClients[server].userIds);
  - for (const bridgedClient of clients) {
  - const lastActionMS = bridgedClient.getLastActionTs();
  - let bucket = null;
  - for (const periodBucket in periodBucketTimes) {
  - if (lastActionMS > periodBucketTimes[periodBucket]) {
  - break;
  - }
  - bucket = periodBucket;
  + clients.forEach((bridgedClient) => {
  + if (bridgedClient.isDead()) {
  + return; // We don't want to include dead ones.
  }
  - if (bucket !== null) {
  - _idleConnectionMetrics[bucket]++;
  - }
  - }
  - return _idleConnectionMetrics;
  + ageCounter.bump((Date.now() - bridgedClient.getLastActionTs()) / 1000);
  + });
  };
  ClientPool.prototype._sendConnectionMetric = function(server) {
  