summaryrefslogtreecommitdiff
path: root/vendor/go.opencensus.io/trace/spanstore.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2021-07-02 13:03:10 +0200
committerValentin Rothberg <rothberg@redhat.com>2021-07-02 13:03:10 +0200
commit735be12481cdc3edfcbca3500172d2164255e1a3 (patch)
tree67f0ee2916812072967707ae6de779ebbcdb0476 /vendor/go.opencensus.io/trace/spanstore.go
parent7eb9ed975899ffe12fb82066aebf652444205e02 (diff)
downloadpodman-735be12481cdc3edfcbca3500172d2164255e1a3.tar.gz
podman-735be12481cdc3edfcbca3500172d2164255e1a3.tar.bz2
podman-735be12481cdc3edfcbca3500172d2164255e1a3.zip
force github.com/spf13/cobra@v1.1.3
v1.2.0 is breaking CI (see containers/podman/pull/10844). 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, 6 insertions, 8 deletions
diff --git a/vendor/go.opencensus.io/trace/spanstore.go b/vendor/go.opencensus.io/trace/spanstore.go
index e601f76f2..c442d9902 100644
--- a/vendor/go.opencensus.io/trace/spanstore.go
+++ b/vendor/go.opencensus.io/trace/spanstore.go
@@ -48,10 +48,8 @@ func (i internalOnly) ReportActiveSpans(name string) []*SpanData {
var out []*SpanData
s.mu.Lock()
defer s.mu.Unlock()
- for activeSpan := range s.active {
- if s, ok := activeSpan.(*span); ok {
- out = append(out, s.makeSpanData())
- }
+ for span := range s.active {
+ out = append(out, span.makeSpanData())
}
return out
}
@@ -187,7 +185,7 @@ func (i internalOnly) ReportSpansByLatency(name string, minLatency, maxLatency t
// bucketed by latency.
type spanStore struct {
mu sync.Mutex // protects everything below.
- active map[SpanInterface]struct{}
+ active map[*Span]struct{}
errors map[int32]*bucket
latency []bucket
maxSpansPerErrorBucket int
@@ -196,7 +194,7 @@ type spanStore struct {
// newSpanStore creates a span store.
func newSpanStore(name string, latencyBucketSize int, errorBucketSize int) *spanStore {
s := &spanStore{
- active: make(map[SpanInterface]struct{}),
+ active: make(map[*Span]struct{}),
latency: make([]bucket, len(defaultLatencies)+1),
maxSpansPerErrorBucket: errorBucketSize,
}
@@ -273,7 +271,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 SpanInterface) {
+func (s *spanStore) add(span *Span) {
s.mu.Lock()
s.active[span] = struct{}{}
s.mu.Unlock()
@@ -281,7 +279,7 @@ func (s *spanStore) add(span SpanInterface) {
// finished removes a span from the active set, and adds a corresponding
// SpanData to a latency or error bucket.
-func (s *spanStore) finished(span SpanInterface, sd *SpanData) {
+func (s *spanStore) finished(span *Span, sd *SpanData) {
latency := sd.EndTime.Sub(sd.StartTime)
if latency < 0 {
latency = 0