@@ -103,9 +103,9 @@ func TestInterpret(t *testing.T) {
103
103
expected1 := InterpretedField {Name : "" , FieldID : 12 , EnterpriseID : 15397 , RawValue : []byte {0 , 0 , 0 , 0 }}
104
104
105
105
fl := i .Interpret (msg .DataRecords [0 ])
106
- for _ , f := range fl {
107
- t .Logf ("%#v" , f )
108
- }
106
+ // for _, f := range fl {
107
+ // t.Logf("%#v", f)
108
+ // }
109
109
if ! reflect .DeepEqual (fl [0 ], expected0 ) {
110
110
t .Error (fl [0 ], "!=\n " , expected0 )
111
111
}
@@ -114,9 +114,9 @@ func TestInterpret(t *testing.T) {
114
114
}
115
115
116
116
fl = i .InterpretInto (msg .DataRecords [0 ], make ([]InterpretedField , len (fl )))
117
- for _ , f := range fl {
118
- t .Logf ("%#v" , f )
119
- }
117
+ // for _, f := range fl {
118
+ // t.Logf("%#v", f)
119
+ // }
120
120
if ! reflect .DeepEqual (fl [0 ], expected0 ) {
121
121
t .Error (fl [0 ], "!=\n " , expected0 )
122
122
}
@@ -137,6 +137,7 @@ func BenchmarkInterpret(b *testing.B) {
137
137
if err != nil {
138
138
b .Fatal ("ParseReader failed" , err )
139
139
}
140
+ addCustomFields (i )
140
141
141
142
pb .Write (p1 )
142
143
msg , err := p .ParseReader (pb )
@@ -168,6 +169,7 @@ func BenchmarkInterpretInto(b *testing.B) {
168
169
if err != nil {
169
170
b .Fatal ("ParseReader failed" , err )
170
171
}
172
+ addCustomFields (i )
171
173
172
174
pb .Write (p1 )
173
175
msg , err := p .ParseReader (pb )
@@ -187,3 +189,42 @@ func BenchmarkInterpretInto(b *testing.B) {
187
189
}
188
190
}
189
191
}
192
+
193
+ func addCustomFields (i * Interpreter ) {
194
+ i .AddDictionaryEntry (DictionaryEntry {
195
+ Name : "proceraService" ,
196
+ Type : String ,
197
+ EnterpriseID : 15397 ,
198
+ FieldID : 1 ,
199
+ })
200
+ i .AddDictionaryEntry (DictionaryEntry {
201
+ Name : "proceraIncomingOctets" ,
202
+ Type : Uint64 ,
203
+ EnterpriseID : 15397 ,
204
+ FieldID : 3 ,
205
+ })
206
+ i .AddDictionaryEntry (DictionaryEntry {
207
+ Name : "proceraOutgoingOctets" ,
208
+ Type : Uint64 ,
209
+ EnterpriseID : 15397 ,
210
+ FieldID : 4 ,
211
+ })
212
+ i .AddDictionaryEntry (DictionaryEntry {
213
+ Name : "proceraExternalRtt" ,
214
+ Type : Uint32 ,
215
+ EnterpriseID : 15397 ,
216
+ FieldID : 12 ,
217
+ })
218
+ i .AddDictionaryEntry (DictionaryEntry {
219
+ Name : "proceraServerHostname" ,
220
+ Type : String ,
221
+ EnterpriseID : 15397 ,
222
+ FieldID : 18 ,
223
+ })
224
+ i .AddDictionaryEntry (DictionaryEntry {
225
+ Name : "proceraSubscriberId" ,
226
+ Type : String ,
227
+ EnterpriseID : 15397 ,
228
+ FieldID : 28 ,
229
+ })
230
+ }
0 commit comments