KilnVM Live Labs /lab/clickhouse-local-analytics
Step 1 of 3 Docs Build Your Own

Serverless SQL Analytics with clickhouse-local

Query NDJSON HTTP logs and join CSV SLA tables directly from local files using clickhouse-local without provisioning a server daemon.

Step 1 of 3

Compute p95 latency per endpoint

/workspace/events.ndjson contains HTTP telemetry across /v1/checkout, /v1/search, and /v1/auth. Use clickhouse-local to infer the JSON schema, compute p95 latency per endpoint, and write /workspace/p95.tsv:

bash
clickhouse-local -q "SELECT endpoint, round(quantile(0.95)(latency_ms),1) AS p95_ms FROM file('events.ndjson',JSONEachRow) GROUP BY endpoint ORDER BY p95_ms DESC FORMAT TabSeparatedWithNames" | tee p95.tsv