libeufin

Integration and sandbox testing for FinTech APIs and data formats
Log | Files | Refs | Submodules | README | LICENSE

commit fec2ef057222d3f2a9c2784c8d45a42a48ad6fb0
parent 476203331c8328a133d19185744c8961023cb534
Author: MS <ms@taler.net>
Date:   Fri, 24 Nov 2023 22:05:59 +0100

fix stats sample data generator

Diffstat:
Mcontrib/populate-stats.sh | 23++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/contrib/populate-stats.sh b/contrib/populate-stats.sh @@ -27,11 +27,29 @@ insert_stat () { echo " SET search_path TO libeufin_bank; CALL libeufin_bank.stats_register_payment ( + 'taler_in'::text + ,TO_TIMESTAMP($1)::timestamp + ,($(rnd 0 99999999), $(rnd 0 99999999))::taler_amount + ,null + ); + CALL libeufin_bank.stats_register_payment ( 'taler_out'::text ,TO_TIMESTAMP($1)::timestamp ,($(rnd 0 99999999), $(rnd 0 99999999))::taler_amount + ,null + ); + CALL libeufin_bank.stats_register_payment ( + 'cashin'::text + ,TO_TIMESTAMP($1)::timestamp + ,($(rnd 0 99999999), $(rnd 0 99999999))::taler_amount ,($(rnd 0 99999999), $(rnd 0 99999999))::taler_amount - );" + ); + CALL libeufin_bank.stats_register_payment ( + 'cashout'::text + ,TO_TIMESTAMP($1)::timestamp + ,($(rnd 0 99999999), $(rnd 0 99999999))::taler_amount + ,($(rnd 0 99999999), $(rnd 0 99999999))::taler_amount + );" } # $1 == timestamp @@ -66,8 +84,7 @@ insert_cmd () { );" } -for n_hour_ago in `seq 1 5`; do -# for n_hour_ago in `seq 1 100`; do +for n_hour_ago in `seq 1 100`; do echo -n . TIMESTAMP=$(date --date="${n_hour_ago} hour ago" +%s) # psql $DB_NAME -c "$(insert_cmd ${TIMESTAMP})" > /dev/null