code: private void readThreads(){
  		long[] ids = threadMxBean.getAllThreadIds();
  
  		Map<Thread.State, Long> count = new EnumMap<>(Thread.State.class);
  		for (int i = 0; i<ids.length; i++){
  			long id = ids[i];
  			ThreadInfo info = threadMxBean.getThreadInfo(id);
  			if (info!=null){
  				Thread.State state = info.getThreadState();
  
  				Long old = count.get(state);
  				if (old==null) {
  					old = 0L;
  				}
  				count.put(state, old+1);
  			}
  		}
  
  		long total = 0;
  		for (Map.Entry<Thread.State, ThreadStateStats> entry : statsMap.entrySet()){
  			Long c = count.get(entry.getKey());
  			entry.getValue().updateCurrentValue(c==null ? 0 : c.longValue());
  			if (c!=null)
  				total += c.longValue();
  		}
  		cumulated.updateCurrentValue(total);
  
  	}
docs: Reads and updates the thread info.