metricsExplorer.tsx 954 B

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