(name string, reset bool)
| 42 | } |
| 43 | |
| 44 | func (wg *WireGuard) handleInterfaceOutboundStats(name string, reset bool) (*common.StatResponse, error) { |
| 45 | if name == "" { |
| 46 | name = wg.config.InterfaceName |
| 47 | } |
| 48 | |
| 49 | currentRx, currentTx, err := wg.getInterfaceCounters() |
| 50 | if err != nil { |
| 51 | return nil, err |
| 52 | } |
| 53 | |
| 54 | deltaRx, deltaTx := wg.interfaceStats.Delta(currentRx, currentTx, reset) |
| 55 | return &common.StatResponse{ |
| 56 | Stats: stats.BuildInterfaceStats(name, "interface", deltaRx, deltaTx), |
| 57 | }, nil |
| 58 | } |
| 59 | |
| 60 | func (wg *WireGuard) GetStats(ctx context.Context, request *common.StatRequest) (*common.StatResponse, error) { |
| 61 | wg.mu.RLock() |
no test coverage detected