metrics.go 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. // Copyright 2018 The etcd 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 tester
  15. import "github.com/prometheus/client_golang/prometheus"
  16. var (
  17. caseTotalCounter = prometheus.NewCounterVec(
  18. prometheus.CounterOpts{
  19. Namespace: "etcd",
  20. Subsystem: "funcational_tester",
  21. Name: "case_total",
  22. Help: "Total number of finished test cases",
  23. },
  24. []string{"desc"},
  25. )
  26. caseFailedTotalCounter = prometheus.NewCounterVec(
  27. prometheus.CounterOpts{
  28. Namespace: "etcd",
  29. Subsystem: "funcational_tester",
  30. Name: "case_failed_total",
  31. Help: "Total number of failed test cases",
  32. },
  33. []string{"desc"},
  34. )
  35. roundTotalCounter = prometheus.NewCounter(
  36. prometheus.CounterOpts{
  37. Namespace: "etcd",
  38. Subsystem: "funcational_tester",
  39. Name: "round_total",
  40. Help: "Total number of finished test rounds.",
  41. })
  42. roundFailedTotalCounter = prometheus.NewCounter(
  43. prometheus.CounterOpts{
  44. Namespace: "etcd",
  45. Subsystem: "funcational_tester",
  46. Name: "round_failed_total",
  47. Help: "Total number of failed test rounds.",
  48. })
  49. )
  50. func init() {
  51. prometheus.MustRegister(caseTotalCounter)
  52. prometheus.MustRegister(caseFailedTotalCounter)
  53. prometheus.MustRegister(roundTotalCounter)
  54. prometheus.MustRegister(roundFailedTotalCounter)
  55. }