culiops/culiops-skills / skills/sre-investigate
sre-investigate
Unverifiedanalytics/sql/waf/concentration.sql
View on GitHub-- One row: top-1 client IP share of requests, distinct clients and distinct client keys behind the top IP. If sampled: requests and top1_requests scale by the factor; distinct_*, top1_client_keys are lower bounds; top1_share does not scale.
WITH per AS (
SELECT client_ip, count(*) AS n, count(DISTINCT client_key) AS keys FROM logs GROUP BY client_ip
), top1 AS (
SELECT client_ip, n, keys FROM per ORDER BY n DESC, client_ip LIMIT 1
)
SELECT (SELECT sum(n) FROM per) AS requests, (SELECT count(*) FROM per) AS distinct_clients,
(SELECT count(DISTINCT client_key) FROM logs) AS distinct_client_keys,
t.client_ip AS top1_client, t.n AS top1_requests,
round(t.n / (SELECT sum(n) FROM per), 4) AS top1_share, t.keys AS top1_client_keys
FROM top1 AS t
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| slack-gif-creatoranthropics/skillsKnowledge and utilities for creating animated GIFs optimized for Slack. Provides constraints, validation tools, and animation concepts. Use when users request animated GIFs for Slack like "make me a GIF of X doing Y for Slack." | Stars: 198k | Updated | Claude CodeCodex | Verified | Install |
| ponytailDietrichGebert/ponytailLazy senior dev mode for any coding task: the smallest change that fully solves it, and a reply a busy human understands in one read. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailHarvest every shortcut: comment into one debt ledger, so deferrals get tracked instead of forgotten. One-shot report. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |
| ponytail-debtDietrichGebert/ponytailList every `shortcut:` comment (and older `ponytail:` ones) as a debt ledger. One-shot report, changes nothing. Use for "ponytail debt", "what did ponytail defer", "list the shortcuts", /ponytail-debt. | Stars: 194k | Updated | Claude CodeCodex | Verified | Install |