(name, link string, rx, tx int64)
| 49 | } |
| 50 | |
| 51 | func buildDeltaStats(name, link string, rx, tx int64) []*common.Stat { |
| 52 | if rx == 0 && tx == 0 { |
| 53 | return nil |
| 54 | } |
| 55 | |
| 56 | stats := make([]*common.Stat, 0, 2) |
| 57 | if tx > 0 { |
| 58 | stats = append(stats, &common.Stat{ |
| 59 | Name: name, |
| 60 | Type: "uplink", |
| 61 | Link: link, |
| 62 | Value: tx, |
| 63 | }) |
| 64 | } |
| 65 | if rx > 0 { |
| 66 | stats = append(stats, &common.Stat{ |
| 67 | Name: name, |
| 68 | Type: "downlink", |
| 69 | Link: link, |
| 70 | Value: rx, |
| 71 | }) |
| 72 | } |
| 73 | |
| 74 | return stats |
| 75 | } |
| 76 | |
| 77 | func BuildInterfaceStats(name, link string, rx, tx int64) []*common.Stat { |
| 78 | return buildDeltaStats(name, link, rx, tx) |
no outgoing calls
no test coverage detected