metricsExplorer.tsx 917 B

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