【发布时间】:2014-04-11 16:17:51
【问题描述】:
我正在我的 restify.js 应用程序中跟踪 DTrace 探测(重新确定它是 node.js 中提供 dtrace 支持的 http 服务器)。我正在使用来自 restify 文档的示例 dtrace 脚本:
#!/usr/sbin/dtrace -s
#pragma D option quiet
restify*:::route-start
{
track[arg2] = timestamp;
}
restify*:::handler-start
/track[arg3]/
{
h[arg3, copyinstr(arg2)] = timestamp;
}
restify*:::handler-done
/track[arg3] && h[arg3, copyinstr(arg2)]/
{
@[copyinstr(arg2)] = quantize((timestamp - h[arg3, copyinstr(arg2)]) / 1000000);
h[arg3, copyinstr(arg2)] = 0;
}
restify*:::route-done
/track[arg2]/
{
@[copyinstr(arg1)] = quantize((timestamp - track[arg2]) / 1000000);
track[arg2] = 0;
}
输出是:
use_restifyRequestLogger
value ------------- Distribution ------------- count
-1 | 0
0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
1 | 0
use_validate
value ------------- Distribution ------------- count
-1 | 0
0 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
1 | 0
pre
value ------------- Distribution ------------- count
0 | 0
1 |@@@@@@@@@@@@@@@@@@@@ 1
2 |@@@@@@@@@@@@@@@@@@@@ 1
4 | 0
handler
value ------------- Distribution ------------- count
128 | 0
256 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
512 | 0
route_user_read
value ------------- Distribution ------------- count
128 | 0
256 |@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 2
512 | 0
我想知道value 值字段是什么——它是什么意思?
例如为什么有 124/256/512?我想这意味着时间/持续时间,但它的格式很奇怪-例如可以显示miliseconds吗?
【问题讨论】: