towerops/lib/towerops_web/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
..
admin Add superuser system with user impersonation for admin support 2026-01-06 12:50:10 -06:00
agent_live Deduplicate agent status helper functions 2026-01-14 19:12:06 -06:00
alert_live Fix impersonation to show correct user data and banner 2026-01-06 13:22:13 -06:00
equipment_live Add batch loading for sensor/interface stats to eliminate N+1 queries 2026-01-15 07:31:57 -06:00
graph_live Refactor credo issues: reduce complexity and nesting depth 2026-01-06 13:55:16 -06:00
org Enhance agent assignment UI with clear inheritance indicators 2026-01-14 16:20:20 -06:00
org_live Fix impersonation to show correct user data and banner 2026-01-06 13:22:13 -06:00
site_live Enhance agent assignment UI with clear inheritance indicators 2026-01-14 16:20:20 -06:00
dashboard_live.ex fix dialyzer things 2026-01-03 12:56:40 -06:00
dashboard_live.html.heex Fix impersonation to show correct user data and banner 2026-01-06 13:22:13 -06:00