Metrics.mjs 808 B

12345678910111213141516171819202122232425262728
  1. // @ts-check
  2. import Metrics from '@overleaf/metrics'
  3. const analyticsQueue = new Metrics.prom.Counter({
  4. name: 'analytics_queue',
  5. help: 'Number of events sent to the analytics queue',
  6. labelNames: ['status', 'event_type'],
  7. })
  8. const revertFileDurationSeconds = new Metrics.prom.Histogram({
  9. name: 'timer_revert_file_duration_seconds',
  10. help: 'Duration of the file restore operation',
  11. buckets: [0.01, 0.025, 0.05, 0.1, 0.25, 0.5, 1, 2.5, 5],
  12. labelNames: ['type'],
  13. })
  14. const revertProjectDurationSeconds = new Metrics.prom.Histogram({
  15. name: 'timer_revert_project_duration_seconds',
  16. help: 'Duration of the project restore operation',
  17. buckets: [0.5, 1, 2, 5, 10, 30, 60, 120, 300, 900, 1800],
  18. })
  19. export default {
  20. analyticsQueue,
  21. revertFileDurationSeconds,
  22. revertProjectDurationSeconds,
  23. }