wtclient+lnrpc: move Stats to Manager

Move the `Stats` method from the `Client` to the `Manager` interface.
This commit is contained in:
Elle Mouton committed 2023-11-28 09:54:02 +02:00
1 parent f38b5cf258
commit 4348f2062a
3 files changed
+25 -18

No files matched your search

+1 -13
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),