[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libeufin] branch master updated: monitor test
From: |
gnunet |
Subject: |
[libeufin] branch master updated: monitor test |
Date: |
Fri, 24 Nov 2023 21:39:02 +0100 |
This is an automated email from the git hooks/post-receive script.
ms pushed a commit to branch master
in repository libeufin.
The following commit(s) were added to refs/heads/master by this push:
new 5539fcd1 monitor test
5539fcd1 is described below
commit 5539fcd15818bad1a4ac4fb5c6ad149ed9347b24
Author: MS <ms@taler.net>
AuthorDate: Fri Nov 24 21:35:57 2023 +0100
monitor test
populating the bank_stats table via the
stats_register_payment procedure.
---
contrib/populate-stats.sh | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/contrib/populate-stats.sh b/contrib/populate-stats.sh
index f93c5474..0ad510f9 100755
--- a/contrib/populate-stats.sh
+++ b/contrib/populate-stats.sh
@@ -23,6 +23,17 @@ rnd () {
shuf -i $1-$2 -n1
}
+insert_stat () {
+ echo "
+ SET search_path TO libeufin_bank;
+ CALL libeufin_bank.stats_register_payment (
+ 'taler_out'::text
+ ,TO_TIMESTAMP($1)::timestamp
+ ,($(rnd 0 99999999), $(rnd 0 99999999))::taler_amount
+ ,($(rnd 0 99999999), $(rnd 0 99999999))::taler_amount
+ );"
+}
+
# $1 == timestamp
insert_cmd () {
echo "
@@ -41,7 +52,7 @@ insert_cmd () {
,cashout_fiat_volume
) VALUES (
'hour'
- ,TO_TIMESTAMP($1)
+ ,date_trunc('hour', TO_TIMESTAMP($1))
,$(rnd 1 3000)
,($(rnd 1 1000000), $(rnd 0 99999999))
,$(rnd 1 3000)
@@ -54,9 +65,11 @@ insert_cmd () {
,($(rnd 1 1000000), $(rnd 0 99999999))
);"
}
-
-for n_hour_ago in `seq 1 100`; do
+
+for n_hour_ago in `seq 1 5`; 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
+ # psql $DB_NAME -c "$(insert_cmd ${TIMESTAMP})" > /dev/null
+ psql $DB_NAME -c "$(insert_stat ${TIMESTAMP})" > /dev/null
done
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libeufin] branch master updated: monitor test,
gnunet <=