datapartyjs / rfparty-monitor

its like a tricorder, for your wireless world.
https://rfparty.xyz
Apache License 2.0
102 stars 4 forks source link

improve `BleMonitorTask`'s cache #24

Open sevenbitbyte opened 7 months ago

sevenbitbyte commented 7 months ago

The cache works great, BUT we are currently clearing the entire cache at the start of a new scan. This causes a spike in db queries at the start of every scan. It also causes ble_obs to all cluster around the start of a scan aggrevating db latency.

Instead we should selectively crawl and clear the cache instead. This will help more equally distribute db access.

Should also track an accurate cache size, this essentially is the backlog of queries. Then track a completed queries count.