metrics.go 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. // Copyright 2021 gorse Project 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 worker
  15. import (
  16. "github.com/prometheus/client_golang/prometheus"
  17. "github.com/prometheus/client_golang/prometheus/promauto"
  18. )
  19. const (
  20. LabelStep = "step"
  21. LabelData = "data"
  22. )
  23. var (
  24. UpdateUserRecommendTotal = promauto.NewGauge(prometheus.GaugeOpts{
  25. Namespace: "gorse",
  26. Subsystem: "worker",
  27. Name: "update_user_recommend_total",
  28. })
  29. OfflineRecommendStepSecondsVec = promauto.NewGaugeVec(prometheus.GaugeOpts{
  30. Namespace: "gorse",
  31. Subsystem: "worker",
  32. Name: "offline_recommend_step_seconds",
  33. }, []string{LabelStep})
  34. OfflineRecommendTotalSeconds = promauto.NewGauge(prometheus.GaugeOpts{
  35. Namespace: "gorse",
  36. Subsystem: "worker",
  37. Name: "offline_recommend_total_seconds",
  38. })
  39. CollaborativeFilteringIndexRecall = promauto.NewGauge(prometheus.GaugeOpts{
  40. Namespace: "gorse",
  41. Subsystem: "worker",
  42. Name: "collaborative_filtering_index_recall",
  43. })
  44. MemoryInuseBytesVec = promauto.NewGaugeVec(prometheus.GaugeOpts{
  45. Namespace: "gorse",
  46. Subsystem: "worker",
  47. Name: "memory_inuse_bytes",
  48. }, []string{LabelData})
  49. )