com.alipay.sofa.rpc.log.Logger.debugWithApp()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(8.3k)|赞(0)|评价(0)|浏览(255)

本文整理了Java中com.alipay.sofa.rpc.log.Logger.debugWithApp()方法的一些代码示例,展示了Logger.debugWithApp()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.debugWithApp()方法的具体详情如下:
包路径:com.alipay.sofa.rpc.log.Logger
类名称:Logger
方法名:debugWithApp

Logger.debugWithApp介绍

[英]Debug with app.
[中]使用应用程序调试。

代码示例

代码示例来源:origin: alipay/sofa-rpc

LOGGER.debugWithApp(appName, info.toString());

代码示例来源:origin: alipay/sofa-rpc

/**
 * 对批量Invocation对应的InvocationStat进行一个快照
 *
 * @param stats Dimensions of invocation statistics
 * @return List<InvocationStat>
 */
public static List<InvocationStat> getInvocationStatSnapshots(List<InvocationStat> stats) {
  List<InvocationStat> snapshots = new ArrayList<InvocationStat>(stats.size());
  for (InvocationStat stat : stats) {
    InvocationStat snapshot = stat.snapshot();
    if (snapshot.getInvokeCount() <= 0) {
      if (stat.getUselessCycle().incrementAndGet() > 6) {
        // 6 个时间窗口无调用,删除统计
        InvocationStatFactory.removeInvocationStat(stat);
        InvocationStatDimension dimension = stat.getDimension();
        String appName = dimension.getAppName();
        if (LOGGER.isDebugEnabled(appName)) {
          LOGGER.debugWithApp(appName, "Remove invocation stat : {}, {} because of useless cycle > 6",
            dimension.getDimensionKey(), dimension.getProviderInfo());
        }
      }
    } else {
      stat.getUselessCycle().set(0);
      snapshots.add(snapshot);
    }
  }
  return snapshots;
}

代码示例来源:origin: alipay/sofa-rpc

LOGGER.debugWithApp(appName, info.toString());

代码示例来源:origin: alipay/sofa-rpc

/**
 * 对批量Invocation对应的InvocationStat进行一个快照
 *
 * @param stats Dimensions of invocation statistics
 * @return List<InvocationStat>
 */
public static List<InvocationStat> getInvocationStatSnapshots(List<InvocationStat> stats) {
  List<InvocationStat> snapshots = new ArrayList<InvocationStat>(stats.size());
  for (InvocationStat stat : stats) {
    InvocationStat snapshot = stat.snapshot();
    if (snapshot.getInvokeCount() <= 0) {
      if (stat.getUselessCycle().incrementAndGet() > 6) {
        // 6 个时间窗口无调用,删除统计
        InvocationStatFactory.removeInvocationStat(stat);
        InvocationStatDimension dimension = stat.getDimension();
        String appName = dimension.getAppName();
        if (LOGGER.isDebugEnabled(appName)) {
          LOGGER.debugWithApp(appName, "Remove invocation stat : {}, {} because of useless cycle > 6",
            dimension.getDimensionKey(), dimension.getProviderInfo());
        }
      }
    } else {
      stat.getUselessCycle().set(0);
      snapshots.add(snapshot);
    }
  }
  return snapshots;
}

代码示例来源:origin: alipay/sofa-rpc

LOGGER.debugWithApp(appName, "Retry connect to {} provider:{} ...", interfaceId, providerInfo);
    LOGGER.debugWithApp(appName, "Retry connect to {} provider:{} error ! The exception is " + e
      .getMessage(), interfaceId, providerInfo);

代码示例来源:origin: alipay/sofa-rpc

LOGGER.debugWithApp(appName, "Retry connect to {} provider:{} ...", interfaceId, providerInfo);
    LOGGER.debugWithApp(appName, "Retry connect to {} provider:{} error ! The exception is " + e
      .getMessage(), interfaceId, providerInfo);

代码示例来源:origin: alipay/sofa-rpc

protected void initClientTransport(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
  try {
    transport.connect();
    if (doubleCheck(interfaceId, providerInfo, transport)) {
      printSuccess(interfaceId, providerInfo, transport);
      addAlive(providerInfo, transport);
    } else {
      printFailure(interfaceId, providerInfo, transport);
      addRetry(providerInfo, transport);
    }
  } catch (Exception e) {
    if (LOGGER.isDebugEnabled(consumerConfig.getAppName())) {
      LOGGER.debugWithApp(consumerConfig.getAppName(), "Failed to connect " + providerInfo, e);
    }
    printDead(interfaceId, providerInfo, transport, e);
    addRetry(providerInfo, transport);
  }
}

代码示例来源:origin: alipay/sofa-rpc

protected void initClientTransport(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
  try {
    transport.connect();
    if (doubleCheck(interfaceId, providerInfo, transport)) {
      printSuccess(interfaceId, providerInfo, transport);
      addAlive(providerInfo, transport);
    } else {
      printFailure(interfaceId, providerInfo, transport);
      addRetry(providerInfo, transport);
    }
  } catch (Exception e) {
    if (LOGGER.isDebugEnabled(consumerConfig.getAppName())) {
      LOGGER.debugWithApp(consumerConfig.getAppName(), "Failed to connect " + providerInfo, e);
    }
    printDead(interfaceId, providerInfo, transport, e);
    addRetry(providerInfo, transport);
  }
}

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void childEvent(CuratorFramework client1, PathChildrenCacheEvent event) throws Exception {
    if (LOGGER.isDebugEnabled(config.getAppName())) {
      LOGGER.debugWithApp(config.getAppName(),
        "Receive zookeeper event: " + "type=[" + event.getType() + "]");
    }
    switch (event.getType()) {
      case CHILD_ADDED: //加了一个provider
        providerObserver.addProvider(config, providerPath, event.getData(),
          finalPathChildrenCache.getCurrentData());
        break;
      case CHILD_REMOVED: //删了一个provider
        providerObserver.removeProvider(config, providerPath, event.getData(),
          finalPathChildrenCache.getCurrentData());
        break;
      case CHILD_UPDATED: // 更新一个Provider
        providerObserver.updateProvider(config, providerPath, event.getData(),
          finalPathChildrenCache.getCurrentData());
        break;
      default:
        break;
    }
  }
});

代码示例来源:origin: alipay/sofa-rpc

@Override
  public void childEvent(CuratorFramework client1, PathChildrenCacheEvent event) throws Exception {
    if (LOGGER.isDebugEnabled(config.getAppName())) {
      LOGGER.debugWithApp(config.getAppName(),
        "Receive zookeeper event: " + "type=[" + event.getType() + "]");
    }
    switch (event.getType()) {
      case CHILD_ADDED: //加了一个provider
        providerObserver.addProvider(config, providerPath, event.getData(),
          finalPathChildrenCache.getCurrentData());
        break;
      case CHILD_REMOVED: //删了一个provider
        providerObserver.removeProvider(config, providerPath, event.getData(),
          finalPathChildrenCache.getCurrentData());
        break;
      case CHILD_UPDATED: // 更新一个Provider
        providerObserver.updateProvider(config, providerPath, event.getData(),
          finalPathChildrenCache.getCurrentData());
        break;
      default:
        break;
    }
  }
});

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

LOGGER.debugWithApp(appName, info.toString());

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

/**
 * 对批量Invocation对应的InvocationStat进行一个快照
 *
 * @param stats Dimensions of invocation statistics
 * @return List<InvocationStat>
 */
public static List<InvocationStat> getInvocationStatSnapshots(List<InvocationStat> stats) {
  List<InvocationStat> snapshots = new ArrayList<InvocationStat>(stats.size());
  for (InvocationStat stat : stats) {
    InvocationStat snapshot = stat.snapshot();
    if (snapshot.getInvokeCount() <= 0) {
      if (stat.getUselessCycle().incrementAndGet() > 6) {
        // 6 个时间窗口无调用,删除统计
        InvocationStatFactory.removeInvocationStat(stat);
        InvocationStatDimension dimension = stat.getDimension();
        String appName = dimension.getAppName();
        if (LOGGER.isDebugEnabled(appName)) {
          LOGGER.debugWithApp(appName, "Remove invocation stat : {}, {} because of useless cycle > 6",
            dimension.getDimensionKey(), dimension.getProviderInfo());
        }
      }
    } else {
      stat.getUselessCycle().set(0);
      snapshots.add(snapshot);
    }
  }
  return snapshots;
}

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

LOGGER.debugWithApp(appName, "Retry connect to {} provider:{} ...", interfaceId, providerInfo);
    LOGGER.debugWithApp(appName, "Retry connect to {} provider:{} error ! The exception is " + e
      .getMessage(), interfaceId, providerInfo);

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

protected void initClientTransport(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
  try {
    transport.connect();
    if (doubleCheck(interfaceId, providerInfo, transport)) {
      printSuccess(interfaceId, providerInfo, transport);
      addAlive(providerInfo, transport);
    } else {
      printFailure(interfaceId, providerInfo, transport);
      addRetry(providerInfo, transport);
    }
  } catch (Exception e) {
    if (LOGGER.isDebugEnabled(consumerConfig.getAppName())) {
      LOGGER.debugWithApp(consumerConfig.getAppName(), "Failed to connect " + providerInfo, e);
    }
    printDead(interfaceId, providerInfo, transport, e);
    addRetry(providerInfo, transport);
  }
}

代码示例来源:origin: com.alipay.sofa/sofa-rpc-all

@Override
  public void childEvent(CuratorFramework client1, PathChildrenCacheEvent event) throws Exception {
    if (LOGGER.isDebugEnabled(config.getAppName())) {
      LOGGER.debugWithApp(config.getAppName(),
        "Receive zookeeper event: " + "type=[" + event.getType() + "]");
    }
    switch (event.getType()) {
      case CHILD_ADDED: //加了一个provider
        providerObserver.addProvider(config, providerPath, event.getData(),
          finalPathChildrenCache.getCurrentData());
        break;
      case CHILD_REMOVED: //删了一个provider
        providerObserver.removeProvider(config, providerPath, event.getData(),
          finalPathChildrenCache.getCurrentData());
        break;
      case CHILD_UPDATED: // 更新一个Provider
        providerObserver.updateProvider(config, providerPath, event.getData(),
          finalPathChildrenCache.getCurrentData());
        break;
      default:
        break;
    }
  }
});

相关文章