summaryrefslogtreecommitdiff
path: root/shell_scripts
diff options
context:
space:
mode:
authormjkwiatkowski <mati.rewa@gmail.com>2026-06-17 18:08:56 +0200
committermjkwiatkowski <mati.rewa@gmail.com>2026-06-17 18:08:56 +0200
commit4562f52c9b540944200b33d4ffbd60b3cbc5ee79 (patch)
tree82d028faf5a0555cb80ce9602890a3257ef695c2 /shell_scripts
parent78a9d920cc8aca951aff798272b0d5e7a2e356b9 (diff)
feat: managed to retrieve metric-by-metric from Redis in real timeHEADmaster
Diffstat (limited to 'shell_scripts')
-rw-r--r--shell_scripts/useful_commands.sh19
1 files changed, 19 insertions, 0 deletions
diff --git a/shell_scripts/useful_commands.sh b/shell_scripts/useful_commands.sh
new file mode 100644
index 00000000..8ff604e2
--- /dev/null
+++ b/shell_scripts/useful_commands.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+doas su postgres
+# In this project we only use the ``opendc'' database.
+psql -d opendc
+
+# Queries
+# Selects everything from the topic which Kafka writes to.
+SELECT * FROM postgres_topic;
+
+# Redis CLI
+# Connect to Redis
+redis-cli -h localhost -p 6379
+# Very useful tutorial https://redis.io/docs/latest/develop/data-types/streams/
+# https://redis.io/docs/latest/develop/tools/cli/
+# Returns all items in the Redis stream
+XRANGE postgres_topic - +
+XTRIM postgres_topic MAXLEN 0
+# https://codesignal.com/learn/courses/mastering-redis-for-high-performance-applications-with-java-and-jedis-1/lessons/redis-streams-with-java