use of com.actiontech.dble.DbleServer in project dble by actiontech.
the class ShowServer method getRow.
private static RowDataPacket getRow(String charset) {
DbleServer server = DbleServer.getInstance();
long startupTime = server.getStartupTime();
long now = TimeUtil.currentTimeMillis();
long upTime = now - startupTime;
Runtime rt = Runtime.getRuntime();
long total = rt.totalMemory();
long max = rt.maxMemory();
long used = (total - rt.freeMemory());
RowDataPacket row = new RowDataPacket(FIELD_COUNT);
row.add(StringUtil.encode(FormatUtil.formatTime(upTime, 3), charset));
row.add(LongUtil.toBytes(used));
row.add(LongUtil.toBytes(total));
row.add(LongUtil.toBytes(max));
row.add(StringUtil.encode(FormatUtil.formatDate(server.getConfig().getReloadTime()), charset));
row.add(LongUtil.toBytes(server.getConfig().getRollbackTime()));
row.add(StringUtil.encode(charset, charset));
row.add(StringUtil.encode(DbleServer.getInstance().isOnline() ? "ON" : "OFF", charset));
return row;
}
use of com.actiontech.dble.DbleServer in project dble by actiontech.
the class ShowThreadPool method getExecutors.
private static List<ExecutorService> getExecutors() {
List<ExecutorService> list = new LinkedList<>();
DbleServer server = DbleServer.getInstance();
list.add(server.getTimerExecutor());
list.add(server.getBusinessExecutor());
list.add(server.getBackendBusinessExecutor());
list.add(server.getComplexQueryExecutor());
// }
return list;
}
Aggregations