From 156d04dac507e089a8b2a321094bb205bc67e1c1 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 8 Apr 2022 12:04:41 -0700 Subject: container status: add simple prod single-command script --- extra/container_count_update/update_prod.sh | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 extra/container_count_update/update_prod.sh (limited to 'extra') diff --git a/extra/container_count_update/update_prod.sh b/extra/container_count_update/update_prod.sh new file mode 100755 index 00000000..766398f2 --- /dev/null +++ b/extra/container_count_update/update_prod.sh @@ -0,0 +1,20 @@ +#!/usr/bin/env bash + +set -euo pipefail + +export CONTAINER_INDEX=fatcat_container_v05_20220110 + +fatcat-cli search container --index-json --limit 0 state:active \ + | jq .ident -r \ + | pv -l \ + > container_idents.tsv + +cat container_idents.tsv \ + | parallel -j10 curl --fail -s 'https://fatcat.wiki/container/{}/stats.json' \ + | jq -c . \ + | pv -l \ + > container_stats.json + +cat container_stats.json \ + | jq '{ ident: .ident, releases_total: .total, preservation_bright: .preservation.bright, preservation_dark: .preservation.dark, preservation_shadows_only: .preservation.shadows_only, preservation_none: .preservation.none }' -c \ + | esbulk -verbose -index $CONTAINER_INDEX -optype update -id ident -- cgit v1.2.3