Skip to content

Commit 9ab962a

Browse files
committed
chore(go): export fields in ProfilingInfo structure.
1 parent 18b2f1a commit 9ab962a

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

go/scanner.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,10 @@ func (s *Scanner) Scan(buf []byte) (*ScanResults, error) {
248248
}
249249

250250
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
255255
}
256256

257257
// This is the callback called by yrx_rule_iter_patterns.
@@ -269,10 +269,10 @@ func mostExpensiveRulesCallback(
269269
panic("mostExpensiveRulesCallback didn't receive a *[]ProfilingInfo")
270270
}
271271
*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),
276276
})
277277
}
278278

go/scanner_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,10 @@ func TestScannerMostExpensiveRules(t *testing.T) {
9797
_, err := s.Scan(bytes.Repeat([]byte("a"), 5000))
9898
assert.NoError(t, err)
9999
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))
104104
}
105105

106106
func TestScannerMetadata(t *testing.T) {

0 commit comments

Comments
 (0)