Search in sources :

Example 1 with DbusHttpTotalStats

use of com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats in project databus by linkedin.

the class RelayStatsRequestProcessor method processOutboundHttpTotalStats.

private void processOutboundHttpTotalStats(DatabusRequest request) throws IOException {
    DbusHttpTotalStats totalStats = _relay.getHttpStatisticsCollector().getTotalStats();
    if (null == totalStats)
        return;
    writeJsonObjectToResponse(totalStats, request);
    if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST) {
        enableOrResetStatsMBean(totalStats, request);
    }
}
Also used : DbusHttpTotalStats(com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats)

Example 2 with DbusHttpTotalStats

use of com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats in project databus by linkedin.

the class ClientStatsRequestProcessor method processOutboundHttpClientStats.

private void processOutboundHttpClientStats(DatabusRequest request) throws IOException, RequestProcessingException {
    String category = request.getParams().getProperty(DatabusRequest.PATH_PARAM_NAME);
    String client = category.substring(INBOUND_HTTP_RELAYS_PREFIX.length());
    DbusHttpTotalStats clientStats = _client.getHttpStatsCollector().getPeerStats(client);
    if (null == clientStats) {
        throw new InvalidRequestParamValueException(request.getName(), INBOUND_HTTP_RELAYS_PREFIX, client);
    }
    writeJsonObjectToResponse(clientStats, request);
    if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST) {
        enableOrResetStatsMBean(clientStats, request);
    }
}
Also used : DbusHttpTotalStats(com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats) InvalidRequestParamValueException(com.linkedin.databus2.core.container.request.InvalidRequestParamValueException)

Example 3 with DbusHttpTotalStats

use of com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats in project databus by linkedin.

the class HttpStatisticsCollector method registerRegisterCall.

@Override
public void registerRegisterCall(List<RegisterResponseEntry> sources) {
    if (!_enabled.get())
        return;
    _totalStats.registerRegisterCall(_curPeer);
    for (RegisterResponseEntry respEntry : sources) {
        DbusHttpTotalStats perSourceCollector = getOrAddPerSourceCollector((int) respEntry.getId(), null);
        perSourceCollector.registerRegisterCall(_curPeer);
    }
    if (NO_PEER != _curPeer) {
        DbusHttpTotalStats clientStats = getOrAddPerPeerCollector(_curPeer, null);
        clientStats.registerRegisterCall(_curPeer);
    }
}
Also used : RegisterResponseEntry(com.linkedin.databus2.core.container.request.RegisterResponseEntry)

Example 4 with DbusHttpTotalStats

use of com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats in project databus by linkedin.

the class RelayStatsRequestProcessor method processOutboundHttpSourceStats.

private void processOutboundHttpSourceStats(DatabusRequest request) throws IOException, RequestProcessingException {
    String category = request.getParams().getProperty(DatabusRequest.PATH_PARAM_NAME);
    String sourceIdStr = category.substring(OUTBOUND_HTTP_SOURCE_PREFIX.length());
    int sourceId = -1;
    try {
        sourceId = Integer.valueOf(sourceIdStr);
    } catch (NumberFormatException nfe) {
        throw new InvalidRequestParamValueException(request.getName(), OUTBOUND_HTTP_SOURCE_PREFIX, sourceIdStr);
    }
    DbusHttpTotalStats sourceStats = _relay.getHttpStatisticsCollector().getSourceStats(sourceId);
    if (null == sourceStats) {
        throw new InvalidRequestParamValueException(request.getName(), OUTBOUND_HTTP_SOURCE_PREFIX, sourceIdStr);
    }
    writeJsonObjectToResponse(sourceStats, request);
    if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST) {
        enableOrResetStatsMBean(sourceStats, request);
    }
}
Also used : DbusHttpTotalStats(com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats) InvalidRequestParamValueException(com.linkedin.databus2.core.container.request.InvalidRequestParamValueException)

Example 5 with DbusHttpTotalStats

use of com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats in project databus by linkedin.

the class RelayStatsRequestProcessor method processOutboundHttpClientStats.

private void processOutboundHttpClientStats(DatabusRequest request) throws IOException, RequestProcessingException {
    String category = request.getParams().getProperty(DatabusRequest.PATH_PARAM_NAME);
    String client = category.substring(OUTBOUND_HTTP_CLIENT_PREFIX.length());
    DbusHttpTotalStats clientStats = _relay.getHttpStatisticsCollector().getPeerStats(client);
    if (null == clientStats) {
        throw new InvalidRequestParamValueException(request.getName(), OUTBOUND_HTTP_CLIENT_PREFIX, client);
    }
    writeJsonObjectToResponse(clientStats, request);
    if (request.getRequestType() == HttpMethod.PUT || request.getRequestType() == HttpMethod.POST) {
        enableOrResetStatsMBean(clientStats, request);
    }
}
Also used : DbusHttpTotalStats(com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats) InvalidRequestParamValueException(com.linkedin.databus2.core.container.request.InvalidRequestParamValueException)

Aggregations

DbusHttpTotalStats (com.linkedin.databus2.core.container.monitoring.mbean.DbusHttpTotalStats)6 InvalidRequestParamValueException (com.linkedin.databus2.core.container.request.InvalidRequestParamValueException)4 RegisterResponseEntry (com.linkedin.databus2.core.container.request.RegisterResponseEntry)1