Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
GC log parser for Node.js
JavaScript
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
Makefile
README.md
index.js
package.json

README.md

Build Status

About

node (0.8.0) trace_gc_nvp 输出格式解释(从源码和gc-nvp-processor.py推测而来):

    44 ms: pause=1 mutator=0 gc=s external=0 mark=0 sweep=0 sweepns=0 evacuate=0 new_new=0 root_new=0 old_new=0 compaction_ptrs=0 intracompaction_ptrs=0 misc_compaction=0 total_size_before=2701528 total_size_after=2384568 holes_size_before=0 holes_size_after=384 allocated=2701528 promoted=456976 stepscount=0 stepstook=0
  • 日志采用 相对时间(ms) + key=value [...] 的方式组织输出;其中相对时间一般是gc实际发生的时间减去进程启动的时间所得的差,单位为毫秒(ms);
  • GC细节描述:

    • pause: 本次GC所造成的服务停顿时间,毫秒;
    • mutator:
    • gc: GC策略;s是指Scavenge,ms指Mark-Sweep;
    • external:
    • mark:
    • sweep:
    • sweepns:

Install

$ npm install gc-parser

Usage

  • Run a Node.js script such as app.js with v8-options trace_gc and trace_gc_nvp:
$ mkfifo ./gc.pipe && node --trace_gc --trace_gc_nvp app.js &> ./gc.pipe &
  • In parser.js:
var parser = require('gc-parser').create('./gc.pipe', function (gc) {
  console.log(gc);
});

Test

unit test

$ make test

License

(The MIT License)

Copyright (c) 2012 aleafs and other gc-parser contributors

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Something went wrong with that request. Please try again.