use of io.datarouter.web.browse.dto.DatarouterWebRequestParamsFactory.DatarouterWebRequestParams in project datarouter by hotpads.
the class MysqlWebInspector method getC3P0Stats.
private ContainerTag<?> getC3P0Stats(ClientId clientId, DatarouterWebRequestParams<MysqlClientType> clientParams) {
MysqlClientManager clientManager = injector.getInstance(clientParams.getClientType().getClientManagerClass());
Optional<C3p0StatsDto> c3p0Stats = c3p0StatsService.getC3p0Stats().stream().filter(stats -> stats.clientName.equals(clientId.getName())).findAny();
var totalConnections = c3p0Stats.map(stats -> stats.total).map(stats -> stats + "").orElse("");
var busyConnections = c3p0Stats.map(stats -> stats.busy).map(stats -> stats + "").orElse("");
return dl(dt("handles:"), dd(clientManager.getStats(clientId)), dt("total connection:"), dd(totalConnections), dt("busy connection:"), dd(busyConnections));
}
Aggregations