         
     ] with-db ;
         
-
+MAIN: run-benchmarks
+

USING: calendar math fry kernel assocs math.ranges
sequences formatting combinators namespaces io tools.time prettyprint
accessors words mongodb.driver ;

IN: mongodb.benchmark

SYMBOLS: per-trial collection host db port ;

: get* ( symbol default -- value )
    [ get ] dip or ; inline

: trial-size ( -- size )
    per-trial 10000 get* ; inline flushable

: batch-size ( -- size )
    \ batch-size 100 get* ; inline flushable

TUPLE: result doc collection index batch lasterror ;



    
: run-benchmarks ( -- )
    "db" "db" get* "host" "127.0.0.1" get* "port" 27020 get* dup string? [ string>number ] when <mdb>
    [
        print-header
        ! insert
