Search in sources :

Example 11 with Id

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

the class RpcLookout method collectProvderPubInfo.

/**
 * Collect the RPC client information.
 *
 * @param providerConfig client information model
 */
public void collectProvderPubInfo(final ProviderConfig providerConfig) {
    try {
        Id providerConfigId = rpcLookoutId.fetchProviderPubId();
        Lookout.registry().info(providerConfigId, new Info<ProviderConfig>() {

            @Override
            public ProviderConfig value() {
                return providerConfig;
            }
        });
    } catch (Throwable t) {
        LOGGER.error(LogCodes.getLog(LogCodes.ERROR_METRIC_REPORT_ERROR), t);
    }
}
Also used : ProviderConfig(com.alipay.sofa.rpc.config.ProviderConfig) Id(com.alipay.lookout.api.Id)

Example 12 with Id

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

the class RpcLookoutId method fetchServerConfigId.

private Id fetchServerConfigId(String key) {
    Id lookoutId = serverConfigIds.get(key);
    if (lookoutId == null) {
        synchronized (RpcLookout.class) {
            lookoutId = serverConfigIds.get(key);
            if (lookoutId == null) {
                lookoutId = Lookout.registry().createId(key);
                serverConfigIds.put(key, lookoutId);
            }
        }
    }
    return lookoutId;
}
Also used : Id(com.alipay.lookout.api.Id)

Aggregations

Id (com.alipay.lookout.api.Id)12 Metric (com.alipay.lookout.api.Metric)5 NoopRegistry (com.alipay.lookout.api.NoopRegistry)5 Registry (com.alipay.lookout.api.Registry)5 DefaultRegistry (com.alipay.lookout.core.DefaultRegistry)5 MixinMetric (com.alipay.lookout.api.composite.MixinMetric)2 After (org.junit.After)2 BeforeClass (org.junit.BeforeClass)2 ApplicationConfig (com.alipay.sofa.rpc.config.ApplicationConfig)1 ConsumerConfig (com.alipay.sofa.rpc.config.ConsumerConfig)1 MethodConfig (com.alipay.sofa.rpc.config.MethodConfig)1 ProviderConfig (com.alipay.sofa.rpc.config.ProviderConfig)1 ServerConfig (com.alipay.sofa.rpc.config.ServerConfig)1 SofaRpcException (com.alipay.sofa.rpc.core.exception.SofaRpcException)1 ArrayList (java.util.ArrayList)1 AfterClass (org.junit.AfterClass)1 Before (org.junit.Before)1