metricRule.ts 728 B

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