Skip to content

Commit b8a43ae

Browse files
feat: use human-readable frame names instead of pipe-delimited format (#243)
1 parent 15a5f63 commit b8a43ae

7 files changed

Lines changed: 192 additions & 619 deletions

File tree

itest/integration_test.go

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,16 +177,18 @@ func queryProfile(t *testing.T, pyroscopeURL string, labelSelector string) (stri
177177
// the class name and method name both match. The .NET profiler emits frames in
178178
// the format:
179179
//
180-
// |ct:ClassName |cg:... |fn:MethodName |fg:... |sg:...
180+
// Namespace!ClassName<Generics>.MethodName<MethodGenerics>
181181
//
182+
// The "!" separates namespace from type; "." separates type from method.
182183
// Frames within a stack are separated by semicolons; stacks are separated by newlines.
183184
func frameContains(collapsed, className, methodName string) bool {
184-
re := regexp.MustCompile(
185-
`\|ct:` + regexp.QuoteMeta(className) + ` .*\|fn:` + regexp.QuoteMeta(methodName) + `[ |]`,
186-
)
187-
for _, frame := range strings.Split(collapsed, ";") {
188-
if re.MatchString(frame) {
189-
return true
185+
pattern := `(?:^|!)` + regexp.QuoteMeta(className) + `(?:<[^>]*>)?\.` + regexp.QuoteMeta(methodName) + `(?:<|;|\s|$)`
186+
re := regexp.MustCompile(pattern)
187+
for _, line := range strings.Split(collapsed, "\n") {
188+
for _, frame := range strings.Split(line, ";") {
189+
if re.MatchString(frame) {
190+
return true
191+
}
190192
}
191193
}
192194
return false

0 commit comments

Comments
 (0)