Skip to content

Commit

Permalink
removing code
Browse files Browse the repository at this point in the history
  • Loading branch information
xoscar committed Sep 27, 2024
1 parent 0b2336f commit f08751e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 24 deletions.
12 changes: 1 addition & 11 deletions agent/collector/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package collector
import (
"slices"
"sync"
"time"

gocache "github.com/Code-Hex/go-generics-cache"
"go.opentelemetry.io/otel/trace"
Expand All @@ -15,7 +14,6 @@ type TraceCache interface {
Append(string, []*v1.Span)
RemoveSpans(string, []string)
Exists(string) bool
Keys() []string
}

type traceCache struct {
Expand All @@ -32,14 +30,6 @@ func (c *traceCache) Get(traceID string) ([]*v1.Span, bool) {
return c.internalCache.Get(traceID)
}

// List implements TraceCache.
func (c *traceCache) Keys() []string {
c.mutex.Lock()
defer c.mutex.Unlock()

return c.internalCache.Keys()
}

// Append implements TraceCache.
func (c *traceCache) Append(traceID string, spans []*v1.Span) {
c.mutex.Lock()
Expand All @@ -52,7 +42,7 @@ func (c *traceCache) Append(traceID string, spans []*v1.Span) {
spans = append(existingTraces, spans...)

c.internalCache.Set(traceID, spans)
c.receivedSpans.Set(traceID, currentNumberSpans, gocache.WithExpiration(time.Minute*10))
c.receivedSpans.Set(traceID, currentNumberSpans)
}

func (c *traceCache) RemoveSpans(traceID string, spanID []string) {
Expand Down
13 changes: 0 additions & 13 deletions agent/workers/poller/inmemory_datastore.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,3 @@ func (d *inmemoryDatastore) Ready() bool {
func (d *inmemoryDatastore) ShouldRetry() bool {
return true
}

func paginate(x []traces.Trace, skip int, size int) []traces.Trace {
if skip > len(x) {
skip = len(x)
}

end := skip + size
if end > len(x) {
end = len(x)
}

return x[skip:end]
}

0 comments on commit f08751e

Please sign in to comment.