@@ -13,27 +13,27 @@ func init() {
13
13
}
14
14
15
15
var mapStatMapping = map [string ]string {
16
- "Ip.InReceives" : "ip.TotalPacketsReceived" ,
17
- "Ip.ForwDatagrams" : "ip.Forwarded" ,
18
- "Ip.InDiscards" : "ip.IncomingPacketsDiscarded" ,
19
- "Ip.InDelivers" : "ip.IncomingPacketsDelivered" ,
20
- "Ip.OutRequests" : "ip.RequestsSentOut" ,
21
- "Tcp.ActiveOpens" : "tcp.ActiveConnectionsOpenings" ,
22
- "Tcp.PassiveOpens" : "tcp.PassiveConnectionsOpenings" ,
23
- "Tcp.AttemptFails" : "tcp.FailedConnectionAttempts" ,
24
- "Tcp.EstabResets" : "tcp.ConnectionResetsReceived" ,
25
- "Tcp.CurrEstab" : "tcp.ConnectionsEstablished" ,
26
- "Tcp.InSegs" : "tcp.SegmentsReceived" ,
27
- "Tcp.OutSegs" : "tcp.SegmentsSendOut" ,
28
- "Tcp.RetransSegs" : "tcp.SegmentsTransmitted" ,
29
- "Tcp.InErrs" : "tcp.BadSegmentsReceived" ,
30
- "Tcp.OutRsts" : "tcp.ResetsSent" ,
31
- "Udp.InDatagrams" : "udp.PacketsReceived" ,
32
- "Udp.NoPorts." : "udp.PacketsToUnknownPortRecived" ,
33
- "Udp.InErrors" : "udp.PacketReceiveErrors" ,
34
- "Udp.OutDatagrams" : "udp.PacketsSent" ,
35
- "IpExt.InOctets" : "ip.InOctets" ,
36
- "IpExt.OutOctets" : "ip.OutOctets" ,
16
+ "Ip.InReceives" : "ip.TotalPacketsReceived" ,
17
+ "Ip.ForwDatagrams" : "ip.Forwarded" ,
18
+ "Ip.InDiscards" : "ip.IncomingPacketsDiscarded" ,
19
+ "Ip.InDelivers" : "ip.IncomingPacketsDelivered" ,
20
+ "Ip.OutRequests" : "ip.RequestsSentOut" ,
21
+ "Tcp.ActiveOpens" : "tcp.ActiveConnectionsOpenings" ,
22
+ "Tcp.PassiveOpens" : "tcp.PassiveConnectionsOpenings" ,
23
+ "Tcp.AttemptFails" : "tcp.FailedConnectionAttempts" ,
24
+ "Tcp.EstabResets" : "tcp.ConnectionResetsReceived" ,
25
+ "Tcp.CurrEstab" : "tcp.ConnectionsEstablished" ,
26
+ "Tcp.InSegs" : "tcp.SegmentsReceived" ,
27
+ "Tcp.OutSegs" : "tcp.SegmentsSendOut" ,
28
+ "Tcp.RetransSegs" : "tcp.SegmentsTransmitted" ,
29
+ "Tcp.InErrs" : "tcp.BadSegmentsReceived" ,
30
+ "Tcp.OutRsts" : "tcp.ResetsSent" ,
31
+ "Udp.InDatagrams" : "udp.PacketsReceived" ,
32
+ "Udp.NoPorts." : "udp.PacketsToUnknownPortRecived" ,
33
+ "Udp.InErrors" : "udp.PacketReceiveErrors" ,
34
+ "Udp.OutDatagrams" : "udp.PacketsSent" ,
35
+ "IpExt.InOctets" : "ip.InOctets" ,
36
+ "IpExt.OutOctets" : "ip.OutOctets" ,
37
37
}
38
38
39
39
type Net struct {
@@ -83,7 +83,7 @@ func (self *Net) collect2LineFile(c *MetricsCollection, name string) (e error) {
83
83
}
84
84
raw := string (b )
85
85
lines := strings .Split (raw , "\n " )
86
- for i := 0 ; i < len (lines ) - 1 ; i += 2 {
86
+ for i := 0 ; i < len (lines )- 1 ; i += 2 {
87
87
for k , v := range parse2lines (lines [i ], lines [i + 1 ]) {
88
88
if mapped , ok := mapStatMapping [k ]; ok {
89
89
c .Add (mapped , v )
@@ -101,29 +101,3 @@ func (self *Net) Collect(c *MetricsCollection) error {
101
101
}
102
102
return nil
103
103
}
104
-
105
- func (self * Net ) Keys () []string {
106
- return []string {
107
- "ip.TotalPacketsReceived" ,
108
- "ip.Forwarded" ,
109
- "ip.IncomingPacketsDiscarded" ,
110
- "ip.IncomingPacketsDelivered" ,
111
- "ip.RequestsSentOut" ,
112
- "tcp.ActiveConnectionsOpenings" ,
113
- "tcp.PassiveConnectionsOpenings" ,
114
- "tcp.FailedConnectionAttempts" ,
115
- "tcp.ConnectionResetsReceived" ,
116
- "tcp.ConnectionsEstablished" ,
117
- "tcp.SegmentsReceived" ,
118
- "tcp.SegmentsSendOut" ,
119
- "tcp.SegmentsTransmitted" ,
120
- "tcp.BadSegmentsReceived" ,
121
- "tcp.ResetsSent" ,
122
- "udp.PacketsReceived" ,
123
- "udp.PacketsToUnknownPortRecived" ,
124
- "udp.PacketReceiveErrors" ,
125
- "udp.PacketsSent" ,
126
- "ip.InOctets" ,
127
- "ip.OutOctets" ,
128
- }
129
- }
0 commit comments