简体   繁体   English

新的遗物-使用多个线程对象检测应用

[英]new relic - instrumenting an app with multiple threaded objects

I have a reasonably simple Java app that reads from AWS/SQS and parses the data out using several thread groups. 我有一个相当简单的Java应用程序,它从AWS / SQS读取并使用多个线程组解析出数据。

Threads: 线程数:

  • read from SQS 从SQS读取
  • collect the output from above threads into 'blocks' by time + other keys 按时间和其他键将上述线程的输出收集到“块”中
  • once 'blocks' are at time send these to threads for writing elsewhere 一旦“块”被及时发送到线程以在其他地方写入
  • clean up 清理

I'd like to use NewRelic to see what's happening inside these thread groups but if I put the @Trace(dispatcher=true) on more than one of the run() functions it stops reading any of them. 我想使用NewRelic来查看这些线程组中发生了什么,但是如果我将@Trace(dispatcher=true)放在多个run()函数上,它将停止读取其中的任何一个。 Instead of seeing traces for all of my functions in each thread I'm not seeing much of anything. 我没有看到每个线程中所有函数的痕迹,而是什么也没看到。

Question: 题:

  • how would I gather metrics from an app like this? 我如何从这样的应用程序收集指标? Or is it even possible? 甚至有可能吗?

FWIW - NewRelic transaction traces won't be reported for run() functions if they never exit. FWIW-如果Run()函数永不退出,则不会报告NewRelic事务跟踪。

EG: 例如:

public void run() {
   while(true) {
      // do some tasks
   }
}

What you can do is put @Trace statements on anything that gets called from the run() loop. 可以做的是将@Trace语句放在从run()循环调用的任何内容上。 If these functions exit then traces will get reported back to NR. 如果这些功能退出,则跟踪​​将报告回NR。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM