Skip to content

Commit

Permalink
Don't memwatch
Browse files Browse the repository at this point in the history
node-memwatch is kill for node 0.12 unless someone over at
lloyd/node-memwatch#62 does V8 update fun-times.

I realise this removes all the logging that would warn of impending
catastrophe, but that's how we roll, else we don't roll at all.
  • Loading branch information
anko committed Mar 20, 2015
1 parent bfd0abc commit 14c8223
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
"baconjs": "0.7.2",
"colors": "0.6.2",
"lynx": "0.1.1",
"memwatch": "0.2.2",
"prelude-ls": "1.0.3"
},
"scripts" : {
Expand Down
26 changes: 0 additions & 26 deletions server.ls
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ require! {
_: \prelude-ls
#req: \request
lynx
memwatch
}

board = process.env.BOARD || 'a'
Expand All @@ -17,37 +16,12 @@ const SAVE_FILE = "/tmp/org.hakase.fountain.#board.json"

stats = new lynx \localhost 8125 scope: \fountain

memwatch.on \leak !->
stats.increment 'leak'
console.log it

# inc_gc/full_gc/compactions are all counting from 0
# which is not as useful as a rate, so keep track of last seen
last-inc-gc = 0
last-full-gc = 0
last-heap-compactions = 0

memwatch.on \stats !->
stats.count "mem.inc_gc" diff if (diff = it.inc_gc - last-inc-gc) > 0
last-inc-gc := it.inc_gc

stats.count "mem.full_gc" diff if (diff = it.full_gc - last-full-gc) > 0
last-full-gc := it.full_gc

if (diff = it.heap_compactions - last-heap-compactions) > 0
stats.count "mem.heap_compactions" diff
last-heap-compactions := it.heap_compactions

# still not really sure what usage trend is, gauge anyway
stats.gauge "mem.usage_trend" it.usage_trend

stats.gauge "mem.current_base" it.current_base
stats.gauge "mem.min" it.min
stats.gauge "mem.max" it.max

for k, v of process.memory-usage! # rss, heapTotal, heapUsed
stats.gauge "mem.#k" v

text-content = ->
return '' if not it?
it.replace /<br>/g '\n' .replace /<[^>]+?>/g ''
Expand Down

0 comments on commit 14c8223

Please sign in to comment.