TheThingsNetwork / lorawan-stack

The Things Stack, an Open Source LoRaWAN Network Server
https://www.thethingsindustries.com/stack/
Apache License 2.0
975 stars 306 forks source link

Use Gateway Stats Batch API in the Console #5635

Closed KrishnaIyer closed 11 months ago

KrishnaIyer commented 2 years ago

Summary

Use Gateway Stats Batch API in the Console.

Current Situation

Clients (including the console) today use the GetGatewayConnectionStats (and it's HTTP end point) to fetch stats for a single gateway.

With https://github.com/TheThingsNetwork/lorawan-stack/pull/5536 we now support a new BatchGetGatewayConnectionStats end point that can retrieve the connection stats for a batch of gateways in a single call.

Why do we need this? Who uses it, and when?

Switching to the new BatchGetGatewayConnectionStats RPC will drastically reduce the API calls made (esp) by the console to TTS.

Proposed Implementation

Use BatchGetGatewayConnectionStats (/gs/gateways/connection/stats HTTP end point) and post the list of gateway IDs.

Make sure to check the gateway_server_address of each gateway, collect gateways that have a common address (cluster) and send the request to the GS of that address (cluster).

Contributing

Code of Conduct

KrishnaIyer commented 2 years ago

Assigning @kschiffer for triaging.

KrishnaIyer commented 1 year ago

Let's hold this on https://github.com/TheThingsIndustries/product-management/issues/6, which introduces batch rights checks.

KrishnaIyer commented 11 months ago

Reassigning this for this milestone.