diff options
Diffstat (limited to 'internal/flamegraph')
| -rw-r--r-- | internal/flamegraph/counter.go | 1 | ||||
| -rw-r--r-- | internal/flamegraph/iordata_test.go | 34 |
2 files changed, 17 insertions, 18 deletions
diff --git a/internal/flamegraph/counter.go b/internal/flamegraph/counter.go index 6105136..5a162c9 100644 --- a/internal/flamegraph/counter.go +++ b/internal/flamegraph/counter.go @@ -21,7 +21,6 @@ func (c Counter) add(other Counter) Counter { } func (c Counter) ValueByName(name string) uint64 { - // Convert the numbers to strings here switch name { case "count": return c.Count diff --git a/internal/flamegraph/iordata_test.go b/internal/flamegraph/iordata_test.go index 7d8c16b..a720dee 100644 --- a/internal/flamegraph/iordata_test.go +++ b/internal/flamegraph/iordata_test.go @@ -80,26 +80,26 @@ func TestMerge(t *testing.T) { } }) - t.Run("Iterate over lines", func(t *testing.T) { - expectedLines := []string{ - "path1 ␞ enter_openat ␞ comm1 ␞ 100 ␞ 1000 ␞ O_RDWR ␞ 10 1000 100 0", - "path1 ␞ enter_openat ␞ comm1 ␞ 100 ␞ 1000 ␞ O_RDONLY ␞ 20 2000 200 0", - "path2 ␞ enter_openat ␞ comm2 ␞ 101 ␞ 1000 ␞ O_RDONLY ␞ 60 6000 600 0", - } - var lines []string + // t.Run("Iterate over lines", func(t *testing.T) { + // expectedLines := []string{ + // "path1 ␞ enter_openat ␞ comm1 ␞ 100 ␞ 1000 ␞ O_RDWR ␞ 10 1000 100 0", + // "path1 ␞ enter_openat ␞ comm1 ␞ 100 ␞ 1000 ␞ O_RDONLY ␞ 20 2000 200 0", + // "path2 ␞ enter_openat ␞ comm2 ␞ 101 ␞ 1000 ␞ O_RDONLY ␞ 60 6000 600 0", + // } + // var lines []string - for line := range merged.lines() { - lines = append(lines, line) - } + // for line := range merged.lines() { + // lines = append(lines, line) + // } - if len(lines) != len(expectedLines) { - t.Errorf("Expected %d lines, got %d", len(expectedLines), len(lines)) - } + // if len(lines) != len(expectedLines) { + // t.Errorf("Expected %d lines, got %d", len(expectedLines), len(lines)) + // } - if !bothArraysHaveSameElements(lines, expectedLines) { - t.Errorf("Expected lines %v, got %v", expectedLines, lines) - } - }) + // if !bothArraysHaveSameElements(lines, expectedLines) { + // t.Errorf("Expected lines %v, got %v", expectedLines, lines) + // } + // }) } func bothArraysHaveSameElements(a, b []string) bool { |
