How irrelevantongit/serverless-pre-warming-engine-for-cloud works
This repository is an adaptive pre-warming engine for Cloudflare Workers, accompanied by a dashboard for simulation, diagnostics, and benchmark/model inspection. Its operational workflow runs synthetic or baseline traffic against an instrumented target, trains and exports a forecasting model for edge inference, dispatches warm-ups, and compares outcomes. The dashboard also simulates warming strategies and presents telemetry and experimental results. Connections for worker-to-worker runtime dispatch and some storage details rely on the README’s phase descriptions; unsampled implementation details are not inferred.
Main entry points: App.tsx Dashboard App · target/index.ts Target Worker · run_predictive.py Predictive Runner · dispatcher/index.ts Warm-up Dispatcher
Components 28
Worker Runtime
- Target Worker
worker/target/index.ts - Invocation Telemetry
worker/shared/kv-schema.ts - Workers KV
- Naive Warmer
worker/naive-warmer/index.ts - Warm-up Dispatcher
worker/dispatcher/index.ts
Forecasting
- Edge Predictor
worker/predictor/index.ts - Training Data
model/export_data.py - Model Training
model/train.py - Model Export
model/export_onnx.py - Tree Model Artifact
model/model_trees.json
Traffic & Evaluation
- Traffic Generator
traffic-generator/generate.py - Baseline Runner
traffic-generator/run_baseline.py - Predictive Runner
traffic-generator/run_predictive.py - Metrics Engine
metrics/compute_metrics.py
Dashboard
- Dashboard App
dashboard/src/App.tsx - Warming Simulator
dashboard/src/utils/simulationEngine.ts - Traffic Controls
dashboard/src/components/TrafficControls.tsx - Simulation View
dashboard/src/components/SimulationVisualizer.tsx - Metrics Comparison
dashboard/src/components/MetricsComparison.tsx - ONNX Inspector
dashboard/src/components/OnnxInspector.tsx - Worker Probe
dashboard/src/components/LiveWorkerProbe.tsx - Function Status
dashboard/src/components/ServerlessFunctionStatus.tsx - Telemetry Studio
dashboard/src/components/CustomTelemetryStudio.tsx - Benchmark Data
dashboard/src/data/benchmarkData.ts
Terminal Display
- Interactive Terminal
dashboard/src/components/InteractiveTerminalLanding.tsx - CRT Renderer
dashboard/src/shaders/crt/crtRenderer.ts - CRT Screens
dashboard/src/shaders/crt/crtScreens.ts
Other components
- Operator
Connections 33
- Operator → Traffic Generator: generates traffic
README.md - Traffic Generator → Target Worker: sends requests
README.md - Operator → Baseline Runner: runs scenarios
README.md - Baseline Runner → Target Worker: benchmarks
README.md - Operator → Predictive Runner: runs scenario
README.md - Predictive Runner → Target Worker: drives traffic
README.md - Target Worker → Invocation Telemetry: logs invocations
README.md - Invocation Telemetry → Workers KV: writes telemetry
README.md - Naive Warmer → Target Worker: warms periodically
README.md - Predictive Runner → Warm-up Dispatcher: exercises pipeline
README.md - Warm-up Dispatcher → Edge Predictor: requests prediction
- Warm-up Dispatcher → Target Worker: dispatches warm-ups
README.md - Operator → Model Training: trains model
README.md - Model Training → Training Data: generates dataset
model/train.py - Operator → Model Export: exports model
README.md - Model Export → Tree Model Artifact: writes trees
README.md - Edge Predictor → Tree Model Artifact: loads trees
worker/predictor/index.ts - Baseline Runner → Metrics Engine: computes reports
traffic-generator/run_baseline.py - Predictive Runner → Metrics Engine: computes reports
traffic-generator/run_predictive.py - Operator → Dashboard App: uses dashboard
- Dashboard App → Warming Simulator: runs simulations
dashboard/src/App.tsx - Dashboard App → Traffic Controls: renders controls
dashboard/src/App.tsx - Dashboard App → Simulation View: renders view
dashboard/src/App.tsx - Dashboard App → Metrics Comparison: renders comparison
dashboard/src/App.tsx - Dashboard App → ONNX Inspector: renders inspector
dashboard/src/App.tsx - Dashboard App → Worker Probe: renders probe
dashboard/src/App.tsx - Dashboard App → Function Status: renders status
dashboard/src/App.tsx - Dashboard App → Telemetry Studio: renders studio
dashboard/src/App.tsx - Dashboard App → Interactive Terminal: renders terminal
dashboard/src/App.tsx - Dashboard App → Benchmark Data: loads benchmarks
dashboard/src/App.tsx - Interactive Terminal → Warming Simulator: runs simulation
dashboard/src/components/InteractiveTerminalLanding.tsx - Interactive Terminal → CRT Renderer: uses renderer
dashboard/src/components/InteractiveTerminalLanding.tsx - CRT Renderer → CRT Screens: draws screens
dashboard/src/shaders/crt/crtRenderer.ts