How kornelszyszka/grafana-clone works
Grafana Clone is a Django/PostgreSQL performance-monitoring and experiment foundation. The principal workflow seeds shop data, runs repeatable application workloads, captures PostgreSQL statistics and query plans, analyzes findings, and compares before/after snapshots. The README documents the end-to-end stages and API; sampled source confirms key calls and persistence paths. Some command wiring and reporting internals were not sampled, so uncertain connections are omitted.
Main entry points: models.py Snapshot records · postgres.py Stats collector · simulation.py Load simulation · comparison.py Snapshot comparison
Components 18
Shop API
- Shop endpoints
shop/views.py - Shop queries
shop/services/querying.py - Shop domain
shop/models.py
Workload generation
- Demo seeding
load_simulator/services/seeding.py - Load simulation
load_simulator/services/simulation.py - Workload runs
load_simulator/services/runs.py - Workload records
load_simulator/models.py
Monitoring and analysis
- Stats collector
db_monitor/collectors/postgres.py - SQL classification
db_monitor/services/query_classification.py - Snapshot records
db_monitor/models.py - Query plans
db_monitor/services/query_plans.py - Heuristic analysis
db_monitor/heuristics/analysis.py - Snapshot comparison
db_monitor/services/comparison.py - Monitoring reports
db_monitor/services/reporting.py
Index experiments
- Index experiments
db_monitor/services/index_experiments.py - Index benchmarking
db_monitor/services/benchmark_indexes.py
Other components
- Developer
- PostgreSQL
Connections 27
- Developer → Demo seeding: seeds data
- Developer → Load simulation: starts workload
- Developer → Stats collector: collects stats
- Developer → Heuristic analysis: analyzes snapshot
- Developer → Snapshot comparison: compares snapshots
- Shop endpoints → Shop queries: uses queries
shop/views.py - Shop queries → Shop domain: queries models
shop/services/querying.py - Demo seeding → Shop domain: creates shop data
load_simulator/services/seeding.py - Load simulation → Shop queries: runs read scenarios
load_simulator/services/simulation.py - Load simulation → Shop domain: mutates records
load_simulator/services/simulation.py - Load simulation → Workload runs: records run
- Workload runs → Workload records: persists runs
load_simulator/services/runs.py - Stats collector → Workload runs: links latest run
db_monitor/collectors/postgres.py - Stats collector → SQL classification: classifies queries
db_monitor/collectors/postgres.py - Stats collector → Snapshot records: stores statistics
db_monitor/collectors/postgres.py - Stats collector → PostgreSQL: reads statistics
db_monitor/collectors/postgres.py - Query plans → Snapshot records: stores plans
db_monitor/services/query_plans.py - Query plans → Shop domain: builds representative queries
db_monitor/services/query_plans.py - Heuristic analysis → Snapshot records: analyzes snapshot
db_monitor/heuristics/analysis.py - Snapshot comparison → Snapshot records: compares snapshot data
db_monitor/management/commands/compare_snapshots.py - Snapshot comparison → SQL classification: classifies operations
db_monitor/services/comparison.py - Monitoring reports → Snapshot records: reports snapshot data
db_monitor/services/reporting.py - Monitoring reports → Snapshot comparison: uses comparison results
db_monitor/services/reporting.py - Index benchmarking → Index experiments: uses index setup
db_monitor/services/benchmark_indexes.py - Index benchmarking → Query plans: captures plans
db_monitor/services/benchmark_indexes.py - Index benchmarking → Load simulation: runs workload
db_monitor/services/benchmark_indexes.py - Index experiments → Snapshot records: stores experiment definitions
db_monitor/services/index_experiments.py