Skip to content

Commit

Permalink
feat(query/log): remove unused tail scan (#486)
Browse files Browse the repository at this point in the history
Signed-off-by: Gyuho Lee <[email protected]>

Signed-off-by: Gyuho Lee <[email protected]>
  • Loading branch information
gyuho authored Mar 3, 2025
1 parent b06f407 commit 7ef608d
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 103 deletions.
12 changes: 0 additions & 12 deletions pkg/query/log/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ type Poller interface {
// Returns the commands that this poller is running.
Commands() [][]string

// Tails the last N lines without polling, just by reading the file
// from the end of the file.
// Thus, the returned items are sorted by the time from new to old.
//
// Useful for investing the old dmesg logs.
// Use this to backfill events for the old logs.
//
// If select filter is none, it returns all events
// that are already filtered by the default filters
// in the configuration.
TailScan(ctx context.Context, opts ...query_log_tail.OpOption) ([]Item, error)

// Returns all the events for the given "since" time.
// If none, it returns all events that are already filtered
// by the default filters in the configuration.
Expand Down
17 changes: 0 additions & 17 deletions pkg/query/log/poller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import (
query_config "github.com/leptonai/gpud/pkg/query/config"
query_log_common "github.com/leptonai/gpud/pkg/query/log/common"
query_log_config "github.com/leptonai/gpud/pkg/query/log/config"
query_log_tail "github.com/leptonai/gpud/pkg/query/log/tail"

"github.com/nxadm/tail"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -63,14 +62,6 @@ func TestPoller(t *testing.T) {
if synced != 20 { // 20 lines
t.Fatalf("expected 20 seek info sync, got %d", synced)
}

evs, err := poller.TailScan(ctx, query_log_tail.WithLinesToTail(1000))
if err != nil {
t.Fatalf("failed to tail: %v", err)
}
if len(evs) != 20 {
t.Fatalf("expected 20 events, got %d", len(evs))
}
}

func TestPollerTail(t *testing.T) {
Expand Down Expand Up @@ -136,14 +127,6 @@ func TestPollerTail(t *testing.T) {
if synced != 2 { // 2 lines
t.Fatalf("expected 2 seek info sync, got %d", synced)
}

evs, err := poller.TailScan(ctx, query_log_tail.WithLinesToTail(1000))
if err != nil {
t.Fatalf("failed to tail: %v", err)
}
if len(evs) != 2 {
t.Fatalf("expected 2 events, got %d", len(evs))
}
}

func TestItemJSON(t *testing.T) {
Expand Down
74 changes: 0 additions & 74 deletions pkg/query/log/tail_scan.go

This file was deleted.

0 comments on commit 7ef608d

Please sign in to comment.