Search in sources :

Example 1 with DatarouterWebRequestParams

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));
}
Also used : DatarouterWebRequestParamsFactory(io.datarouter.web.browse.dto.DatarouterWebRequestParamsFactory) TagCreator.dd(j2html.TagCreator.dd) ClientOptions(io.datarouter.storage.client.ClientOptions) TagCreator.dl(j2html.TagCreator.dl) Inject(javax.inject.Inject) HttpServletRequest(javax.servlet.http.HttpServletRequest) MessageMav(io.datarouter.web.handler.mav.imp.MessageMav) DatarouterWebRequireJsV2(io.datarouter.web.requirejs.DatarouterWebRequireJsV2) MysqlClientManager(io.datarouter.client.mysql.MysqlClientManager) DatarouterWebRequestParams(io.datarouter.web.browse.dto.DatarouterWebRequestParamsFactory.DatarouterWebRequestParams) TagCreator.dt(j2html.TagCreator.dt) Map(java.util.Map) ClientId(io.datarouter.storage.client.ClientId) Params(io.datarouter.web.handler.params.Params) DatarouterInjector(io.datarouter.inject.DatarouterInjector) DatarouterClientWebInspector(io.datarouter.web.browse.DatarouterClientWebInspector) MysqlClientType(io.datarouter.client.mysql.MysqlClientType) ClientOptionsBuilder(io.datarouter.storage.client.ClientOptionsBuilder) Mav(io.datarouter.web.handler.mav.Mav) ContainerTag(j2html.tags.ContainerTag) Optional(java.util.Optional) Bootstrap4PageFactory(io.datarouter.web.html.j2html.bootstrap4.Bootstrap4PageFactory) TagCreator.div(j2html.TagCreator.div) C3p0StatsDto(io.datarouter.client.mysql.connection.C3p0StatsDto) C3p0StatsService(io.datarouter.client.mysql.connection.C3p0StatsService) MysqlClientManager(io.datarouter.client.mysql.MysqlClientManager) C3p0StatsDto(io.datarouter.client.mysql.connection.C3p0StatsDto)

Aggregations

MysqlClientManager (io.datarouter.client.mysql.MysqlClientManager)1 MysqlClientType (io.datarouter.client.mysql.MysqlClientType)1 C3p0StatsDto (io.datarouter.client.mysql.connection.C3p0StatsDto)1 C3p0StatsService (io.datarouter.client.mysql.connection.C3p0StatsService)1 DatarouterInjector (io.datarouter.inject.DatarouterInjector)1 ClientId (io.datarouter.storage.client.ClientId)1 ClientOptions (io.datarouter.storage.client.ClientOptions)1 ClientOptionsBuilder (io.datarouter.storage.client.ClientOptionsBuilder)1 DatarouterClientWebInspector (io.datarouter.web.browse.DatarouterClientWebInspector)1 DatarouterWebRequestParamsFactory (io.datarouter.web.browse.dto.DatarouterWebRequestParamsFactory)1 DatarouterWebRequestParams (io.datarouter.web.browse.dto.DatarouterWebRequestParamsFactory.DatarouterWebRequestParams)1 Mav (io.datarouter.web.handler.mav.Mav)1 MessageMav (io.datarouter.web.handler.mav.imp.MessageMav)1 Params (io.datarouter.web.handler.params.Params)1 Bootstrap4PageFactory (io.datarouter.web.html.j2html.bootstrap4.Bootstrap4PageFactory)1 DatarouterWebRequireJsV2 (io.datarouter.web.requirejs.DatarouterWebRequireJsV2)1 TagCreator.dd (j2html.TagCreator.dd)1 TagCreator.div (j2html.TagCreator.div)1 TagCreator.dl (j2html.TagCreator.dl)1 TagCreator.dt (j2html.TagCreator.dt)1