Skip to content

Commit

Permalink
poc
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-sili committed Aug 23, 2024
1 parent dadc331 commit 0b106ab
Show file tree
Hide file tree
Showing 9 changed files with 937 additions and 744 deletions.
35 changes: 35 additions & 0 deletions exporter/exporterbatcher/batcher.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Copyright The OpenTelemetry Authors
// SPDX-License-Identifier: Apache-2.0

package exporterbatcher // import "go.opentelemetry.io/collector/exporter/exporterbatcher"

// type Batcher[T any] struct {
// batches batch*

// flushTimeout int // TODO
// flushFunc func(req T) err
// }

// func (b *Batcher[T]) FlushIfNecessary() error {
// mu.Lock()

// var batchToExport
// var now = time.Now()
// if now - lastFlushTime > flushTimeout || activeBatch.size() > minBatchSize {
// lastFlushTime = now
// batchToExport = activeBatch
// activeBatch = pendingBatches[0]
// pendingBatches = pendingBatches[1:]
// }
// qc.timer.Reset(batcher.FlushTimeout)
// mu.Unlock()
// flushFunc(req)
// }


// func (b *Batcher[T]) Push(item T) error {
// if maxSize != 0 && batches[0].size() + item.size() > maxSize:
// sdlfj


// }
Loading

0 comments on commit 0b106ab

Please sign in to comment.