lightninglabs / lndmon

🔎lndmon: A drop-in monitoring solution for your lnd node using Prometheus+Grafana
MIT License
149 stars 47 forks source link

Add streaming API to GraphCollector to reduce memory usage #13

Open valentinewallace opened 4 years ago

valentinewallace commented 4 years ago

Rather than polling DescribeGraph every scrape_interval seconds, just call it once at startup, cache the state, then subscribe to graph notifications and update the cached state.

Rationale: DescribeGraph is an expensive call, so this optimization should reduce memory usage.