Skip to content

Commit

Permalink
pick up blob once
Browse files Browse the repository at this point in the history
  • Loading branch information
jianoaix committed Oct 9, 2024
1 parent f6b9b04 commit 4b69aa6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions disperser/batcher/encoding_streamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ type EncodingStreamer struct {
exclusiveStartKey *disperser.BlobStoreExclusiveStartKey

aBlobAge *prometheus.SummaryVec

blobKeys map[string]struct{}
}

type batch struct {
Expand Down Expand Up @@ -265,6 +267,12 @@ func (e *EncodingStreamer) RequestEncoding(ctx context.Context, encoderChan chan

for i := range metadatas {
metadata := metadatas[i]

if _, ok := e.blobKeys[metadata.GetBlobKey().String()]; ok {
continue
}
e.blobKeys[metadata.GetBlobKey().String()] = struct{}{}

requestTime := time.Unix(0, int64(metadata.RequestMetadata.RequestedAt))
e.logger.Info("encoding_requested age - picked up blobmetadata", "age", time.Since(requestTime).String(), "blob size bytes", metadata.RequestMetadata.BlobSize, "blob key", metadata.GetBlobKey().String())
if float64(time.Since(requestTime).Milliseconds()) > 2000 {
Expand Down

0 comments on commit 4b69aa6

Please sign in to comment.