anchor.diff:    final _statusMap = <String, int>{};
     final bool _collectFailed;
     final _failedPackages = new Set<String>();
  +  int _totalCount = 0;
  +  int _availableCount = 0;
   
     _Stat({bool collectFailed: false}) : _collectFailed = collectFailed;
   
  +  int get totalCount => _totalCount;
  +  int get availableCount => _availableCount;
  +
     void add(Job job) {
  +    _totalCount++;
  +    if (job.state == JobState.available) {
  +      _availableCount++;
  +    }
       final stateKey = jobStateAsString(job.state);
       final statusKey = jobStatusAsString(job.lastStatus);
       _stateMap[stateKey] = (_stateMap[stateKey] ?? 0) + 1;
  
positive.code:     return map;
    }
  }
  
negative.code:   }
  
    Future<Map> stats(JobService service) async {
      final _AllStats stats = new _AllStats();
  
      final query = _db.query(Job)..filter('service =', service);
      await for (Job job in query.run()) {
        stats.add(job);
      }
  
      final List<_AllStats> list = _lastStats.putIfAbsent(service, () => []);
      stats.updateEstimates(list.isEmpty ? null : list.first);
      // keep only the last 60-90 minutes of stats
      while (list.isNotEmpty &&
          list.first.timestamp.difference(stats.timestamp).abs().inMinutes > 90) {
        list.removeAt(0);
      }
      list.add(stats);
  
      return stats.toMap();
    }
  
    DateTime _extendLock(int errorCount, {Duration duration}) {
  