traceinternals.go 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // Copyright 2017, OpenCensus Authors
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. package internal
  15. import (
  16. "time"
  17. )
  18. // Trace allows internal access to some trace functionality.
  19. // TODO(#412): remove this
  20. var Trace interface{}
  21. var LocalSpanStoreEnabled bool
  22. // BucketConfiguration stores the number of samples to store for span buckets
  23. // for successful and failed spans for a particular span name.
  24. type BucketConfiguration struct {
  25. Name string
  26. MaxRequestsSucceeded int
  27. MaxRequestsErrors int
  28. }
  29. // PerMethodSummary is a summary of the spans stored for a single span name.
  30. type PerMethodSummary struct {
  31. Active int
  32. LatencyBuckets []LatencyBucketSummary
  33. ErrorBuckets []ErrorBucketSummary
  34. }
  35. // LatencyBucketSummary is a summary of a latency bucket.
  36. type LatencyBucketSummary struct {
  37. MinLatency, MaxLatency time.Duration
  38. Size int
  39. }
  40. // ErrorBucketSummary is a summary of an error bucket.
  41. type ErrorBucketSummary struct {
  42. ErrorCode int32
  43. Size int
  44. }