Prometheus.service.ts 878 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import BaseModel from './BaseModel';
  2. export class PrometheusService extends BaseModel {
  3. static SET_PROMETHEUS_URL = '/prometheus/setPrometheus';
  4. static GET_MILVUS_HEALTHY_DATA_URL = '/prometheus/getMilvusHealthyData';
  5. static setPrometheus({
  6. prometheusAddress,
  7. prometheusInstance,
  8. prometheusNamespace,
  9. }: {
  10. prometheusAddress: string;
  11. prometheusInstance: string;
  12. prometheusNamespace: string;
  13. }) {
  14. return super.search({
  15. path: PrometheusService.SET_PROMETHEUS_URL,
  16. params: { prometheusAddress, prometheusInstance, prometheusNamespace },
  17. timeout: 1000,
  18. });
  19. }
  20. static getHealthyData({
  21. start,
  22. end,
  23. step,
  24. }: {
  25. start: number;
  26. end: number;
  27. step: number;
  28. }) {
  29. return super.search({
  30. path: PrometheusService.GET_MILVUS_HEALTHY_DATA_URL,
  31. params: { start, end, step },
  32. });
  33. }
  34. }