Search in sources :

Example 1 with MixinMetric

use of com.alipay.lookout.api.composite.MixinMetric in project sofa-rpc by sofastack.

the class RpcLookout method collectServer.

/**
 * Collect the RPC server information.
 *
 * @param rpcServerMetricsModel server information model
 */
public void collectServer(RpcServerLookoutModel rpcServerMetricsModel) {
    try {
        Id methodProviderId = createMethodProviderId(rpcServerMetricsModel);
        MixinMetric methodProviderMetric = Lookout.registry().mixinMetric(methodProviderId);
        recordCounterAndTimer(methodProviderMetric, rpcServerMetricsModel);
    } catch (Throwable t) {
        LOGGER.error(LogCodes.getLog(LogCodes.ERROR_METRIC_REPORT_ERROR), t);
    }
}
Also used : MixinMetric(com.alipay.lookout.api.composite.MixinMetric) Id(com.alipay.lookout.api.Id)

Example 2 with MixinMetric

use of com.alipay.lookout.api.composite.MixinMetric in project sofa-rpc by sofastack.

the class RpcLookout method collectClient.

/**
 * Collect the RPC client information.
 *
 * @param rpcClientMetricsModel client information model
 */
public void collectClient(RpcClientLookoutModel rpcClientMetricsModel) {
    try {
        Id methodConsumerId = createMethodConsumerId(rpcClientMetricsModel);
        MixinMetric methodConsumerMetric = Lookout.registry().mixinMetric(methodConsumerId);
        recordCounterAndTimer(methodConsumerMetric, rpcClientMetricsModel);
        recordSize(methodConsumerMetric, rpcClientMetricsModel);
    } catch (Throwable t) {
        LOGGER.error(LogCodes.getLog(LogCodes.ERROR_METRIC_REPORT_ERROR), t);
    }
}
Also used : MixinMetric(com.alipay.lookout.api.composite.MixinMetric) Id(com.alipay.lookout.api.Id)

Aggregations

Id (com.alipay.lookout.api.Id)2 MixinMetric (com.alipay.lookout.api.composite.MixinMetric)2