wtclient+lnrpc: move Stats to Manager

Move the `Stats` method from the `Client` to the `Manager` interface.
This commit is contained in:
Elle Mouton
2023-08-11 14:03:14 +02:00
parent f38b5cf258
commit 4348f2062a
3 changed files with 25 additions and 18 deletions

View File

@@ -420,19 +420,7 @@ func (c *WatchtowerClient) Stats(_ context.Context,
return nil, err
}
clientStats := []wtclient.ClientStats{
c.cfg.Client.Stats(),
c.cfg.AnchorClient.Stats(),
}
var stats wtclient.ClientStats
for _, stat := range clientStats {
stats.NumTasksAccepted += stat.NumTasksAccepted
stats.NumTasksIneligible += stat.NumTasksIneligible
stats.NumTasksPending += stat.NumTasksPending
stats.NumSessionsAcquired += stat.NumSessionsAcquired
stats.NumSessionsExhausted += stat.NumSessionsExhausted
}
stats := c.cfg.ClientMgr.Stats()
return &StatsResponse{
NumBackups: uint32(stats.NumTasksAccepted),