Skip to content

Commit 7f02027

Browse files
push some metrics while checking scratch limits
1 parent 232f241 commit 7f02027

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/workflows/ciCreatePlatformPool.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,27 @@ jobs:
7979
echo "::warning title=To many active Scratch Orgs::Max active scratch orgs: $maxActiveScratchOrgs. Remaining scratch orgs: $remainingActiveScratchOrgs. Threshold: ${POOL_REMAINING_ACTIVE_SCRATCH_ORG_LIMIT}."
8080
echo "canReplenishPool=false" >> "$GITHUB_OUTPUT"
8181
fi
82+
- name: Push metrics
83+
id: pushMetrics
84+
run: |
85+
keyfile=$(mktemp) || exit 1
86+
cat > "$keyfile" <<< "$METRICSKEY"
87+
msg=$(sfp pool list --targetdevhubusername=devhub --json |
88+
jq -r '.scratchOrgDetails |
89+
group_by(.tag, .status)[] |
90+
"scratch_org_status{instance=\"devhub\",tag=\"\(.[0].tag)\",status=\"\(.[0].status)\"} \(length)"')
91+
echo "got some stats: $msg"
92+
jq --compact-output --null-input \
93+
--arg msg "$msg" \
94+
--arg runner utah \
95+
--arg sig "$sig" \
96+
'{"runner":$runner,"metrics":$msg,"signature":$sig}' |
97+
curl -D- -H 'Content-Type: application/json' --data-binary @- \
98+
https://sf-github-metrics.ekstern.dev.nav.no/measures/job/sfplatform
8299
env:
83100
POOL_REMAINING_DAILY_SCRATCH_ORG_LIMIT: ${{ vars.POOL_REMAINING_DAILY_SCRATCH_ORG_LIMIT }}
84101
POOL_REMAINING_ACTIVE_SCRATCH_ORG_LIMIT: ${{ vars.POOL_REMAINING_ACTIVE_SCRATCH_ORG_LIMIT }}
102+
METRICSKEY: ${{ secrets.METRICS_KEYS }}
85103

86104
prepareMatrix:
87105
runs-on: ubuntu-latest

.gitignore

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,10 @@ $RECYCLE.BIN/
4848

4949
mdapi/
5050
/.idea/
51-
.pmdCache
51+
.pmdCache
52+
53+
# misc
54+
.*.sw?
55+
*.vim
56+
TAGS
57+
tags

0 commit comments

Comments
 (0)