Created
September 13, 2013 01:32
-
-
Save csquared/6545920 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var split = require('split'); | |
| var logfmt = require('logfmt'); | |
| var through = require('through'); | |
| var _ = require('underscore'); | |
| var list = [] | |
| var parseLine = function(line){ | |
| if(/INFO/.test(line)) return; | |
| var data = logfmt.parse(line); | |
| data.json_size = (parseInt(data.json_size) / 1024) / 1024 | |
| list.push(data) | |
| } | |
| var end = function end(){ | |
| console.dir(_.sortBy(list, 'json_size').reverse().slice(0,16)) | |
| } | |
| process.stdin.pipe(split()).pipe(through(parseLine, end)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment