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

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

本文整理了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

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

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

  1. /**
  2. * 对批量Invocation对应的InvocationStat进行一个快照
  3. *
  4. * @param stats Dimensions of invocation statistics
  5. * @return List<InvocationStat>
  6. */
  7. public static List<InvocationStat> getInvocationStatSnapshots(List<InvocationStat> stats) {
  8. List<InvocationStat> snapshots = new ArrayList<InvocationStat>(stats.size());
  9. for (InvocationStat stat : stats) {
  10. InvocationStat snapshot = stat.snapshot();
  11. if (snapshot.getInvokeCount() <= 0) {
  12. if (stat.getUselessCycle().incrementAndGet() > 6) {
  13. // 6 个时间窗口无调用,删除统计
  14. InvocationStatFactory.removeInvocationStat(stat);
  15. InvocationStatDimension dimension = stat.getDimension();
  16. String appName = dimension.getAppName();
  17. if (LOGGER.isDebugEnabled(appName)) {
  18. LOGGER.debugWithApp(appName, "Remove invocation stat : {}, {} because of useless cycle > 6",
  19. dimension.getDimensionKey(), dimension.getProviderInfo());
  20. }
  21. }
  22. } else {
  23. stat.getUselessCycle().set(0);
  24. snapshots.add(snapshot);
  25. }
  26. }
  27. return snapshots;
  28. }

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

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

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

  1. /**
  2. * 对批量Invocation对应的InvocationStat进行一个快照
  3. *
  4. * @param stats Dimensions of invocation statistics
  5. * @return List<InvocationStat>
  6. */
  7. public static List<InvocationStat> getInvocationStatSnapshots(List<InvocationStat> stats) {
  8. List<InvocationStat> snapshots = new ArrayList<InvocationStat>(stats.size());
  9. for (InvocationStat stat : stats) {
  10. InvocationStat snapshot = stat.snapshot();
  11. if (snapshot.getInvokeCount() <= 0) {
  12. if (stat.getUselessCycle().incrementAndGet() > 6) {
  13. // 6 个时间窗口无调用,删除统计
  14. InvocationStatFactory.removeInvocationStat(stat);
  15. InvocationStatDimension dimension = stat.getDimension();
  16. String appName = dimension.getAppName();
  17. if (LOGGER.isDebugEnabled(appName)) {
  18. LOGGER.debugWithApp(appName, "Remove invocation stat : {}, {} because of useless cycle > 6",
  19. dimension.getDimensionKey(), dimension.getProviderInfo());
  20. }
  21. }
  22. } else {
  23. stat.getUselessCycle().set(0);
  24. snapshots.add(snapshot);
  25. }
  26. }
  27. return snapshots;
  28. }

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

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

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

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

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

  1. protected void initClientTransport(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
  2. try {
  3. transport.connect();
  4. if (doubleCheck(interfaceId, providerInfo, transport)) {
  5. printSuccess(interfaceId, providerInfo, transport);
  6. addAlive(providerInfo, transport);
  7. } else {
  8. printFailure(interfaceId, providerInfo, transport);
  9. addRetry(providerInfo, transport);
  10. }
  11. } catch (Exception e) {
  12. if (LOGGER.isDebugEnabled(consumerConfig.getAppName())) {
  13. LOGGER.debugWithApp(consumerConfig.getAppName(), "Failed to connect " + providerInfo, e);
  14. }
  15. printDead(interfaceId, providerInfo, transport, e);
  16. addRetry(providerInfo, transport);
  17. }
  18. }

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

  1. protected void initClientTransport(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
  2. try {
  3. transport.connect();
  4. if (doubleCheck(interfaceId, providerInfo, transport)) {
  5. printSuccess(interfaceId, providerInfo, transport);
  6. addAlive(providerInfo, transport);
  7. } else {
  8. printFailure(interfaceId, providerInfo, transport);
  9. addRetry(providerInfo, transport);
  10. }
  11. } catch (Exception e) {
  12. if (LOGGER.isDebugEnabled(consumerConfig.getAppName())) {
  13. LOGGER.debugWithApp(consumerConfig.getAppName(), "Failed to connect " + providerInfo, e);
  14. }
  15. printDead(interfaceId, providerInfo, transport, e);
  16. addRetry(providerInfo, transport);
  17. }
  18. }

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

  1. @Override
  2. public void childEvent(CuratorFramework client1, PathChildrenCacheEvent event) throws Exception {
  3. if (LOGGER.isDebugEnabled(config.getAppName())) {
  4. LOGGER.debugWithApp(config.getAppName(),
  5. "Receive zookeeper event: " + "type=[" + event.getType() + "]");
  6. }
  7. switch (event.getType()) {
  8. case CHILD_ADDED: //加了一个provider
  9. providerObserver.addProvider(config, providerPath, event.getData(),
  10. finalPathChildrenCache.getCurrentData());
  11. break;
  12. case CHILD_REMOVED: //删了一个provider
  13. providerObserver.removeProvider(config, providerPath, event.getData(),
  14. finalPathChildrenCache.getCurrentData());
  15. break;
  16. case CHILD_UPDATED: // 更新一个Provider
  17. providerObserver.updateProvider(config, providerPath, event.getData(),
  18. finalPathChildrenCache.getCurrentData());
  19. break;
  20. default:
  21. break;
  22. }
  23. }
  24. });

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

  1. @Override
  2. public void childEvent(CuratorFramework client1, PathChildrenCacheEvent event) throws Exception {
  3. if (LOGGER.isDebugEnabled(config.getAppName())) {
  4. LOGGER.debugWithApp(config.getAppName(),
  5. "Receive zookeeper event: " + "type=[" + event.getType() + "]");
  6. }
  7. switch (event.getType()) {
  8. case CHILD_ADDED: //加了一个provider
  9. providerObserver.addProvider(config, providerPath, event.getData(),
  10. finalPathChildrenCache.getCurrentData());
  11. break;
  12. case CHILD_REMOVED: //删了一个provider
  13. providerObserver.removeProvider(config, providerPath, event.getData(),
  14. finalPathChildrenCache.getCurrentData());
  15. break;
  16. case CHILD_UPDATED: // 更新一个Provider
  17. providerObserver.updateProvider(config, providerPath, event.getData(),
  18. finalPathChildrenCache.getCurrentData());
  19. break;
  20. default:
  21. break;
  22. }
  23. }
  24. });

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

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

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

  1. /**
  2. * 对批量Invocation对应的InvocationStat进行一个快照
  3. *
  4. * @param stats Dimensions of invocation statistics
  5. * @return List<InvocationStat>
  6. */
  7. public static List<InvocationStat> getInvocationStatSnapshots(List<InvocationStat> stats) {
  8. List<InvocationStat> snapshots = new ArrayList<InvocationStat>(stats.size());
  9. for (InvocationStat stat : stats) {
  10. InvocationStat snapshot = stat.snapshot();
  11. if (snapshot.getInvokeCount() <= 0) {
  12. if (stat.getUselessCycle().incrementAndGet() > 6) {
  13. // 6 个时间窗口无调用,删除统计
  14. InvocationStatFactory.removeInvocationStat(stat);
  15. InvocationStatDimension dimension = stat.getDimension();
  16. String appName = dimension.getAppName();
  17. if (LOGGER.isDebugEnabled(appName)) {
  18. LOGGER.debugWithApp(appName, "Remove invocation stat : {}, {} because of useless cycle > 6",
  19. dimension.getDimensionKey(), dimension.getProviderInfo());
  20. }
  21. }
  22. } else {
  23. stat.getUselessCycle().set(0);
  24. snapshots.add(snapshot);
  25. }
  26. }
  27. return snapshots;
  28. }

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

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

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

  1. protected void initClientTransport(String interfaceId, ProviderInfo providerInfo, ClientTransport transport) {
  2. try {
  3. transport.connect();
  4. if (doubleCheck(interfaceId, providerInfo, transport)) {
  5. printSuccess(interfaceId, providerInfo, transport);
  6. addAlive(providerInfo, transport);
  7. } else {
  8. printFailure(interfaceId, providerInfo, transport);
  9. addRetry(providerInfo, transport);
  10. }
  11. } catch (Exception e) {
  12. if (LOGGER.isDebugEnabled(consumerConfig.getAppName())) {
  13. LOGGER.debugWithApp(consumerConfig.getAppName(), "Failed to connect " + providerInfo, e);
  14. }
  15. printDead(interfaceId, providerInfo, transport, e);
  16. addRetry(providerInfo, transport);
  17. }
  18. }

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

  1. @Override
  2. public void childEvent(CuratorFramework client1, PathChildrenCacheEvent event) throws Exception {
  3. if (LOGGER.isDebugEnabled(config.getAppName())) {
  4. LOGGER.debugWithApp(config.getAppName(),
  5. "Receive zookeeper event: " + "type=[" + event.getType() + "]");
  6. }
  7. switch (event.getType()) {
  8. case CHILD_ADDED: //加了一个provider
  9. providerObserver.addProvider(config, providerPath, event.getData(),
  10. finalPathChildrenCache.getCurrentData());
  11. break;
  12. case CHILD_REMOVED: //删了一个provider
  13. providerObserver.removeProvider(config, providerPath, event.getData(),
  14. finalPathChildrenCache.getCurrentData());
  15. break;
  16. case CHILD_UPDATED: // 更新一个Provider
  17. providerObserver.updateProvider(config, providerPath, event.getData(),
  18. finalPathChildrenCache.getCurrentData());
  19. break;
  20. default:
  21. break;
  22. }
  23. }
  24. });

相关文章