mirror of
https://github.com/luscis/openlan.git
synced 2025-11-03 09:40:50 +08:00
fea: add statics for output
This commit is contained in:
@@ -16,9 +16,9 @@ func NewPointSchema(p *Point) schema.Point {
|
||||
Protocol: p.Protocol,
|
||||
Remote: client.String(),
|
||||
Device: dev.Name(),
|
||||
RxBytes: sts[libol.CsRecvOkay],
|
||||
TxBytes: sts[libol.CsSendOkay],
|
||||
ErrPkt: sts[libol.CsSendError],
|
||||
RxBytes: uint64(sts[libol.CsRecvOkay]),
|
||||
TxBytes: uint64(sts[libol.CsSendOkay]),
|
||||
ErrPkt: uint64(sts[libol.CsSendError]),
|
||||
State: client.Status().String(),
|
||||
Network: p.Network,
|
||||
AliveTime: client.AliveTime(),
|
||||
@@ -116,3 +116,15 @@ func NewNetworkSchema(n *Network) schema.Network {
|
||||
}
|
||||
return sn
|
||||
}
|
||||
|
||||
func NewOutputSchema(o *Output) schema.Output {
|
||||
return schema.Output{
|
||||
Network: o.Network,
|
||||
Protocol: o.Protocol,
|
||||
Connection: o.Connection,
|
||||
Device: o.Device,
|
||||
RxBytes: o.RxBytes,
|
||||
TxBytes: o.RxBytes,
|
||||
AliveTime: o.UpTime(),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user