動態跟蹤的JavaScript:jstrace

jopen 10年前發布 | 17K 次閱讀 jstrace 程序調試

動態跟蹤的JavaScript,采用JavaScript開發。類似于dtrace, ktap等。為您提供深入了解你實時的NodeJS應用,在進程、機器或群集層面。動態跟蹤的目標是提供一組豐富的調試信息,能夠在生產中,幫助發現問題的根源。

特性:

  • dynamic tracing :)
  • local / remote execution support
  • minimal overhead when idle
  • flexible scripting capabilities
  • probe name filtering
  • pid, process title, and hostname filtering
  • remote messaging for map/reduce style reporting
  • multi-process support, inspect your cluster in realtime
  • binds to 0.0.0.0:4322 (may need this for firewalls)
  • </ul>

    var trace = require('jstrace');
    var http = require('http');
    
    var ids = 0;
    
    var server = http.createServer(function(req, res){
      var id = ++ids;
    
      trace('request:start', { id: id });
      setTimeout(function(){
    
        res.end('hello world');
        trace('request:end', { id: id });
      }, Math.random() * 250 | 0);
    });
    
    server.listen(3000);

    項目主頁:http://www.baiduhome.net/lib/view/home/1401074026589

 本文由用戶 jopen 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
 轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
 本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!