towerops/lib/towerops_web
Graham McIntire 723f064315
Add batch loading for sensor/interface stats to eliminate N+1 queries
Added two new functions to Snmp context:
- get_latest_sensor_readings_batch/1 - Loads latest readings for multiple sensors in one query
- get_latest_interface_stats_batch/1 - Loads latest stats for multiple interfaces in one query

Both use PostgreSQL DISTINCT ON to efficiently get only the latest record per ID.

Updated EquipmentLive.Show.load_snmp_data/1 to use batch functions:
- Equipment with 20 sensors: 20 queries → 1 query (20x reduction)
- Equipment with 10 interfaces: 10 queries → 1 query (10x reduction)
- Total improvement: 30 queries → 2 queries for typical equipment page load

This significantly improves page load performance for equipment with many sensors/interfaces.
2026-01-15 07:31:57 -06:00
..
components Add Agents navigation link to authenticated layout 2026-01-13 13:14:23 -06:00
controllers Fix protobuf body parsing causing 400 errors on agent heartbeat 2026-01-14 18:35:20 -06:00
live Add batch loading for sensor/interface stats to eliminate N+1 queries 2026-01-15 07:31:57 -06:00
plugs Fix agent IP detection to use real client IP from proxy headers 2026-01-14 17:04:59 -06:00
endpoint.ex Fix protobuf body parsing causing 400 errors on agent heartbeat 2026-01-14 18:35:20 -06:00
gettext.ex init 2025-12-21 11:10:43 -06:00
router.ex Implement all quick win improvements for agent UI and functionality 2026-01-14 18:46:03 -06:00
telemetry.ex format 2025-12-21 11:31:08 -06:00
user_auth.ex Streamline login flow and fix test failures 2026-01-13 13:08:24 -06:00