Skip to content

Commit

Permalink
Use in-memory count for total hits in patterns ratio (#1254)
Browse files Browse the repository at this point in the history
Signed-off-by: Joshua Li <[email protected]>
  • Loading branch information
joshuali925 authored Nov 4, 2022
1 parent 680e5df commit 625433f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -879,11 +879,6 @@ export const Explorer = ({
tabId={tabId}
query={query}
isPatternLoading={isPatternLoading}
totalHits={reduce(
countDistribution.data['count()'],
(sum, n) => sum + n,
0
)}
/>
<EuiHorizontalRule margin="xs" />
</>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,11 @@ interface PatternsTableProps {
tabId: string;
query: any;
isPatternLoading: boolean;
totalHits?: number;
}

export function PatternsTable(props: PatternsTableProps) {
const { tableData, tabId, onPatternSelection, query } = props;
const patternsData = useSelector(selectPatterns)[tabId];
const totalHits = props.totalHits || tableData.reduce((p, v) => p + v.count, 0);
const { tableData, onPatternSelection, query } = props;
const totalHits = tableData.reduce((p, v) => p + v.count, 0);

const tableColumns = [
{
Expand Down

0 comments on commit 625433f

Please sign in to comment.