summaryrefslogtreecommitdiff
path: root/vendor/go.opencensus.io/trace/spanstore.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-07-02 11:37:41 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-07-02 11:38:28 +0200
commit7eb9ed975899ffe12fb82066aebf652444205e02 (patch)
tree7bcf61f24cab74996f3641c0d6163a0b47979694 /vendor/go.opencensus.io/trace/spanstore.go
parent955c1d2bfeac0c399bbc4d82fd7b72ed4cc868d3 (diff)
downloadpodman-7eb9ed975899ffe12fb82066aebf652444205e02.tar.gz
podman-7eb9ed975899ffe12fb82066aebf652444205e02.tar.bz2
podman-7eb9ed975899ffe12fb82066aebf652444205e02.zip
vendor containers/common@main
Pull in fixes for local image lookups. Fixes: #10835 Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
Diffstat (limited to 'vendor/go.opencensus.io/trace/spanstore.go')
-rw-r--r--vendor/go.opencensus.io/trace/spanstore.go14
1 files changed, 8 insertions, 6 deletions
diff --git a/vendor/go.opencensus.io/trace/spanstore.go b/vendor/go.opencensus.io/trace/spanstore.go
index c442d9902..e601f76f2 100644
--- a/vendor/go.opencensus.io/trace/spanstore.go
+++ b/vendor/go.opencensus.io/trace/spanstore.go
@@ -48,8 +48,10 @@ func (i internalOnly) ReportActiveSpans(name string) []*SpanData {
var out []*SpanData
s.mu.Lock()
defer s.mu.Unlock()
- for span := range s.active {
- out = append(out, span.makeSpanData())
+ for activeSpan := range s.active {
+ if s, ok := activeSpan.(*span); ok {
+ out = append(out, s.makeSpanData())
+ }
}
return out
}
@@ -185,7 +187,7 @@ func (i internalOnly) ReportSpansByLatency(name string, minLatency, maxLatency t
// bucketed by latency.
type spanStore struct {
mu sync.Mutex // protects everything below.
- active map[*Span]struct{}
+ active map[SpanInterface]struct{}
errors map[int32]*bucket
latency []bucket
maxSpansPerErrorBucket int
@@ -194,7 +196,7 @@ type spanStore struct {
// newSpanStore creates a span store.
func newSpanStore(name string, latencyBucketSize int, errorBucketSize int) *spanStore {
s := &spanStore{
- active: make(map[*Span]struct{}),
+ active: make(map[SpanInterface]struct{}),
latency: make([]bucket, len(defaultLatencies)+1),
maxSpansPerErrorBucket: errorBucketSize,
}
@@ -271,7 +273,7 @@ func (s *spanStore) resize(latencyBucketSize int, errorBucketSize int) {
}
// add adds a span to the active bucket of the spanStore.
-func (s *spanStore) add(span *Span) {
+func (s *spanStore) add(span SpanInterface) {
s.mu.Lock()
s.active[span] = struct{}{}
s.mu.Unlock()
@@ -279,7 +281,7 @@ func (s *spanStore) add(span *Span) {
// finished removes a span from the active set, and adds a corresponding
// SpanData to a latency or error bucket.
-func (s *spanStore) finished(span *Span, sd *SpanData) {
+func (s *spanStore) finished(span SpanInterface, sd *SpanData) {
latency := sd.EndTime.Sub(sd.StartTime)
if latency < 0 {
latency = 0