class WorkerMonitorsImpl implements WorkerMonitors {

    @Override
    public synchronized Map<WorkerMonitorInfoEnum, Serializable> getMonitorInfo() {
        try {
            Map<WorkerMonitorInfoEnum, Serializable> monitorInfo = Maps.newHashMap();

            Runtime runtime = Runtime.getRuntime();
            monitorInfo.put(WorkerMonitorInfoEnum.TOTAL_MEMORY, runtime.totalMemory());
            monitorInfo.put(WorkerMonitorInfoEnum.FREE_MEMORY, runtime.freeMemory());
            monitorInfo.put(WorkerMonitorInfoEnum.MAX_MEMORY, runtime.maxMemory());

            monitorInfo.put(WorkerMonitorInfoEnum.WORKER_ID, workerManager.getWorkerUuid());

            monitorInfo.put(WorkerMonitorInfoEnum.EXECUTION_THREADS_AMOUNT, workerManager.getExecutionThreadsCount());

            monitorInfo.put(WorkerMonitorInfoEnum.OUTBUFFER_CAPACITY, outBuffer.getCapacity());

            monitorInfo.put(WorkerMonitorInfoEnum.INBUFFER_CAPACITY, inBuffer.getCapacity());

            for (WorkerMonitor monitor : monitors) {
                monitor.captureMonitorInfo(monitorInfo);
            }

            monitorInfo.put(WorkerMonitorInfoEnum.MONITOR_START_TIME, monitorStartTime);
            monitorInfo.put(WorkerMonitorInfoEnum.MONITOR_END_TIME, System.currentTimeMillis());

            return monitorInfo;
        } finally {
            resetMonitor();
        }
    }

}