Skip to content

Commit

Permalink
Make the interval configrable using environment variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Max Murphy-Skvorzov committed Aug 13, 2015
1 parent 516122b commit 6e9fe24
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion util/numper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ path="$(jline-parsePath "$1" | jline-foreach 'console.log(record.map(function(a)
echo "Collecting $path" >&2

jline-foreach \
'start::global.a = new(require("numper"))({interval:1000});global.ksort=require("tree-math").ksort;a.on("aggregate", function(d){d.counts=ksort(d.counts);emit(d);})' \
'start::global.a = new(require("numper"))({interval:process.env.interval||1000});global.ksort=require("tree-math").ksort;a.on("aggregate", function(d){d.counts=ksort(d.counts);emit(d);})' \
"jline::a.increment(record$path,1)"


Expand Down
4 changes: 2 additions & 2 deletions util/sumper.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ path="$(jline-parsePath "$1" | jline-foreach 'console.log(record.map(function(a)
echo "Collecting $path" >&2

jline-foreach \
'start::global.a = new(require("numper"))({interval:1000});a.on("aggregate", emit)' \
"jline::var val=Number(record$path);if(!isNaN(val))a.increment('sum',val)"
'start::global.a = new(require("numper"))({interval:process.env.interval||1000});a.on("aggregate", emit)' \
"jline::var val=Number(record$path);if(!isNaN(val)){a.increment('sum',val); a.increment('count',1);}"



Expand Down

0 comments on commit 6e9fe24

Please sign in to comment.