File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -248,10 +248,10 @@ func (s *Scanner) Scan(buf []byte) (*ScanResults, error) {
248
248
}
249
249
250
250
type ProfilingInfo struct {
251
- namespace string
252
- rule string
253
- patternMatchingTime float64
254
- conditionExecTime float64
251
+ Namespace string
252
+ Rule string
253
+ PatternMatchingTime float64
254
+ ConditionExecTime float64
255
255
}
256
256
257
257
// This is the callback called by yrx_rule_iter_patterns.
@@ -269,10 +269,10 @@ func mostExpensiveRulesCallback(
269
269
panic ("mostExpensiveRulesCallback didn't receive a *[]ProfilingInfo" )
270
270
}
271
271
* profilingInfo = append (* profilingInfo , ProfilingInfo {
272
- namespace : C .GoString (namespace ),
273
- rule : C .GoString (rule ),
274
- patternMatchingTime : float64 (patternMatchingTime ),
275
- conditionExecTime : float64 (condExecTime ),
272
+ Namespace : C .GoString (namespace ),
273
+ Rule : C .GoString (rule ),
274
+ PatternMatchingTime : float64 (patternMatchingTime ),
275
+ ConditionExecTime : float64 (condExecTime ),
276
276
})
277
277
}
278
278
Original file line number Diff line number Diff line change @@ -97,10 +97,10 @@ func TestScannerMostExpensiveRules(t *testing.T) {
97
97
_ , err := s .Scan (bytes .Repeat ([]byte ("a" ), 5000 ))
98
98
assert .NoError (t , err )
99
99
profilingInfo := s .MostExpensiveRules (1 )
100
- assert .Equal (t , "t" , profilingInfo [0 ].rule )
101
- assert .Equal (t , "default" , profilingInfo [0 ].namespace )
102
- assert .Greater (t , profilingInfo [0 ].patternMatchingTime , float64 (0 ))
103
- assert .Greater (t , profilingInfo [0 ].conditionExecTime , float64 (0 ))
100
+ assert .Equal (t , "t" , profilingInfo [0 ].Rule )
101
+ assert .Equal (t , "default" , profilingInfo [0 ].Namespace )
102
+ assert .Greater (t , profilingInfo [0 ].PatternMatchingTime , float64 (0 ))
103
+ assert .Greater (t , profilingInfo [0 ].ConditionExecTime , float64 (0 ))
104
104
}
105
105
106
106
func TestScannerMetadata (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments