metrics.go 1.8 KB

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