diff options
| author | Paul Buetow <paul@buetow.org> | 2026-03-05 23:53:01 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-03-05 23:53:01 +0200 |
| commit | acd91c7c11658360e0540f9d550f1fe0da167109 (patch) | |
| tree | 2117c92bb17a1ffa3da8a09f93e614976c2fc375 | |
| parent | f6135befedb7da8603ecff2c59b155effd0183db (diff) | |
Normalize Go import grouping with local ior section
50 files changed, 195 insertions, 146 deletions
diff --git a/integrationtests/cmd/ioworkload/scenario_rename.go b/integrationtests/cmd/ioworkload/scenario_rename.go index d2e76b1..685157b 100644 --- a/integrationtests/cmd/ioworkload/scenario_rename.go +++ b/integrationtests/cmd/ioworkload/scenario_rename.go @@ -9,8 +9,8 @@ import ( ) const ( - sysRenameat2 = 316 // SYS_RENAMEAT2 on amd64 - renameNoreplaceFlag = 1 // RENAME_NOREPLACE + sysRenameat2 = 316 // SYS_RENAMEAT2 on amd64 + renameNoreplaceFlag = 1 // RENAME_NOREPLACE ) // renameBasic creates a file and renames it via rename(2). diff --git a/integrationtests/expectations.go b/integrationtests/expectations.go index 21a5bda..36fdf6e 100644 --- a/integrationtests/expectations.go +++ b/integrationtests/expectations.go @@ -1,9 +1,10 @@ package integrationtests import ( - "ior/internal/flamegraph" "strings" "testing" + + "ior/internal/flamegraph" ) // ExpectedEvent describes an I/O event that should appear in the test output. diff --git a/integrationtests/expectations_test.go b/integrationtests/expectations_test.go index fd06e31..9630cf9 100644 --- a/integrationtests/expectations_test.go +++ b/integrationtests/expectations_test.go @@ -1,9 +1,10 @@ package integrationtests import ( + "testing" + "ior/internal/flamegraph" "ior/internal/types" - "testing" ) func TestAssertEventsAbsentNoMatch(t *testing.T) { diff --git a/integrationtests/parse.go b/integrationtests/parse.go index cebb0ba..bf4f0bf 100644 --- a/integrationtests/parse.go +++ b/integrationtests/parse.go @@ -2,6 +2,7 @@ package integrationtests import ( "fmt" + "ior/internal/flamegraph" ) diff --git a/integrationtests/parse_test.go b/integrationtests/parse_test.go index 6425298..65781a5 100644 --- a/integrationtests/parse_test.go +++ b/integrationtests/parse_test.go @@ -3,13 +3,14 @@ package integrationtests import ( "bytes" "encoding/gob" - "ior/internal/file" - "ior/internal/flamegraph" - "ior/internal/types" "os" "path/filepath" "testing" + "ior/internal/file" + "ior/internal/flamegraph" + "ior/internal/types" + "github.com/DataDog/zstd" ) diff --git a/internal/event/event.go b/internal/event/event.go index 165ffe3..7ec76c3 100644 --- a/internal/event/event.go +++ b/internal/event/event.go @@ -1,8 +1,9 @@ package event import ( - . "ior/internal/types" "sync" + + . "ior/internal/types" ) var poolOfEventPairs = sync.Pool{ diff --git a/internal/event/pair.go b/internal/event/pair.go index 1d1e9ce..4ad4d4f 100644 --- a/internal/event/pair.go +++ b/internal/event/pair.go @@ -2,10 +2,11 @@ package event import ( "fmt" - "ior/internal/file" - "ior/internal/types" "strconv" "strings" + + "ior/internal/file" + "ior/internal/types" ) // Pair represents a matched syscall enter/exit pair together with derived metadata. diff --git a/internal/event/pair_test.go b/internal/event/pair_test.go index a1cb8ab..43e9945 100644 --- a/internal/event/pair_test.go +++ b/internal/event/pair_test.go @@ -1,8 +1,9 @@ package event import ( - "ior/internal/types" "testing" + + "ior/internal/types" ) func TestPairCalculateDurationsFirstEvent(t *testing.T) { diff --git a/internal/eventfilter.go b/internal/eventfilter.go index 4ff0385..1e87fea 100644 --- a/internal/eventfilter.go +++ b/internal/eventfilter.go @@ -2,9 +2,10 @@ package internal import ( "fmt" + "strings" + "ior/internal/event" "ior/internal/types" - "strings" ) type eventFilter struct { diff --git a/internal/eventloop_filter_test.go b/internal/eventloop_filter_test.go index c3eef1f..e6e3b45 100644 --- a/internal/eventloop_filter_test.go +++ b/internal/eventloop_filter_test.go @@ -3,12 +3,13 @@ package internal import ( "context" "fmt" + "testing" + "time" + "ior/internal/event" "ior/internal/file" "ior/internal/flamegraph" "ior/internal/types" - "testing" - "time" ) // Test that comm names are properly propagated across syscalls diff --git a/internal/file/file.go b/internal/file/file.go index b1bd84c..08e0bee 100644 --- a/internal/file/file.go +++ b/internal/file/file.go @@ -4,10 +4,11 @@ import ( "bufio" "bytes" "fmt" - "ior/internal/types" "os" "strconv" "strings" + + "ior/internal/types" ) type File interface { diff --git a/internal/file/file_test.go b/internal/file/file_test.go index 684a7d8..f9025fe 100644 --- a/internal/file/file_test.go +++ b/internal/file/file_test.go @@ -1,108 +1,109 @@ package file import ( - "ior/internal/types" "strings" "syscall" "testing" + + "ior/internal/types" ) func TestStringValue(t *testing.T) { - var array [128]byte - copy(array[:], "test string") + var array [128]byte + copy(array[:], "test string") - if str := types.StringValue(array[:]); str != "test string" { - t.Errorf("epxected 'test string' but got '%s' with bytes '%v'", str, []byte(str)) - } + if str := types.StringValue(array[:]); str != "test string" { + t.Errorf("epxected 'test string' but got '%s' with bytes '%v'", str, []byte(str)) + } } func TestNewFdUnknownFlags(t *testing.T) { - fdFile := NewFd(1, "test.txt", -1) - if fdFile.Flags() != unknownFlag { - t.Errorf("expected unknown flags, got %v", fdFile.Flags()) - } + fdFile := NewFd(1, "test.txt", -1) + if fdFile.Flags() != unknownFlag { + t.Errorf("expected unknown flags, got %v", fdFile.Flags()) + } } func TestNewFdEmptyName(t *testing.T) { - fdFile := NewFd(1, "", 0) - str := fdFile.String() - if !strings.Contains(str, "E:name") { - t.Errorf("expected String() to contain 'E:name' for empty name, got '%s'", str) - } + fdFile := NewFd(1, "", 0) + str := fdFile.String() + if !strings.Contains(str, "E:name") { + t.Errorf("expected String() to contain 'E:name' for empty name, got '%s'", str) + } } func TestFlagsIsUnknown(t *testing.T) { - f := unknownFlag - if f.Is(syscall.O_RDONLY) { - t.Errorf("expected Is(O_RDONLY) to be false for unknownFlag") - } - if f.Is(syscall.O_WRONLY) { - t.Errorf("expected Is(O_WRONLY) to be false for unknownFlag") - } - if f.Is(syscall.O_RDWR) { - t.Errorf("expected Is(O_RDWR) to be false for unknownFlag") - } + f := unknownFlag + if f.Is(syscall.O_RDONLY) { + t.Errorf("expected Is(O_RDONLY) to be false for unknownFlag") + } + if f.Is(syscall.O_WRONLY) { + t.Errorf("expected Is(O_WRONLY) to be false for unknownFlag") + } + if f.Is(syscall.O_RDWR) { + t.Errorf("expected Is(O_RDWR) to be false for unknownFlag") + } } func TestFlagsStringUnknown(t *testing.T) { - f := Flags(-1) - if f.String() != "O_NONE" { - t.Errorf("expected 'O_NONE' for unknown flags, got '%s'", f.String()) - } + f := Flags(-1) + if f.String() != "O_NONE" { + t.Errorf("expected 'O_NONE' for unknown flags, got '%s'", f.String()) + } } func TestNewOldnameNewnameEmpty(t *testing.T) { - var oldname, newname [128]byte - f := NewOldnameNewname(oldname[:], newname[:]) - if f.Name() != "" { - t.Errorf("expected empty Name(), got '%s'", f.Name()) - } - if !strings.Contains(f.String(), "old:") || !strings.Contains(f.String(), "->new:") { - t.Errorf("expected String() to contain 'old:' and '->new:', got '%s'", f.String()) - } + var oldname, newname [128]byte + f := NewOldnameNewname(oldname[:], newname[:]) + if f.Name() != "" { + t.Errorf("expected empty Name(), got '%s'", f.Name()) + } + if !strings.Contains(f.String(), "old:") || !strings.Contains(f.String(), "->new:") { + t.Errorf("expected String() to contain 'old:' and '->new:', got '%s'", f.String()) + } } func TestNewPathnameEmpty(t *testing.T) { - var pathname [128]byte - f := NewPathname(pathname[:]) - if f.Name() != "" { - t.Errorf("expected empty Name(), got '%s'", f.Name()) - } - if !strings.Contains(f.String(), "pathname:") { - t.Errorf("expected String() to contain 'pathname:', got '%s'", f.String()) - } + var pathname [128]byte + f := NewPathname(pathname[:]) + if f.Name() != "" { + t.Errorf("expected empty Name(), got '%s'", f.Name()) + } + if !strings.Contains(f.String(), "pathname:") { + t.Errorf("expected String() to contain 'pathname:', got '%s'", f.String()) + } } func TestFdFileSetFlags(t *testing.T) { - fdFile := NewFd(1, "test.txt", 0) - if fdFile.Flags() != Flags(0) { - t.Errorf("expected flags 0, got %v", fdFile.Flags()) - } - fdFile.SetFlags(syscall.O_WRONLY) - if fdFile.Flags() != Flags(syscall.O_WRONLY) { - t.Errorf("expected O_WRONLY after SetFlags, got %v", fdFile.Flags()) - } + fdFile := NewFd(1, "test.txt", 0) + if fdFile.Flags() != Flags(0) { + t.Errorf("expected flags 0, got %v", fdFile.Flags()) + } + fdFile.SetFlags(syscall.O_WRONLY) + if fdFile.Flags() != Flags(syscall.O_WRONLY) { + t.Errorf("expected O_WRONLY after SetFlags, got %v", fdFile.Flags()) + } } func TestFdFileAddFlags(t *testing.T) { - fdFile := NewFd(1, "test.txt", syscall.O_RDWR) - fdFile.AddFlags(syscall.O_APPEND) - expected := Flags(syscall.O_RDWR | syscall.O_APPEND) - if fdFile.Flags() != expected { - t.Errorf("expected O_RDWR|O_APPEND after AddFlags, got %v", fdFile.Flags()) - } + fdFile := NewFd(1, "test.txt", syscall.O_RDWR) + fdFile.AddFlags(syscall.O_APPEND) + expected := Flags(syscall.O_RDWR | syscall.O_APPEND) + if fdFile.Flags() != expected { + t.Errorf("expected O_RDWR|O_APPEND after AddFlags, got %v", fdFile.Flags()) + } } func TestFdFileDup(t *testing.T) { - fdFile := NewFd(1, "original.txt", syscall.O_RDONLY) - duped := fdFile.Dup(42) - if duped.Name() != "original.txt" { - t.Errorf("expected duped name 'original.txt', got '%s'", duped.Name()) - } - if !strings.Contains(duped.String(), "42") { - t.Errorf("expected duped String() to contain fd 42, got '%s'", duped.String()) - } - if strings.Contains(duped.String(), "%(1,") { - t.Errorf("expected duped String() to NOT contain old fd 1, got '%s'", duped.String()) - } + fdFile := NewFd(1, "original.txt", syscall.O_RDONLY) + duped := fdFile.Dup(42) + if duped.Name() != "original.txt" { + t.Errorf("expected duped name 'original.txt', got '%s'", duped.Name()) + } + if !strings.Contains(duped.String(), "42") { + t.Errorf("expected duped String() to contain fd 42, got '%s'", duped.String()) + } + if strings.Contains(duped.String(), "%(1,") { + t.Errorf("expected duped String() to NOT contain old fd 1, got '%s'", duped.String()) + } } diff --git a/internal/flamegraph/counter.go b/internal/flamegraph/counter.go index ae727d4..539d017 100644 --- a/internal/flamegraph/counter.go +++ b/internal/flamegraph/counter.go @@ -10,6 +10,7 @@ import ( // - Duration is the syscall runtime on the same thread. // - DurationToPrev is the inter-syscall gap on the same thread and is attributed // to the current node; there is no separate "idle" pseudo-node. +// // Bytes is only populated for read/write/transfer syscalls. type Counter struct { Count uint64 diff --git a/internal/flamegraph/iordata.go b/internal/flamegraph/iordata.go index 61a65a9..13b78fd 100644 --- a/internal/flamegraph/iordata.go +++ b/internal/flamegraph/iordata.go @@ -5,14 +5,15 @@ import ( "encoding/gob" "fmt" "io" - "ior/internal/event" - "ior/internal/file" - "ior/internal/types" "iter" "os" "strings" "time" + "ior/internal/event" + "ior/internal/file" + "ior/internal/types" + // Is there a zstd library part of Go 1.25 "github.com/DataDog/zstd" ) diff --git a/internal/flamegraph/iordata_test.go b/internal/flamegraph/iordata_test.go index 54f1ed5..5e95976 100644 --- a/internal/flamegraph/iordata_test.go +++ b/internal/flamegraph/iordata_test.go @@ -2,9 +2,10 @@ package flamegraph import ( "bytes" - "ior/internal/types" "syscall" "testing" + + "ior/internal/types" ) func counterAt(iod iorData, path pathType, traceID traceIdType, comm commType, pid pidType, tid tidType, flags flagsType) (Counter, bool) { diff --git a/internal/flamegraph/iordatacollector.go b/internal/flamegraph/iordatacollector.go index 9e92b63..a2ae731 100644 --- a/internal/flamegraph/iordatacollector.go +++ b/internal/flamegraph/iordatacollector.go @@ -3,9 +3,10 @@ package flamegraph import ( "context" "fmt" - "ior/internal/event" "runtime" "sync" + + "ior/internal/event" ) type IorDataCollector struct { diff --git a/internal/flamegraph/livetrie.go b/internal/flamegraph/livetrie.go index 100e03b..db46af5 100644 --- a/internal/flamegraph/livetrie.go +++ b/internal/flamegraph/livetrie.go @@ -3,12 +3,13 @@ package flamegraph import ( "encoding/json" "fmt" - "ior/internal/event" "slices" "sort" "strings" "sync" "sync/atomic" + + "ior/internal/event" ) const liveTrieMinFraction = 0.001 diff --git a/internal/flamegraph/livetrie_test.go b/internal/flamegraph/livetrie_test.go index 1315c71..e569e00 100644 --- a/internal/flamegraph/livetrie_test.go +++ b/internal/flamegraph/livetrie_test.go @@ -4,15 +4,16 @@ import ( "bytes" "encoding/json" "fmt" - "ior/internal/event" - "ior/internal/file" - "ior/internal/types" "os" "runtime" "sync" "sync/atomic" "testing" "time" + + "ior/internal/event" + "ior/internal/file" + "ior/internal/types" ) func TestLiveTrieIngestAndSnapshotRoundTrip(t *testing.T) { diff --git a/internal/flamegraph/worker.go b/internal/flamegraph/worker.go index 0f49568..1e8c639 100644 --- a/internal/flamegraph/worker.go +++ b/internal/flamegraph/worker.go @@ -2,8 +2,9 @@ package flamegraph import ( "context" - "ior/internal/event" "sync" + + "ior/internal/event" ) type worker struct { diff --git a/internal/statsengine/bench_test.go b/internal/statsengine/bench_test.go index 27f17b1..646bdda 100644 --- a/internal/statsengine/bench_test.go +++ b/internal/statsengine/bench_test.go @@ -1,10 +1,11 @@ package statsengine import ( - "ior/internal/types" "math/rand" "testing" "time" + + "ior/internal/types" ) func BenchmarkSyscallAccumulatorSnapshot(b *testing.B) { diff --git a/internal/statsengine/engine.go b/internal/statsengine/engine.go index 1ef58cf..fb85558 100644 --- a/internal/statsengine/engine.go +++ b/internal/statsengine/engine.go @@ -1,11 +1,12 @@ package statsengine import ( - "ior/internal/event" - "ior/internal/types" "math" "sync" "time" + + "ior/internal/event" + "ior/internal/types" ) const trendWindowSlots = 20 diff --git a/internal/statsengine/engine_test.go b/internal/statsengine/engine_test.go index 943fe9c..7ba8c3a 100644 --- a/internal/statsengine/engine_test.go +++ b/internal/statsengine/engine_test.go @@ -1,12 +1,13 @@ package statsengine import ( - "ior/internal/event" - "ior/internal/file" - "ior/internal/types" "math" "testing" "time" + + "ior/internal/event" + "ior/internal/file" + "ior/internal/types" ) type fakeClock struct { diff --git a/internal/statsengine/filerank.go b/internal/statsengine/filerank.go index 6e8f27f..dd83e8d 100644 --- a/internal/statsengine/filerank.go +++ b/internal/statsengine/filerank.go @@ -2,9 +2,10 @@ package statsengine import ( "container/heap" + "sort" + "ior/internal/event" "ior/internal/types" - "sort" ) const fileRankTopNDefault = 20 diff --git a/internal/statsengine/filerank_test.go b/internal/statsengine/filerank_test.go index 26a0b23..bec5eae 100644 --- a/internal/statsengine/filerank_test.go +++ b/internal/statsengine/filerank_test.go @@ -2,11 +2,12 @@ package statsengine import ( "fmt" + "reflect" + "testing" + "ior/internal/event" "ior/internal/file" "ior/internal/types" - "reflect" - "testing" ) func TestFileRankerHeapEviction(t *testing.T) { diff --git a/internal/statsengine/process.go b/internal/statsengine/process.go index e677744..b00a4bb 100644 --- a/internal/statsengine/process.go +++ b/internal/statsengine/process.go @@ -1,9 +1,10 @@ package statsengine import ( - "ior/internal/event" "sort" "time" + + "ior/internal/event" ) const processRankTopNDefault = 20 diff --git a/internal/statsengine/process_test.go b/internal/statsengine/process_test.go index aa3c5d2..77e7a0a 100644 --- a/internal/statsengine/process_test.go +++ b/internal/statsengine/process_test.go @@ -1,11 +1,12 @@ package statsengine import ( - "ior/internal/event" - "ior/internal/types" "math" "testing" "time" + + "ior/internal/event" + "ior/internal/types" ) func TestProcessAccumulatorBasicStats(t *testing.T) { diff --git a/internal/statsengine/snapshot.go b/internal/statsengine/snapshot.go index 8c9656e..f2b617b 100644 --- a/internal/statsengine/snapshot.go +++ b/internal/statsengine/snapshot.go @@ -1,9 +1,10 @@ package statsengine import ( - "ior/internal/types" "slices" "time" + + "ior/internal/types" ) // TrendDirection is the direction of a time-window comparison. diff --git a/internal/statsengine/syscall.go b/internal/statsengine/syscall.go index 6c34f4a..4feeab2 100644 --- a/internal/statsengine/syscall.go +++ b/internal/statsengine/syscall.go @@ -1,12 +1,13 @@ package statsengine import ( - "ior/internal/event" - "ior/internal/types" "math" "math/rand" "sort" "time" + + "ior/internal/event" + "ior/internal/types" ) const syscallReservoirSampleCapDefault = 10_000 diff --git a/internal/statsengine/syscall_test.go b/internal/statsengine/syscall_test.go index 1ebe214..b315bd8 100644 --- a/internal/statsengine/syscall_test.go +++ b/internal/statsengine/syscall_test.go @@ -1,12 +1,13 @@ package statsengine import ( - "ior/internal/event" - "ior/internal/types" "math" "math/rand" "testing" "time" + + "ior/internal/event" + "ior/internal/types" ) func TestSyscallAccumulatorBasicStats(t *testing.T) { diff --git a/internal/tui/dashboard/files.go b/internal/tui/dashboard/files.go index 0393553..d43e215 100644 --- a/internal/tui/dashboard/files.go +++ b/internal/tui/dashboard/files.go @@ -2,11 +2,12 @@ package dashboard import ( "fmt" - "ior/internal/statsengine" "path/filepath" "sort" "strconv" + "ior/internal/statsengine" + "charm.land/bubbles/v2/table" ) diff --git a/internal/tui/dashboard/histogram.go b/internal/tui/dashboard/histogram.go index 3511dfb..28f5b2b 100644 --- a/internal/tui/dashboard/histogram.go +++ b/internal/tui/dashboard/histogram.go @@ -2,11 +2,12 @@ package dashboard import ( "fmt" - "ior/internal/statsengine" - common "ior/internal/tui/common" "math" "strconv" "strings" + + "ior/internal/statsengine" + common "ior/internal/tui/common" ) func renderLatencyTab(snap *statsengine.Snapshot, width, height int) string { diff --git a/internal/tui/dashboard/model.go b/internal/tui/dashboard/model.go index 24b6c8e..4cf7c15 100644 --- a/internal/tui/dashboard/model.go +++ b/internal/tui/dashboard/model.go @@ -1,14 +1,15 @@ package dashboard import ( + "strings" + "time" + coreflamegraph "ior/internal/flamegraph" "ior/internal/statsengine" common "ior/internal/tui/common" "ior/internal/tui/eventstream" flamegraphtui "ior/internal/tui/flamegraph" "ior/internal/tui/messages" - "strings" - "time" "charm.land/bubbles/v2/key" tea "charm.land/bubbletea/v2" diff --git a/internal/tui/dashboard/overview.go b/internal/tui/dashboard/overview.go index 866c5bb..24932b9 100644 --- a/internal/tui/dashboard/overview.go +++ b/internal/tui/dashboard/overview.go @@ -2,12 +2,13 @@ package dashboard import ( "fmt" - "ior/internal/statsengine" - common "ior/internal/tui/common" "strings" "time" "unicode/utf8" + "ior/internal/statsengine" + common "ior/internal/tui/common" + "charm.land/lipgloss/v2" ) diff --git a/internal/tui/dashboard/processes.go b/internal/tui/dashboard/processes.go index a9de382..a5e8d79 100644 --- a/internal/tui/dashboard/processes.go +++ b/internal/tui/dashboard/processes.go @@ -2,10 +2,11 @@ package dashboard import ( "fmt" - "ior/internal/statsengine" "strconv" "strings" + "ior/internal/statsengine" + "charm.land/bubbles/v2/table" ) diff --git a/internal/tui/dashboard/syscalls.go b/internal/tui/dashboard/syscalls.go index 31f719e..87acc80 100644 --- a/internal/tui/dashboard/syscalls.go +++ b/internal/tui/dashboard/syscalls.go @@ -2,10 +2,11 @@ package dashboard import ( "fmt" - "ior/internal/statsengine" "strconv" "time" + "ior/internal/statsengine" + "charm.land/bubbles/v2/table" ) diff --git a/internal/tui/dashboard/tabs.go b/internal/tui/dashboard/tabs.go index 85ce319..5d15acc 100644 --- a/internal/tui/dashboard/tabs.go +++ b/internal/tui/dashboard/tabs.go @@ -2,10 +2,11 @@ package dashboard import ( "fmt" - common "ior/internal/tui/common" "strings" "unicode/utf8" + common "ior/internal/tui/common" + "charm.land/lipgloss/v2" ) diff --git a/internal/tui/eventstream/render.go b/internal/tui/eventstream/render.go index f93a63d..3ec4d65 100644 --- a/internal/tui/eventstream/render.go +++ b/internal/tui/eventstream/render.go @@ -2,10 +2,11 @@ package eventstream import ( "fmt" - "ior/internal/tui/common" "strconv" "strings" + "ior/internal/tui/common" + "charm.land/lipgloss/v2" ) diff --git a/internal/tui/eventstream/streamevent.go b/internal/tui/eventstream/streamevent.go index dbe04dd..5f1e27f 100644 --- a/internal/tui/eventstream/streamevent.go +++ b/internal/tui/eventstream/streamevent.go @@ -1,9 +1,10 @@ package eventstream import ( + "time" + "ior/internal/event" "ior/internal/types" - "time" ) type StreamEvent struct { diff --git a/internal/tui/eventstream/streamevent_test.go b/internal/tui/eventstream/streamevent_test.go index 6131fed..dd65dd1 100644 --- a/internal/tui/eventstream/streamevent_test.go +++ b/internal/tui/eventstream/streamevent_test.go @@ -1,10 +1,11 @@ package eventstream import ( + "testing" + "ior/internal/event" "ior/internal/file" "ior/internal/types" - "testing" ) func TestNewStreamEventPopulatesFields(t *testing.T) { diff --git a/internal/tui/flamegraph/bench_test.go b/internal/tui/flamegraph/bench_test.go index c000ac0..05c6526 100644 --- a/internal/tui/flamegraph/bench_test.go +++ b/internal/tui/flamegraph/bench_test.go @@ -3,9 +3,10 @@ package flamegraph import ( "encoding/json" "fmt" + "testing" + coreflamegraph "ior/internal/flamegraph" "ior/internal/types" - "testing" "github.com/charmbracelet/harmonica" ) diff --git a/internal/tui/flamegraph/controls.go b/internal/tui/flamegraph/controls.go index 240ba90..b0a2933 100644 --- a/internal/tui/flamegraph/controls.go +++ b/internal/tui/flamegraph/controls.go @@ -2,9 +2,10 @@ package flamegraph import ( "fmt" - common "ior/internal/tui/common" "strings" + common "ior/internal/tui/common" + "charm.land/lipgloss/v2" ) diff --git a/internal/tui/flamegraph/model.go b/internal/tui/flamegraph/model.go index 5d101c2..bbf4af3 100644 --- a/internal/tui/flamegraph/model.go +++ b/internal/tui/flamegraph/model.go @@ -4,11 +4,12 @@ import ( "encoding/json" "fmt" "image/color" - coreflamegraph "ior/internal/flamegraph" - common "ior/internal/tui/common" "sort" "time" + coreflamegraph "ior/internal/flamegraph" + common "ior/internal/tui/common" + "charm.land/bubbles/v2/key" "charm.land/bubbles/v2/textinput" tea "charm.land/bubbletea/v2" diff --git a/internal/tui/flamegraph/model_test.go b/internal/tui/flamegraph/model_test.go index 51ce96d..8bd1b79 100644 --- a/internal/tui/flamegraph/model_test.go +++ b/internal/tui/flamegraph/model_test.go @@ -1,10 +1,11 @@ package flamegraph import ( - coreflamegraph "ior/internal/flamegraph" "reflect" "testing" + coreflamegraph "ior/internal/flamegraph" + tea "charm.land/bubbletea/v2" ) diff --git a/internal/tui/flamegraph/renderer.go b/internal/tui/flamegraph/renderer.go index 9f31023..f06f6bc 100644 --- a/internal/tui/flamegraph/renderer.go +++ b/internal/tui/flamegraph/renderer.go @@ -4,12 +4,13 @@ import ( "fmt" "hash/fnv" "image/color" - common "ior/internal/tui/common" "math" "sort" "strings" "unicode/utf8" + common "ior/internal/tui/common" + "charm.land/lipgloss/v2" ) diff --git a/internal/tui/flamegraph/stress_test.go b/internal/tui/flamegraph/stress_test.go index bcac561..d2bd74a 100644 --- a/internal/tui/flamegraph/stress_test.go +++ b/internal/tui/flamegraph/stress_test.go @@ -3,13 +3,14 @@ package flamegraph import ( "encoding/json" "fmt" - coreflamegraph "ior/internal/flamegraph" - "ior/internal/types" "math/rand" "sync" "testing" "time" + coreflamegraph "ior/internal/flamegraph" + "ior/internal/types" + tea "charm.land/bubbletea/v2" ) diff --git a/internal/tui/pidpicker/model.go b/internal/tui/pidpicker/model.go index cfd0c0f..f4bb414 100644 --- a/internal/tui/pidpicker/model.go +++ b/internal/tui/pidpicker/model.go @@ -2,9 +2,10 @@ package pidpicker import ( "fmt" + "strings" + common "ior/internal/tui/common" "ior/internal/tui/messages" - "strings" "charm.land/bubbles/v2/key" "charm.land/bubbles/v2/textinput" diff --git a/internal/tui/pidpicker/model_test.go b/internal/tui/pidpicker/model_test.go index 038575b..695e5bd 100644 --- a/internal/tui/pidpicker/model_test.go +++ b/internal/tui/pidpicker/model_test.go @@ -1,10 +1,11 @@ package pidpicker import ( - "ior/internal/tui/messages" "strings" "testing" + "ior/internal/tui/messages" + tea "charm.land/bubbletea/v2" ) diff --git a/internal/tui/probes/model.go b/internal/tui/probes/model.go index 7da27db..baf22e8 100644 --- a/internal/tui/probes/model.go +++ b/internal/tui/probes/model.go @@ -2,10 +2,11 @@ package probes import ( "fmt" - "ior/internal/probemanager" "strings" "unicode/utf8" + "ior/internal/probemanager" + "charm.land/bubbles/v2/textinput" tea "charm.land/bubbletea/v2" "charm.land/lipgloss/v2" diff --git a/internal/tui/tui.go b/internal/tui/tui.go index 328202e..7918c0f 100644 --- a/internal/tui/tui.go +++ b/internal/tui/tui.go @@ -5,6 +5,12 @@ import ( "encoding/csv" "errors" "fmt" + "log" + "os" + "strings" + "sync" + "time" + "ior/internal/flags" coreflamegraph "ior/internal/flamegraph" "ior/internal/probemanager" @@ -16,11 +22,6 @@ import ( "ior/internal/tui/messages" "ior/internal/tui/pidpicker" "ior/internal/tui/probes" - "log" - "os" - "strings" - "sync" - "time" "charm.land/bubbles/v2/key" "charm.land/bubbles/v2/spinner" diff --git a/internal/tui/tui_test.go b/internal/tui/tui_test.go index 876fe8f..7d2a439 100644 --- a/internal/tui/tui_test.go +++ b/internal/tui/tui_test.go @@ -3,6 +3,12 @@ package tui import ( "context" "errors" + "os" + "path/filepath" + "strings" + "testing" + "time" + coreflamegraph "ior/internal/flamegraph" "ior/internal/probemanager" "ior/internal/statsengine" @@ -10,11 +16,6 @@ import ( "ior/internal/tui/eventstream" tuiexport "ior/internal/tui/export" "ior/internal/tui/messages" - "os" - "path/filepath" - "strings" - "testing" - "time" "ior/internal/flags" "ior/internal/tui/probes" |
