metricsExplorer.tsx 842 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import {useState} from 'react';
  2. import {MetricDisplayType} from 'sentry/utils/metrics';
  3. import {MetricWidget, MetricWidgetProps} from 'sentry/views/ddm/metricWidget';
  4. // TODO(ddm): move this to admin
  5. export default function MetricsExplorer() {
  6. const [widget, setWidget] = useState<MetricWidgetProps>({
  7. mri: '',
  8. op: undefined,
  9. query: '',
  10. groupBy: [],
  11. displayType: MetricDisplayType.LINE,
  12. position: 0,
  13. powerUserMode: true,
  14. showSummaryTable: true,
  15. onChange: () => {},
  16. });
  17. return (
  18. <MetricWidget
  19. widget={{
  20. ...widget,
  21. onChange: data => {
  22. setWidget(curr => ({...curr, ...data}));
  23. },
  24. }}
  25. datetime={{
  26. start: null,
  27. end: null,
  28. period: '7d',
  29. utc: false,
  30. }}
  31. projects={[]}
  32. environments={[]}
  33. />
  34. );
  35. }