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. |
||
|---|---|---|
| .. | ||
| admin | ||
| agent_live | ||
| alert_live | ||
| equipment_live | ||
| graph_live | ||
| org | ||
| org_live | ||
| site_live | ||
| dashboard_live.ex | ||
| dashboard_live.html.heex | ||