Skip to content
This repository was archived by the owner on Sep 18, 2021. It is now read-only.
nisbus edited this page Jul 10, 2011 · 15 revisions

Getting started with BabelStat

clone the rcouch repository from https://github.com/omarkj/rcouch/tree/babelstat.

./configure
make
make install
/opt/refuge/bin/refuge start

open up an erlang shell:

erl -name tester@127.0.0.1 -setcookie refuge

Attach to the node
r 'refuge@127.0.0.1'
c 2

Create some test documents:
document_creator:test_docs_to_couchdb(<<"lines of code">>,<<"cm">>,1,<<"days">>).
document_creator:test_docs_to_couchdb(<<"commits">>,<<"km">>,1,<<"days">>).

Filter = babelstat_api:create_filter(<<"km">>,1,days,undefined,undefined).
Query = babelstat_api:create_query(<<"Spawnfest">>,<<"Teams">>,"Jesus don't want me for a sunBEAM",<<"code">>,<<"commits">>).

babelstat_api:run_query(Query,Filter,fun(Res)-> io:format("Results pn",[Res] end).

This should return a single document with the dates and values from all of the documents matching the Query parameters.

Clone this wiki locally