made variables strings so that they can be set from the commandline

db4
Sascha Matzke 2009-03-07 14:24:38 +01:00
parent aaf887ab1d
commit 4b7c4a3564
1 changed files with 6 additions and 5 deletions

View File

@ -1,19 +1,19 @@
USING: calendar math fry kernel assocs math.ranges USING: calendar math fry kernel assocs math.ranges
sequences formatting combinators namespaces io tools.time prettyprint sequences formatting combinators namespaces io tools.time prettyprint
accessors words mongodb.driver ; accessors words mongodb.driver strings math.parser ;
IN: mongodb.benchmark IN: mongodb.benchmark
SYMBOLS: per-trial collection host db port ; SYMBOL: collection
: get* ( symbol default -- value ) : get* ( symbol default -- value )
[ get ] dip or ; inline [ get ] dip or ; inline
: trial-size ( -- size ) : trial-size ( -- size )
per-trial 10000 get* ; inline flushable "per-trial" 10000 get* ; inline flushable
: batch-size ( -- size ) : batch-size ( -- size )
\ batch-size 100 get* ; inline flushable "batch-size" 100 get* ; inline flushable
TUPLE: result doc collection index batch lasterror ; TUPLE: result doc collection index batch lasterror ;
@ -249,7 +249,7 @@ CONSTANT: DOC-LARGE H{ { "base_url" "http://www.example.com/test-me" }
: run-benchmarks ( -- ) : run-benchmarks ( -- )
db "db" get* host "127.0.0.1" get* port 27020 get* <mdb> "db" "db" get* "host" "127.0.0.1" get* "port" 27020 get* dup string? [ string>number ] when <mdb>
[ [
print-header print-header
! insert ! insert
@ -270,4 +270,5 @@ CONSTANT: DOC-LARGE H{ { "base_url" "http://www.example.com/test-me" }
] with-db ; ] with-db ;
MAIN: run-benchmarks