towerops/lib/towerops_web/live/equipment_live
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
..
form.ex Implement hierarchical agent assignment for SNMP polling 2026-01-14 08:38:50 -06:00
form.html.heex Enhance agent assignment UI with clear inheritance indicators 2026-01-14 16:20:20 -06:00
index.ex Fix credo warnings and software design suggestions 2026-01-06 12:55:22 -06:00
index.html.heex Fix impersonation to show correct user data and banner 2026-01-06 13:22:13 -06:00
show.ex Add batch loading for sensor/interface stats to eliminate N+1 queries 2026-01-15 07:31:57 -06:00
show.html.heex Fix impersonation to show correct user data and banner 2026-01-06 13:22:13 -06:00