Plain Java 21 · real-time ad bidding · no frameworks
An exchange offers an ad slot; the bidder has 20 ms to match campaigns, check pacing, frequency caps and budget, score, shade a first-price bid, and answer. Every dot below is one auction going through that pipeline.
This page plays the exchange: a steady stream of random bid requests (or bursts of 1,000 or 10,000, 50 in flight), a win notice for about 40% of bids, and about 5% of win notices sent twice to prove the bidder never charges twice.
Each dot is one bid request moving through Bidder.decide(). It falls out at the gate that said no; bids that win turn green when the exchange's win notice arrives.
Per request, as this page (the exchange) sees it; log scale, square-root heights so rare slow requests stay visible. Browsers round timers to about 0.1 ms. The red line is the 20 ms deadline.
Requests answered per second, last 60 seconds
Each stage of Bidder.decide(), and how many requests it drops
Most recent first
Spend against budget. Pacing lowers the throttle when a campaign spends ahead of its daily line (a "day" is 5 minutes here).
| Campaign | Spend | Budget | Leased | Throttle |
|---|
Solid arrows are the hot path inside one bid. Dotted arrows are background jobs that only publish values the hot path reads.
Plain JDK 21, no frameworks. Read in this order. New to modern Java? Java since 2015, for Python developers →