Model Black Friday from last year's data

Pull peak ingest rates and page-view rates from last year's holiday window. Real numbers for the infra capacity conversation — no more back-of-envelope guesses.

Published

difficulty advanced · time to value 5 minutes · tools used 2

Just say this

Pull last year's event volume around Black Friday. Show me peak-second ingest rate, peak-hour ingest rate, peak page views. So I can estimate this year's infra.

Why this matters

Every year, capacity planning for Black Friday is a back-of-envelope guess. Someone says “let’s 3x the prod size for the week.” Someone else says “but last year we barely used half of what we provisioned.” Nobody actually pulls the numbers because:

  • The data lives in 4 different tools (analytics, CDN logs, app logs, database metrics)
  • Nobody has a reliable view of peak per-second — only daily totals
  • The pull would take a half-day of someone’s time

Agentry has all your event data in one place — analytics events, error events, deploy events. The peak-second/peak-hour/peak-day query is one HogQL pass. The output is the real numbers you can pin to a Confluence page and have a real infra conversation against.

What you get

  • Peak-second ingest rate (the number that matters for rate limits / DB connection pools)
  • Peak-hour ingest rate (the number that matters for steady-state capacity)
  • Peak-day total (the number that matters for cost forecasting)
  • Same metrics for page views, orders, and errors — all from one query

Walk through it

You

Pull last year’s event volume around Black Friday (Nov 24-28, 2025). Show me peak-second ingest, peak-hour ingest, peak page views. So I can estimate this year’s infra.

Agent

I’ll run three time-bucket queries — per second, per minute, per hour — and find the maxes in the Nov 24-28 window.

agentry_analytics_query {
  project_id: "default",
  query: "
    with sec_buckets as (
      select toStartOfSecond(timestamp) as sec, count() as evts
      from events
      where timestamp between '2025-11-24' and '2025-11-29'
      group by sec
    ),
    hour_buckets as (
      select toStartOfHour(timestamp) as hr, count() as evts
      from events
      where timestamp between '2025-11-24' and '2025-11-29'
      group by hr
    )
    select
      (select max(evts) from sec_buckets) as peak_per_second,
      (select max(evts) from hour_buckets) as peak_per_hour,
      (select sum(evts) from hour_buckets) as total_window
  "
}
{
  "rows": [
    { "peak_per_second": 1840, "peak_per_hour": 1240000, "total_window": 41200000 }
  ]
}
Agent

Now per event type so you can see which workloads spiked hardest.

agentry_analytics_query {
  project_id: "default",
  query: "
    select
      event,
      max(per_hour) as peak_hourly,
      sum(per_hour) as total
    from (
      select event, toStartOfHour(timestamp) as hr, count() as per_hour
      from events
      where timestamp between '2025-11-24' and '2025-11-29'
      group by event, hr
    )
    group by event
    order by peak_hourly desc
    limit 8
  "
}
{
  "rows": [
    { "event": "page_view",         "peak_hourly":  920000, "total": 31800000 },
    { "event": "product_viewed",    "peak_hourly":  190000, "total":  6100000 },
    { "event": "add_to_cart",       "peak_hourly":   42000, "total":  1380000 },
    { "event": "checkout_started",  "peak_hourly":   18400, "total":   612000 },
    { "event": "order_completed",   "peak_hourly":    9100, "total":   312000 },
    { "event": "$exception",        "peak_hourly":    4200, "total":    87000 }
  ]
}
Agent

Here’s the headline:

  • Peak second: 1,840 events/sec (vs baseline ~80 events/sec — 23× normal)
  • Peak hour: 1.24M events (occurred 09:00 EST Friday — first hour of doorbuster)
  • Peak orders/hour: 9,100 (vs baseline ~600/hour — 15× normal)
  • Peak errors/hour: 4,200 — note the rate doubled vs normal, suggesting load-induced bugs

For 2026 planning assuming 25% YoY growth:

Metric2025 peak2026 target (1.25×)Headroom (2×)
Events/sec1,8402,3004,600
Events/hour1.24M1.55M3.1M
Orders/hour9,10011,40022,800

Two follow-ups worth running:

  • rate-limit-spikes — did you hit any 429s during last year’s peak hour? Tells you whether the bottleneck is API limits.
  • db-pool-exhaustion — did your DB pool saturate? Pool size is usually the actual constraint.

Want me to publish this as a static dashboard so the infra team can keep refreshing it?

agentry_publish_query {
  recipe_id: "raw_hogql",
  description: "Black Friday 2025 peak load baseline",
  params: { query: "<event-type query from above>" }
}
{ "publication_id": "pub_bf_2025", "public_url": "https://agentry.sh/q/pub_bf_2025?key=agp_…" }

The output

Black Friday 2025 load baseline (Nov 24-28)

Aggregate
  Peak per second:    1,840 events  (23× baseline of ~80)
  Peak per hour:      1.24M  events  (09:00 EST Fri)
  Total in window:    41.2M  events

Per event type (peak hour)
  page_view              920,000  ████████████  (12 instances of normal day-peak)
  product_viewed         190,000  ███           (web app)
  add_to_cart             42,000  ▌
  checkout_started        18,400  ▎
  order_completed          9,100  ▏             ($1.4M GMV that hour at $150 AOV)
  $exception               4,200  ▏             ★ 2x normal error rate

2026 sizing recommendations (1.25× YoY + 2× headroom)
  API peak/sec:        4,600    (provision rate limit)
  Worker peak/hour:    3.1M     (provision concurrency)
  DB QPS peak:        ~9,200    (assuming 2 reads + 1 write per page view)

Public dashboard:
  https://agentry.sh/q/pub_bf_2025?key=agp_xxx

Suggested next investigations:
  - rate-limit-spikes (did any 429s happen during peak hour?)
  - db-pool-exhaustion (did the pool max out?)

Setting it up

This recipe needs no new instrumentation — it’s a pure query against the data you’re already sending. The only prereq is having last year’s analytics in Agentry. If you migrated mid-year, you’ll have to either splice in pre-migration data from your old tool or use a shorter window.

If you want this query to refresh during this year’s peak, register it as a published dashboard and check it live:

// In your war-room dashboard
const res = await fetch(`https://agentry.sh/q/pub_bf_2025?key=${AGP_KEY}&format=json`, {
  headers: { "User-Agent": "warroom/1.0" },
});
const data = await res.json();
renderPeakChart(data.rows);

For a more sophisticated read, pair this with a agentry_register_webhook listening for $exception events — pipe to PagerDuty during the peak window only.

Variations

  • “Same query but for Cyber Monday (Dec 1-2). I want to compare BFCM patterns.”
  • “By day of the week — does the peak always happen on Friday or did Saturday/Sunday catch up?”
  • “Peak rates per region — did EU and APAC peaks line up with US peaks or stagger?”
  • “Project this forward to 2026 holiday week assuming 2x growth. What rate limit and DB pool should I size for?”

Try this recipe in your own agent.

Paste the prompt above into your agent. It'll set up Agentry against your data, then run the recipe and show you the real output.

Install https://agentry.sh/agentry.md and set it up