DEV Community

Cover image for Landing Parking-Garage Gate Events in a Fabric Eventhouse
Aniket Hingane
Aniket Hingane

Posted on

Landing Parking-Garage Gate Events in a Fabric Eventhouse

Cover

How I Ingested Deck Occupancy Telemetry and Queried Near-Full Alerts in KQL

TL;DR

I built DeckPulse as a laptop experiment for one narrow garage question. If four invented decks fill unevenly during a busy window, can I land those gate readings in a Microsoft Fabric Eventhouse, prove the rows arrived, and get a watch order out of KQL without inventing a second definition of "near full" in a notebook?

The sample is 6,000 rows. Seed 19. Twenty gates. Readings every 30 seconds from 2026-11-01T00:00:00Z. Status flips to ALERT when OccupancyPct crosses 88. On this seed that happened 229 times, 3.82 percent of the file. Midtown leads with 83 alerts. Plaza has 72. River 52. Campus 22. The peak is gate-006 at 100.00 percent on Midtown. Campus leads average occupancy. Midtown leads alerts. The watch order follows the spikes. The same numbers come out of python main.py and out of kql/01_explore.kql after a local-file ingest. The code is at https://github.com/aniket-work/DeckPulse.

This is a PoC. Midtown is not a garage I operate. The Eventhouse path is the create-and-ingest lesson I wanted to rehearse on a parking story instead of another generic sensor dump.

Introduction

The first version of this experiment lived in a spreadsheet I opened after a Saturday rush. I had pasted a few gate IDs, typed an occupancy percent, and decided "too full" in the header while the coffee was still hot. The next morning I opened a second sheet for wait times and the cutoff drifted by five points because I had forgotten the first sheet. Both sheets still looked official. They were two moods wearing column names.

Parking decks gave me a clean place to stop doing that. I did not want hospital beds, warehouse racks, or a ledger. I wanted a gate loop, an occupancy number, a wait estimate, a throughput tip, and a status that means one thing. Each row has a timestamp, a gate id, a deck, three measurements, and a status. That is a small world. I can hold it in one CSV and one KQL table. I named the project DeckPulse. It is my PoC. The four decks are invented so the rows have a story. It is not a garage system I run, and it is not work I did for an employer.

I started from the question I actually wanted the brief to answer. Which deck in this sample throws the most near-full alerts? "Near full" had to become a number or the question was a shrug. I set the line at 88 percent. Then I had to say that out loud in one place, or the chart would invent a second line later. The generator writes ALERT when occupancy crosses that line. The KQL filter uses the same status. The laptop brief counts the same rows. From my experience, if the threshold lives only in a chart title, I will quietly move it when the picture looks kinder.

gate-006 is the boundary I care about for the peak. Midtown, 100.00 percent, timestamp 2026-11-01T01:11:30Z. If I had written the alert rule as "occupancy at or above 100," that row would have sat on a polite edge and the story would have flattened. I wanted the packed gate inside the queue.

Campus is the holdout I care about for averages. Highest average occupancy in the sample. Only 22 alerts. A deck that runs busy-but-stable still has to show up in the average table, or I start pretending the map only contains spike decks. I kept Campus in the sample on purpose so the watch order would disagree with the average table. That disagreement is the point.

Title diagram

What's This Article About?

I walk through how I built the ingest path, in the order I wish I had used the first time. The question comes first. Then the CSV grain. Then the Eventhouse container. Then the local-file wizard. Then the queryset. Then the laptop mirror that refuses to disagree with KQL. The code under Let's Get Cooking is the same code the tests run.

You will see why I pinned seed 19, why status is a column instead of a live calculation in every query, and why ranking by alerts beats ranking by average occupancy on this sample. Setup is the clone path on GitHub. The run section is the 6,000-row table, the Midtown line, and the chart. If you only want the repo, start at https://github.com/aniket-work/DeckPulse. README.md has the same images and the same counts.

Tech Stack

I kept the list short. An Eventhouse experiment that needs a streaming mesh before the first table is an experiment I will not rerun on a weeknight.

  1. Python 3.11+ is the runtime I used for the generator, the brief, and the tests.
  2. The CSV under data/gate_telemetry.csv is the sample that lands in Fabric and on the laptop.
  3. Microsoft Fabric Eventhouse is the container. The default KQL database shares the Eventhouse name.
  4. KQL in the default queryset is how I prove the rows arrived and how I rank decks by ALERT.
  5. The analyzer in deckpulse/analyze.py mirrors those queries locally so a failed ingest cannot hide behind a pretty chart.
  6. FastAPI exposes GET /api/brief and serves static/dashboard.html.
  7. Matplotlib writes the ALERT-by-deck bar chart.
  8. pytest locks the 6,000-row count, the four decks, and the alert threshold.

I skipped Eventstream for this PoC. Continuous ingest is a real next step. It is also a different failure mode, and I wanted the create-and-ingest path alone first. I skipped OneLake availability too. Turning that on later can expose the same table as Delta for other Fabric engines. I left it off so the lesson stayed on the Eventhouse and the queryset. I also skipped a hosted model. The brief I wanted is a table of counts, and a model that paraphrases "near full" would be a second definition.

Architecture

The picture matches the runtime. main.py and the dashboard both call build_report. That function asks analyze.py to load the CSV and score the same rules the KQL script uses. Sample rows stay in data/gate_telemetry.csv so the article, the tests, and the GIF describe one run. The Eventhouse path is documented in docs/eventhouse-ingest.md and exercised with kql/01_explore.kql.

Why Read It?

Read it if you have a folder of garage notes that each redefine the same operational word. This experiment fails in an obvious way. If the CSV says ALERT and a query invents OccupancyPct > 92, the laptop brief and the queryset stop agreeing. I left that disagreement visible on purpose. The useful claim is not that Midtown is chaos. The useful claim is that I can point at one threshold and one status column and say "this is the near-full I meant."

A few choices are the ones I would repeat.

  1. Pin the sample. Seed 19, 6,000 rows, 30-second interval. If the file regenerates into a new story every run, the article becomes a moving target.
  2. Store status on the row. Computing the alert only in a query invites a second cutoff in a chart. The generator writes the status. The query filters it. The laptop counts it.
  3. Keep a laptop mirror. Fabric is where I want the long-lived table. The laptop brief is how I notice an ingest that quietly dropped rows.
  4. Rank decks by ALERT, not by average occupancy alone. Campus leads the average. Midtown leads the spikes. The watch order follows the spikes.
  5. Leave a quiet-alert deck with a loud average. Campus exists so the brief cannot pretend average and alert are the same question.

I do not think this replaces a parking management system. I think it is a decent skeleton for a local Eventhouse rehearsal when the raw record is already a flat file. The GitHub project includes the tests and the GIF so you can see the same 229 alerts I am quoting here.

Let's Design

Before tables, I wrote the question and the cutoff on paper.

  1. Question. Which decks throw the most near-full alerts in this busy window?
  2. Grain. One reading, meaning one gate at one timestamp, not a daily rollup and not a ticket.
  3. Near full. OccupancyPct > 88, stored as Status = "ALERT".
  4. Also show. Average occupancy by deck, first alert rows, and the single peak reading.

That list kept me from adding a column every time a noun sounded important. Attendant, plate, and reservation are real words around garages. They are not in the file, because none of my questions used them. I would rather add a join later than decorate the CSV now.

One fact, four decks

A telemetry model gets muddy when two things both claim to be the row. I made the reading the only fact. Deck is a label on the gate, assigned once when the sample is generated. Gate ids are gate-001 through gate-020. Each gate keeps one deck for the whole file. That is a limit. A gate that redirects mid-day would need a different grain, and then the rate would have to say whether the reading counts twice. I kept one deck per gate so the watch order stayed honest.

  1. Plaza is the street-facing entrance in the story. Plenty of readings. Seventy-two alerts.
  2. River sits on the waterfront side. Fifty-two alerts. Enough signal to matter, not enough to win.
  3. Campus is the stable-busy edge. Highest average. Twenty-two alerts. I almost cut it, then kept it so average and alert would disagree.
  4. Midtown is the dense pocket that wins the watch order on this seed. Eighty-three alerts. Peak reading lives here.

I am using "semantic" here only in the plain sense: names that mean the same thing in the CSV, the KQL table, and the laptop brief. I did not build an ontology service. I built a file and a scorer. An Eventhouse, in Fabric terms, is the container for event-like, time-based data. Inside it you keep one or more KQL databases, and each database holds tables. When you create an Eventhouse, Fabric also creates a default child KQL database with the same name, plus a default queryset so you can start querying immediately. That is the shape I leaned on.

I almost put the sample in a Lakehouse first "because everything else lives there." That would have been the wrong rehearsal. A Lakehouse is fine for batch tables and notebook work. This file is a time-ordered event feed with a status that flips on spikes. I wanted KQL over that feed with almost no ceremony. Eventhouse is the item type Fabric gives me for that shape. If the work had been a monthly rollup of cleaned tickets, I would have started somewhere else. It was not.

Compute on an Eventhouse can pause when idle, and wake-up can take a few seconds. Storage sits in two tiers I care about only enough to name: a cache tier for recent query speed and a standard retention tier for durable data. I left Capacity Planner and custom schedules alone for this PoC. A 6,000-row file does not need me to pretend I am tuning an always-on hot path. Knowing that pause exists stopped me from declaring the ingest broken the first time a query waited on a cold start.

Sequence

Why a parking-garage story, not another generic sensor dump

I have written enough "DeviceId / Temperature / Humidity" samples that my eyes skip them. Garage gates forced better column names. Occupancy is not temperature. Wait seconds are not humidity. Deck is not a cloud region. When the alert fires, the sentence I say out loud is "that entrance is near full," not "the sensor is warm." That sentence is the whole reason I picked this domain for the experiment. From my experience, a sample that sounds like a tutorial also gets treated like a tutorial: nobody argues with the threshold, nobody notices when Campus leads the average and loses the watch order, nobody asks whether average occupancy is the wrong ranking key.

The business problem I am rehearsing is small and practical. During a busy window, a parking desk wants a watch order. Not a digital twin. Not a pricing engine. A ranked list of decks where the near-full status already flipped, plus proof that the underlying rows actually landed. That is a real sentence I have heard in other domains, translated here into garage language so the Eventhouse practice would stick to something I would bother to re-open.

Columns are what the gate controller could report

On each reading the columns are the things I could imagine coming off a cheap logger.

  1. Timestamp is UTC. The generator starts at 2026-11-01T00:00:00Z and steps thirty seconds. I refused local time because busy windows cross midnight and I did not want a DST argument in the first query.
  2. GateId is the sensor identity. Twenty gates. The sample picks one at random per row so the file looks like a multiplexed feed, not a round-robin that is too tidy.
  3. Deck is the ops grouping I want the rate over. It is not a GPS point. I have no basemap in this PoC, so I refused to invent coordinates.
  4. OccupancyPct is the fill level. Base process is a Gaussian around 62 with a 14 point spread, clipped to 5..100. About 1.3 percent of rows get a +22 point spike so the alert set is real without becoming a constant emergency.
  5. WaitSeconds and ThroughputPerMin are companions. They are not in the alert rule. I kept them so the table looks like a gate packet, not a single-number toy. Wait rises a bit as occupancy climbs. Throughput softens a bit when the deck is packed. Those are soft couplings, not a physics model.
  6. Status is ALERT or OK. The generator writes it. Queries filter it. The brief counts it.

Each of those names appears the same way in the CSV header, the Eventhouse mapping, and the Python dataclass. When I came back the next day, "88 percent" stopped me from flipping Campus into the watch list just because the average chart looked loud. The picture got less flattering. The metric got clearer.

Why status is stored, not recomputed everywhere

I almost left status out and wrote where OccupancyPct > 88 in every query. That works until a chart uses 85 and a notebook uses 92. I have done that to myself. Storing status does not remove the need for a threshold. It forces the threshold to live in one writer. If I change the line later, I regenerate the CSV and re-ingest. The queryset does not silently disagree with the laptop brief because somebody edited one filter.

The 88 percent line lives in data/generate_gate_telemetry.py as ALERT_OCCUPANCY_PCT and again in deckpulse/analyze.py as a constant used for assertions. The KQL script filters on Status. That is intentional. The explore path should read the column the ingest landed, not re-litigate the policy in every cell.

Constraints the tests actually check

The tests are short on purpose.

  1. The sample has exactly 6,000 rows.
  2. Every ALERT row has OccupancyPct above 88.
  3. The four deck names are Plaza, River, Midtown, and Campus.
  4. Deck reading counts sum to 6,000.
  5. Alert ranking is sorted descending.

I do not parse the README into the tests. The README quotes the same numbers so a future edit that changes the seed without changing the prose fails my eyes before it fails CI. From my experience, a test that only checks "alerts > 0" will green-light a broken story.

Let's Get Cooking

This section is the code I actually run. Each block is followed by why I wrote it that way.

Generate the sample once, then stop touching it

SEED = 19
ROW_COUNT = 6_000
INTERVAL = timedelta(seconds=30)
START_TIME = datetime(2026, 11, 1, tzinfo=timezone.utc)
GATES = [f"gate-{i:03d}" for i in range(1, 21)]
DECKS = ["Plaza", "River", "Midtown", "Campus"]
SPIKE_PROBABILITY = 0.013
SPIKE_OFFSET_PCT = 22.0
ALERT_OCCUPANCY_PCT = 88.0
Enter fullscreen mode Exit fullscreen mode

I pinned the constants at the top of data/generate_gate_telemetry.py so the article and the file share one dial board. Seed 19 is arbitrary. What matters is that it is fixed. If I change the seed, I change the story, and then I have to rewrite every number in this post. I would rather regenerate on purpose than drift by accident.

def build_rows(seed: int = SEED, row_count: int = ROW_COUNT) -> list[tuple]:
    rng = random.Random(seed)
    deck_of = {gate: rng.choice(DECKS) for gate in GATES}

    rows: list[tuple] = []
    timestamp = START_TIME
    for _ in range(row_count):
        gate = rng.choice(GATES)
        occupancy = round(min(100.0, max(5.0, rng.gauss(62, 14))), 2)
        if rng.random() < SPIKE_PROBABILITY:
            occupancy = round(min(100.0, occupancy + SPIKE_OFFSET_PCT), 2)
        wait_seconds = round(
            max(0.0, rng.gauss(45, 25) + max(0.0, occupancy - 70) * 1.8), 1
        )
        throughput = round(
            max(0.5, rng.gauss(12, 3) - max(0.0, occupancy - 80) * 0.15), 2
        )
        status = "ALERT" if occupancy > ALERT_OCCUPANCY_PCT else "OK"
        rows.append(
            (
                timestamp.strftime("%Y-%m-%dT%H:%M:%SZ"),
                gate,
                deck_of[gate],
                occupancy,
                wait_seconds,
                throughput,
                status,
            )
        )
        timestamp += INTERVAL
    return rows
Enter fullscreen mode Exit fullscreen mode

The deck map is built once per gate. That keeps a gate from teleporting between entrances mid-file. The spike is a rare additive bump, clipped at 100. I tried a second process first and the alert rate jumped into a range that made the brief look like a constant emergency. 1.3 percent with a +22 point bump gave me 229 alerts on seed 19, which is enough to rank and still readable.

I write the CSV with CRLF on purpose. Fabric's local-file wizard is fine with either line ending in practice, but a stable byte layout makes "did I regenerate?" a diff instead of a feeling.

Load the same columns the Eventhouse will see

@dataclass(frozen=True)
class Reading:
    timestamp: str
    gate_id: str
    deck: str
    occupancy_pct: float
    wait_seconds: float
    throughput_per_min: float
    status: str


def load_readings(path: Path) -> list[Reading]:
    rows: list[Reading] = []
    with path.open("r", encoding="utf-8", newline="") as handle:
        reader = csv.DictReader(handle)
        for raw in reader:
            rows.append(
                Reading(
                    timestamp=raw["Timestamp"],
                    gate_id=raw["GateId"],
                    deck=raw["Deck"],
                    occupancy_pct=float(raw["OccupancyPct"]),
                    wait_seconds=float(raw["WaitSeconds"]),
                    throughput_per_min=float(raw["ThroughputPerMin"]),
                    status=raw["Status"],
                )
            )
    return rows
Enter fullscreen mode Exit fullscreen mode

The dataclass field names are snake_case because I am in Python. The CSV headers stay PascalCase because that is what I want in KQL. Mapping at the edge is better than renaming the Fabric table to please the laptop. I have renamed columns "for convenience" before and then spent an evening chasing a mapping that no longer matched the wizard preview.

Mirror the KQL summarize and alert filters

def summarize_by_deck(rows: list[Reading]) -> list[dict[str, Any]]:
    totals: dict[str, list[float]] = defaultdict(list)
    for row in rows:
        totals[row.deck].append(row.occupancy_pct)
    summary = [
        {
            "deck": deck,
            "avg_occupancy_pct": round(sum(levels) / len(levels), 2),
            "readings": len(levels),
        }
        for deck, levels in totals.items()
    ]
    summary.sort(key=lambda item: item["avg_occupancy_pct"], reverse=True)
    return summary


def alert_rows(rows: list[Reading]) -> list[Reading]:
    return sorted(
        [row for row in rows if row.status == "ALERT"],
        key=lambda row: row.timestamp,
    )


def alerts_by_deck(rows: list[Reading]) -> list[dict[str, Any]]:
    counts: dict[str, int] = defaultdict(int)
    for row in alert_rows(rows):
        counts[row.deck] += 1
    ranked = [{"deck": deck, "alerts": count} for deck, count in counts.items()]
    ranked.sort(key=lambda item: item["alerts"], reverse=True)
    return ranked
Enter fullscreen mode Exit fullscreen mode

These three functions are the laptop twins of the explore queries. Average by deck. Filter alerts. Count alerts by deck. I deliberately sort averages by occupancy and alerts by count, because those are different questions. On this seed Campus wins averages and Midtown wins alerts. If I had sorted only by average, I would have told the wrong story.

def build_report(rows: list[Reading]) -> dict[str, Any]:
    alerts = alert_rows(rows)
    by_deck = summarize_by_deck(rows)
    alert_rank = alerts_by_deck(rows)
    peak = max(rows, key=lambda row: row.occupancy_pct)
    return {
        "row_count": len(rows),
        "alert_count": len(alerts),
        "ok_count": len(rows) - len(alerts),
        "alert_rate": round(100.0 * len(alerts) / len(rows), 2) if rows else 0.0,
        "deck_summary": by_deck,
        "alerts_by_deck": alert_rank,
        "peak_gate": peak.gate_id,
        "peak_occupancy_pct": peak.occupancy_pct,
        "peak_deck": peak.deck,
        "peak_timestamp": peak.timestamp,
        "first_alerts": alerts[:8],
        "alert_threshold_pct": ALERT_OCCUPANCY_PCT,
        "preview": rows[:10],
    }
Enter fullscreen mode Exit fullscreen mode

The report is a plain dict so FastAPI can return it without a second schema layer. first_alerts is capped at eight because the ASCII table is for a terminal, not for a dump. The peak is computed across all rows, not only alerts, which is a small honesty check. On this seed the peak is an alert anyway. If a future seed produced a peak under 88, I would want to know my spike logic broke.

Print a brief a human can argue with

def format_ascii_table(report: dict[str, Any]) -> str:
    lines: list[str] = []
    lines.append("DeckPulse parking-garage gate telemetry brief")
    lines.append(
        f"rows={report['row_count']} alerts={report['alert_count']} "
        f"ok={report['ok_count']} alert_rate={report['alert_rate']:.2f}%"
    )
    lines.append(f"threshold OccupancyPct > {report['alert_threshold_pct']}")
    # ... deck averages, alert ranks, peak, first ALERT rows ...
    return "\n".join(lines)
Enter fullscreen mode Exit fullscreen mode

I care about the first lines more than the chart. If the terminal says 6,000 rows and 229 alerts, I can trust the Eventhouse count query when it says the same thing. If the Eventhouse says 5,980, the wizard did not finish, and no amount of dashboard polish fixes that. In my opinion, the ASCII table is the acceptance test that survives a bad wifi day.

The KQL side of the same brief

GateReadings
| count

GateReadings
| summarize AvgOccupancyPct = avg(OccupancyPct), Readings = count() by Deck
| order by AvgOccupancyPct desc

GateReadings
| where Status == "ALERT"
| project Timestamp, GateId, Deck, OccupancyPct
| order by Timestamp asc

GateReadings
| where Status == "ALERT"
| summarize Alerts = count() by Deck
| order by Alerts desc
Enter fullscreen mode Exit fullscreen mode

Run those one at a time in the default queryset. Clear placeholder sample text first. KQL will throw a syntax error if a comment and a query share a line in a messy paste. I learned that the hard way and left a note in the .kql file for future me.

.show table GateReadings schema as json is the last check. I want Timestamp as datetime, occupancy as a numeric type, and status as string. If the wizard treated the header row as data, the schema looks wrong immediately.

The Fabric create-and-ingest path, in the order I actually click

I keep this sequence next to the code because the code alone does not land the table.

  1. Open a Fabric workspace that already sits on a Fabric-enabled capacity.
  2. Select New item, then Eventhouse, name it DeckPulseEventhouse, and wait out the short provision.
  3. Confirm the default KQL database and the default queryset exist. Same name family. Different jobs.
  4. Open the database, choose Get data, then Local file.
  5. Create table GateReadings, upload gate_telemetry.csv, turn on first-row header, keep the auto mapping, finish.
  6. Wait for create table, create mapping, and data queuing to show success. Then look for about 6,000 rows in the activity tracker.
  7. Open the queryset, clear placeholders, run the explore file one statement at a time.

I wrote those steps into docs/eventhouse-ingest.md so I would not reconstruct them from memory next month. Memory is where my thresholds go to mutate. The doc is deliberately boring. Boring is the point.

The wizard creates an ingestion mapping for me. On this sample it is effectively GateReadings_mapping. I do not hand-author a mapping for a flat CSV with a header row. I do glance at the preview. If Status shows up as a number, something is wrong. If Timestamp looks like a string of gibberish, the header toggle is off. Those two glances catch most of the pain I used to discover only after writing a wrong where clause.

Flow

Why the laptop mirror is not optional in this PoC

People sometimes ask why I bother with main.py if Fabric already has a queryset. As per me, the queryset is the destination truth after a good ingest. The laptop brief is the preflight and the differential. If the CSV on disk says 229 alerts and the Eventhouse says 200, I do not start redesigning Midtown. I re-open the wizard summary. If both say 229 and my chart says 260, I broke the chart. The mirror exists so I can tell those failures apart without guessing.

api.py is the same idea with a browser skin. It calls build_report. It does not compute a second alert rate. I have shipped dashboards that drifted from the CLI by one filter. I am not doing that here on purpose.

Let's Setup

Step by step details can be found at:

  1. Clone the public repo at https://github.com/aniket-work/DeckPulse.
  2. Create a virtualenv inside the project and install requirements.txt.
  3. Regenerate or keep the CSV. python data/generate_gate_telemetry.py recreates the bundled file with seed 19.
  4. Run the laptop brief. python main.py --chart images/alert-chart.png
  5. Run the tests. pytest -q
  6. Optional dashboard. uvicorn api:app --reload then open the local root path.
  7. Fabric path. Follow docs/eventhouse-ingest.md: create DeckPulseEventhouse, Get data from local file into GateReadings, first-row header on, then run kql/01_explore.kql.

Prerequisites on the Fabric side are ordinary. A workspace on a Fabric-enabled capacity. Permission to create items. The sample CSV. That is the whole gate for this PoC.

A few setup notes from my run.

  1. The Eventhouse is the container. The KQL database is where the table lives. The queryset is the workbench. Mixing those three names in conversation is how I confuse myself later.
  2. Local-file ingest is a one-shot path. Up to 1,000 files, each up to 1 GB uncompressed, per the Fabric local-file docs. 6,000 rows is nowhere near that ceiling.
  3. Compute can pause when idle. The first query after a pause can take a few seconds. That is not a failed ingest.
  4. OneLake availability can wait. I want the table queryable in KQL first.

Let's Run

On seed 19 the laptop brief prints this shape.

DeckPulse parking-garage gate telemetry brief
rows=6000 alerts=229 ok=5771 alert_rate=3.82%
threshold OccupancyPct > 88.0

DECK        AVG_PCT  READINGS
Campus        62.36       597
River         62.33      1168
Plaza         61.83      1751
Midtown       61.75      2484

DECK         ALERTS
Midtown          83
Plaza            72
River            52
Campus           22

peak gate-006 @ 100.00% (Midtown) 2026-11-01T01:11:30Z
watch first: Midtown (83 ALERT)
Enter fullscreen mode Exit fullscreen mode

I treat that block as the contract. After ingest, GateReadings | count should return 6,000. The deck summarize should return four records in the same order of averages. The ALERT project should return 229 rows. The ALERT summarize should put Midtown first.

The first alert in the file is gate-010 on Midtown at 93.76 percent on 2026-11-01T00:34:00Z. That row matters to me because it is early and ordinary. It is not the peak. It proves the status column flips for a modest crossing, not only for theatrical spikes. The peak comes a little later the same hour. If I had only looked at the peak, I would have designed the whole brief around one gate.

Campus's twenty-two alerts are easy to ignore if you only stare at averages. I kept them in the chart. A watch order that chases the loudest average teaches the wrong habit. In my opinion, the brief should show that Campus can lead the mean and still lose the spike race.

The FastAPI dashboard reads the same build_report function. There is no second calculator behind the HTML. When I changed the alert threshold in a scratch branch and forgot to regenerate the CSV, the dashboard and the terminal both looked wrong in the same way. That sameness is the feature.

Alert chart

Edge cases I hit while wiring this

  1. Wizard header off. If first-row header is disabled, the column names become Column1 and the status filter returns nothing useful. Turn it on. Look at the preview.
  2. Placeholder queryset text. Leaving YOUR_TABLE_HERE in the editor produces a syntax error that looks like your query is wrong. Clear the sample. Run one statement at a time.
  3. Recomputing the threshold in KQL. where OccupancyPct > 92 while the CSV used 88 creates a false "ingest lost rows" panic. Filter on Status for the explore path.
  4. Regenerating with a new seed and keeping old prose. The README numbers are part of the experiment. Change seed, change README, change tests expectations, or do not change seed.
  5. Treating average occupancy as the watch order. On this seed averages and alerts disagree on first place. I rank by alerts because spikes are the thing I said I cared about.

What I would change next

Continuous ingest through Eventstream is the obvious sequel. I would keep the same table schema and land live readings instead of a CSV drop. Materialized views for latest-per-gate and hourly averages by deck are the second sequel. I already know those patterns from other Fabric work. I did not add them here because they would hide the create-and-ingest lesson under a second lesson.

A second fact grain for attendant checks is tempting. A check is not a reading. Bolting inspected onto the reading row throws away history the moment a second check happens. If I extend the experiment, the next file I want is a check log with its own timestamp, not a boolean on the gate packet.

Theory I am willing to defend, and theory I am not

I am willing to defend a few plain claims from this PoC.

  1. Event-like data wants an event-shaped store. A gate feed is closer to a log than to a slowly changing dimension. Eventhouse matches that shape without forcing me into a warehouse modeling ceremony first.
  2. Status belongs next to the measurement that caused it. Re-deriving alert policy in every consumer is how two briefs diverge on a Tuesday.
  3. A pinned sample beats a "realistic" random file. Realism that cannot be cited is not useful in a write-up. Seed 19 is citeable.
  4. Count queries are not busywork. GateReadings | count is the cheapest way to learn the wizard lied to you.
  5. Average and alert are different questions. Campus vs Midtown on this seed is the proof I wanted in the table, not in a slide footnote.

I am not willing to defend the 88 percent line as traffic engineering. It is a dial I set so the sample would teach. A real garage network would bring lane geometry, known capacity, and a validation history I do not have in this file. Pretending otherwise would turn an Eventhouse rehearsal into cosplay. I would rather say the threshold is experimental and keep the ingest lesson clean.

I also refuse the fantasy that a bar chart of alerts is a dispatch system. Midtown leading the count is a prompt to look, not a work order. If I had wired a fake ticket creator into this repo, the article would have become a story about automation theater. I wanted a story about landing rows and agreeing on names.

Ethics and honesty limits of the sample

Synthetic garage data can still mislead if I present it as measured. Every deck name here is invented. Every occupancy is drawn from a generator I wrote. The alert rate is a consequence of my spike probability, not a field study. I say that in the README and I am saying it again here because blog posts have a way of getting quoted without the hedges. If somebody copies the CSV into a slide titled "city parking crisis," that is a misuse. The correct title is "experimental Eventhouse ingest sample."

Privacy is light in this file because there are no people and no plates in it. That is a design choice, not an accident. The moment I add plate hashes or account identifiers, the ethics section gets longer than the KQL section. I kept the grain at gate and deck so the experiment stayed about telemetry mechanics.

Failure modes I still expect

Even with the tests green, I expect a few familiar failures when I re-run this months later.

  1. Fabric capacity moved, workspace lost Eventhouse create rights, and the portal error looks unrelated to CSV shape.
  2. I upload an old CSV while the README quotes a new seed.
  3. I run two explore queries highlighted together and get a syntax error that I blame on the table.
  4. I turn on OneLake availability, query from another engine too early, and decide the Eventhouse ingest failed because the Delta copy had not flushed yet.
  5. I compare laptop averages rounded to two decimals with a KQL average shown at full precision and invent a discrepancy that is only display.
  6. I sort the watch order by average occupancy because Campus looks "busier," and I quietly undo the point of the experiment.

Those are boring failures. Boring failures are the ones that eat evenings. Writing them down is part of the PoC for me.

Closing Thoughts

The part I trust is the order of work. Write the question. Pick one reading grain. Name a deck only when a gate points at it. Keep the threshold in the writer. Land the file in an Eventhouse. Prove the count. Rank the alerts. Keep a laptop mirror that refuses to flatter a bad ingest.

The part I do not trust is the cutoff. 88 percent, 1.3 percent spikes, +22 points, seed 19. I chose them so this sample would have a spike winner, a near rival, a middle deck, and a quiet-alert deck with a loud average. A different sample would make those numbers look arbitrary, because they are. The useful claim is not that Midtown needs cones. The useful claim is that I can point at a status column and a KQL filter and say "this is the near-full I meant," and a second notebook cannot quietly mean something else.

If I extend the experiment, the next change I actually want is a live ingest path, not a fifth chart. The current one still cannot tell me whether gate-006 stayed packed after 01:11. It can tell me that, under rules I wrote down, Midtown leads the alert count, Campus leads the average, and 6,000 rows made it into the table I named. That was the disagreement I was trying to make visible.

The code, the chart, and the GIF are in https://github.com/aniket-work/DeckPulse.

Disclaimer

The views and opinions expressed here are solely my own and do not represent the views, positions, or opinions of my employer or any organization I am affiliated with. The content is based on my personal experience and experimentation and may be incomplete or incorrect. Any errors or misinterpretations are unintentional, and I apologize in advance if any statements are misunderstood or misrepresented.

Tags: python, fabric, opensource, devops

Top comments (0)