Skip to content

Commit

Permalink
removing requestId
Browse files Browse the repository at this point in the history
  • Loading branch information
cauemarcondes committed Feb 9, 2021
1 parent a67632f commit daf88fe
Showing 1 changed file with 5 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ import {
import { i18n } from '@kbn/i18n';
import { orderBy } from 'lodash';
import React, { useState } from 'react';
import uuid from 'uuid';
import { LatencyAggregationType } from '../../../../../common/latency_aggregation_types';
import { useApmServiceContext } from '../../../../context/apm_service/use_apm_service_context';
import { useUrlParams } from '../../../../context/url_params_context/use_url_params';
Expand All @@ -31,7 +30,6 @@ interface Props {
const INITIAL_STATE = {
transactionGroups: [],
isAggregationAccurate: true,
requestId: '',
};

type SortField = 'name' | 'latency' | 'throughput' | 'errorRate' | 'impact';
Expand Down Expand Up @@ -80,11 +78,6 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {
latencyAggregationType: latencyAggregationType as LatencyAggregationType,
},
},
}).then((response) => {
return {
requestId: uuid(),
...response,
};
});
},
[
Expand All @@ -97,7 +90,7 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {
]
);

const { transactionGroups, requestId } = data;
const { transactionGroups } = data;
const currentPageTransactionGroups = orderBy(
transactionGroups,
sort.field,
Expand Down Expand Up @@ -134,22 +127,19 @@ export function ServiceOverviewTransactionsTable({ serviceName }: Props) {
transactionNames,
},
},
isCachable: true,
}).then((result) => {
return { [requestId]: result };
});
}
},
// only fetches statistics when requestId changes or transaction names changes
// only fetches statistics when transaction names changes
// eslint-disable-next-line react-hooks/exhaustive-deps
[requestId, transactionNames]
[transactionNames],
{ preservePreviousData: false }
);

const columns = getColumns({
serviceName,
latencyAggregationType,
transactionGroupComparisonStatistics:
transactionGroupComparisonStatistics?.[requestId],
transactionGroupComparisonStatistics,
});

const isLoading =
Expand Down

0 comments on commit daf88fe

Please sign in to comment.