traceinternals.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. // LocalSpanStoreEnabled true if the local span store is enabled.
  22. var LocalSpanStoreEnabled bool
  23. // BucketConfiguration stores the number of samples to store for span buckets
  24. // for successful and failed spans for a particular span name.
  25. type BucketConfiguration struct {
  26. Name string
  27. MaxRequestsSucceeded int
  28. MaxRequestsErrors int
  29. }
  30. // PerMethodSummary is a summary of the spans stored for a single span name.
  31. type PerMethodSummary struct {
  32. Active int
  33. LatencyBuckets []LatencyBucketSummary
  34. ErrorBuckets []ErrorBucketSummary
  35. }
  36. // LatencyBucketSummary is a summary of a latency bucket.
  37. type LatencyBucketSummary struct {
  38. MinLatency, MaxLatency time.Duration
  39. Size int
  40. }
  41. // ErrorBucketSummary is a summary of an error bucket.
  42. type ErrorBucketSummary struct {
  43. ErrorCode int32
  44. Size int
  45. }