bump sandbox; bin/user-activity
This commit is contained in:
21
bin/user-activity
Executable file
21
bin/user-activity
Executable file
@@ -0,0 +1,21 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
CONTEXT=${KUBECTL_CONTEXT:-prod}
|
||||||
|
|
||||||
|
kubectl --context "$CONTEXT" exec -n ai postgres-0 -- psql -U postgres -d iceberg -t -A -F $'\t' -c "
|
||||||
|
SELECT u.name,
|
||||||
|
MAX(s.\"createdAt\") as last_login,
|
||||||
|
MAX(s.\"updatedAt\") as last_active
|
||||||
|
FROM \"user\" u
|
||||||
|
LEFT JOIN session s ON s.\"userId\" = u.id
|
||||||
|
GROUP BY u.name
|
||||||
|
ORDER BY last_active DESC NULLS LAST;" 2>/dev/null \
|
||||||
|
| awk -F'\t' '
|
||||||
|
BEGIN {
|
||||||
|
fmt = "%-16s %-24s %-24s\n"
|
||||||
|
printf fmt, "Name", "Last Login", "Last Active"
|
||||||
|
printf fmt, "----------------", "------------------------", "------------------------"
|
||||||
|
}
|
||||||
|
{
|
||||||
|
printf fmt, $1, $2, $3
|
||||||
|
}'
|
||||||
@@ -26,7 +26,7 @@ data:
|
|||||||
namespace: sandbox
|
namespace: sandbox
|
||||||
service_namespace: ai
|
service_namespace: ai
|
||||||
in_cluster: true
|
in_cluster: true
|
||||||
sandbox_image: git.dxod.org/dexorder/dexorder/ai-sandbox:2fded95b
|
sandbox_image: git.dxod.org/dexorder/dexorder/ai-sandbox:b4e99744
|
||||||
sidecar_image: git.dxod.org/dexorder/dexorder/ai-lifecycle-sidecar:latest
|
sidecar_image: git.dxod.org/dexorder/dexorder/ai-lifecycle-sidecar:latest
|
||||||
image_pull_policy: Always
|
image_pull_policy: Always
|
||||||
storage_class: ceph-block
|
storage_class: ceph-block
|
||||||
|
|||||||
Reference in New Issue
Block a user