| Index: logdog/client/butler/bundler/bundler.go
|
| diff --git a/logdog/client/butler/bundler/bundler.go b/logdog/client/butler/bundler/bundler.go
|
| index eaff529d4062a5fc8a3434a770616d2229a80255..f6cb3e9f3a7f63ed6836ff8757aea05524b20a4f 100644
|
| --- a/logdog/client/butler/bundler/bundler.go
|
| +++ b/logdog/client/butler/bundler/bundler.go
|
| @@ -52,6 +52,7 @@ type bundlerStream interface {
|
| name() string
|
| expireTime() (time.Time, bool)
|
| nextBundleEntry(*builder, bool) bool
|
| + streamDesc() *logpb.LogStreamDescriptor
|
| }
|
|
|
| // Bundler is the main Bundler instance. It exposes goroutine-safe endpoints for
|
| @@ -141,6 +142,26 @@ func (b *Bundler) Register(p *streamproto.Properties) (Stream, error) {
|
| return s, nil
|
| }
|
|
|
| +// GetStreamDescs returns the set of registered stream names mapped to their
|
| +// descriptors.
|
| +//
|
| +// This is intended for testing purposes. DO NOT modify the resulting
|
| +// descriptors.
|
| +func (b *Bundler) GetStreamDescs() map[string]*logpb.LogStreamDescriptor {
|
| + b.streamsLock.Lock()
|
| + defer b.streamsLock.Unlock()
|
| +
|
| + if len(b.streams) == 0 {
|
| + return nil
|
| + }
|
| +
|
| + streams := make(map[string]*logpb.LogStreamDescriptor, len(b.streams))
|
| + for k, s := range b.streams {
|
| + streams[k] = s.streamDesc()
|
| + }
|
| + return streams
|
| +}
|
| +
|
| // CloseAndFlush closes the Bundler, alerting it that no more streams will be
|
| // added and that existing data may be aggressively output.
|
| //
|
|
|