utils.ts 387 B

123456789101112
  1. import type {Series} from 'sentry/types/echarts';
  2. export const convertHitRateToMissRate = (hitRateSeries: Series): Series => {
  3. return {
  4. ...hitRateSeries,
  5. seriesName: 'cache_miss_rate()', // TODO - this can just be a discover function
  6. data: hitRateSeries.data.map(dataPoint => ({
  7. ...dataPoint,
  8. value: dataPoint.value ? 1 - dataPoint.value : 0,
  9. })),
  10. };
  11. };