metricRule.ts 885 B

123456789101112131415161718192021222324252627282930
  1. import {IncidentTriggerFixture} from 'sentry-fixture/incidentTrigger';
  2. import type {SavedMetricRule as SavedMetricRule} from 'sentry/views/alerts/rules/metric/types';
  3. import {AlertRuleComparisonType, Dataset} from 'sentry/views/alerts/rules/metric/types';
  4. export function MetricRuleFixture(
  5. params: Partial<SavedMetricRule> = {}
  6. ): SavedMetricRule {
  7. return {
  8. activations: [],
  9. status: 0,
  10. dateCreated: '2019-07-31T23:02:02.731Z',
  11. dataset: Dataset.ERRORS,
  12. query: '',
  13. id: '4',
  14. snooze: false,
  15. name: 'My Incident Rule',
  16. timeWindow: 60,
  17. aggregate: 'count()',
  18. projects: ['project-slug'],
  19. dateModified: '2019-07-31T23:02:02.731Z',
  20. triggers: [IncidentTriggerFixture()],
  21. resolveThreshold: 36,
  22. thresholdType: 0,
  23. thresholdPeriod: 1,
  24. environment: null,
  25. detectionType: AlertRuleComparisonType.COUNT,
  26. ...params,
  27. };
  28. }