diff options
| author | Nicolas Paul <n@nc0.fr> | 2023-04-16 20:09:08 +0200 | 
|---|---|---|
| committer | Nicolas Paul <n@nc0.fr> | 2023-04-16 20:09:08 +0200 | 
| commit | efc9e73404efc108c69b4498acb312d760cf8e5d (patch) | |
| tree | a6522428a9b92ff52ff4d590b23067b22e4960d5 /vendor/go.opencensus.io/internal | |
| parent | 1f9284de04ae5c996e4218918822297280ede164 (diff) | |
Go mod tidy
Diffstat (limited to 'vendor/go.opencensus.io/internal')
| -rw-r--r-- | vendor/go.opencensus.io/internal/internal.go | 37 | ||||
| -rw-r--r-- | vendor/go.opencensus.io/internal/sanitize.go | 50 | ||||
| -rw-r--r-- | vendor/go.opencensus.io/internal/tagencoding/tagencoding.go | 75 | ||||
| -rw-r--r-- | vendor/go.opencensus.io/internal/traceinternals.go | 53 | 
4 files changed, 0 insertions, 215 deletions
diff --git a/vendor/go.opencensus.io/internal/internal.go b/vendor/go.opencensus.io/internal/internal.go deleted file mode 100644 index 81dc718..0000000 --- a/vendor/go.opencensus.io/internal/internal.go +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -//     http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal // import "go.opencensus.io/internal" - -import ( -	"fmt" -	"time" - -	opencensus "go.opencensus.io" -) - -// UserAgent is the user agent to be added to the outgoing -// requests from the exporters. -var UserAgent = fmt.Sprintf("opencensus-go/%s", opencensus.Version()) - -// MonotonicEndTime returns the end time at present -// but offset from start, monotonically. -// -// The monotonic clock is used in subtractions hence -// the duration since start added back to start gives -// end as a monotonic time. -// See https://golang.org/pkg/time/#hdr-Monotonic_Clocks -func MonotonicEndTime(start time.Time) time.Time { -	return start.Add(time.Since(start)) -} diff --git a/vendor/go.opencensus.io/internal/sanitize.go b/vendor/go.opencensus.io/internal/sanitize.go deleted file mode 100644 index de8ccf2..0000000 --- a/vendor/go.opencensus.io/internal/sanitize.go +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -//     http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( -	"strings" -	"unicode" -) - -const labelKeySizeLimit = 100 - -// Sanitize returns a string that is trunacated to 100 characters if it's too -// long, and replaces non-alphanumeric characters to underscores. -func Sanitize(s string) string { -	if len(s) == 0 { -		return s -	} -	if len(s) > labelKeySizeLimit { -		s = s[:labelKeySizeLimit] -	} -	s = strings.Map(sanitizeRune, s) -	if unicode.IsDigit(rune(s[0])) { -		s = "key_" + s -	} -	if s[0] == '_' { -		s = "key" + s -	} -	return s -} - -// converts anything that is not a letter or digit to an underscore -func sanitizeRune(r rune) rune { -	if unicode.IsLetter(r) || unicode.IsDigit(r) { -		return r -	} -	// Everything else turns into an underscore -	return '_' -} diff --git a/vendor/go.opencensus.io/internal/tagencoding/tagencoding.go b/vendor/go.opencensus.io/internal/tagencoding/tagencoding.go deleted file mode 100644 index 41b2c3f..0000000 --- a/vendor/go.opencensus.io/internal/tagencoding/tagencoding.go +++ /dev/null @@ -1,75 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -//     http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// - -// Package tagencoding contains the tag encoding -// used interally by the stats collector. -package tagencoding // import "go.opencensus.io/internal/tagencoding" - -// Values represent the encoded buffer for the values. -type Values struct { -	Buffer     []byte -	WriteIndex int -	ReadIndex  int -} - -func (vb *Values) growIfRequired(expected int) { -	if len(vb.Buffer)-vb.WriteIndex < expected { -		tmp := make([]byte, 2*(len(vb.Buffer)+1)+expected) -		copy(tmp, vb.Buffer) -		vb.Buffer = tmp -	} -} - -// WriteValue is the helper method to encode Values from map[Key][]byte. -func (vb *Values) WriteValue(v []byte) { -	length := len(v) & 0xff -	vb.growIfRequired(1 + length) - -	// writing length of v -	vb.Buffer[vb.WriteIndex] = byte(length) -	vb.WriteIndex++ - -	if length == 0 { -		// No value was encoded for this key -		return -	} - -	// writing v -	copy(vb.Buffer[vb.WriteIndex:], v[:length]) -	vb.WriteIndex += length -} - -// ReadValue is the helper method to decode Values to a map[Key][]byte. -func (vb *Values) ReadValue() []byte { -	// read length of v -	length := int(vb.Buffer[vb.ReadIndex]) -	vb.ReadIndex++ -	if length == 0 { -		// No value was encoded for this key -		return nil -	} - -	// read value of v -	v := make([]byte, length) -	endIdx := vb.ReadIndex + length -	copy(v, vb.Buffer[vb.ReadIndex:endIdx]) -	vb.ReadIndex = endIdx -	return v -} - -// Bytes returns a reference to already written bytes in the Buffer. -func (vb *Values) Bytes() []byte { -	return vb.Buffer[:vb.WriteIndex] -} diff --git a/vendor/go.opencensus.io/internal/traceinternals.go b/vendor/go.opencensus.io/internal/traceinternals.go deleted file mode 100644 index 073af7b..0000000 --- a/vendor/go.opencensus.io/internal/traceinternals.go +++ /dev/null @@ -1,53 +0,0 @@ -// Copyright 2017, OpenCensus Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -//     http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package internal - -import ( -	"time" -) - -// Trace allows internal access to some trace functionality. -// TODO(#412): remove this -var Trace interface{} - -// LocalSpanStoreEnabled true if the local span store is enabled. -var LocalSpanStoreEnabled bool - -// BucketConfiguration stores the number of samples to store for span buckets -// for successful and failed spans for a particular span name. -type BucketConfiguration struct { -	Name                 string -	MaxRequestsSucceeded int -	MaxRequestsErrors    int -} - -// PerMethodSummary is a summary of the spans stored for a single span name. -type PerMethodSummary struct { -	Active         int -	LatencyBuckets []LatencyBucketSummary -	ErrorBuckets   []ErrorBucketSummary -} - -// LatencyBucketSummary is a summary of a latency bucket. -type LatencyBucketSummary struct { -	MinLatency, MaxLatency time.Duration -	Size                   int -} - -// ErrorBucketSummary is a summary of an error bucket. -type ErrorBucketSummary struct { -	ErrorCode int32 -	Size      int -}  | 
