Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query grouping dashboard changes and extensive tests #33

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@
*/

export const TIMESTAMP = 'Timestamp';
export const TYPE = 'Type';
export const QUERY_HASHCODE = 'Query Hashcode';
export const QUERY_COUNT = 'Query Count';
export const LATENCY = 'Latency';
export const CPU_TIME = 'CPU Time';
export const MEMORY_USAGE = 'Memory Usage';
export const INDICES = 'Indices';
export const SEARCH_TYPE = 'Search type';
export const NODE_ID = 'Coordinator node ID';
export const TOTAL_SHARDS = 'Total shards';
export const GROUP_BY = 'Group by';
140 changes: 129 additions & 11 deletions public/components/__snapshots__/app.test.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,49 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
<div
class="euiPopover euiPopover--anchorDownCenter"
id="field_value_selection_0"
>
<div
class="euiPopover__anchor"
>
<button
class="euiButtonEmpty euiButtonEmpty--text euiFilterButton euiFilterButton--hasIcon"
type="button"
>
<span
class="euiButtonContent euiButtonContent--iconRight euiButtonEmpty__content"
>
<svg
aria-hidden="true"
class="euiIcon euiIcon--medium euiIcon--inherit euiIcon-isLoading euiButtonContent__icon"
focusable="false"
height="16"
role="img"
viewBox="0 0 16 16"
width="16"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M5.277 10.088c.02.014.04.03.057.047.582.55 1.134.812 1.666.812.586 0 1.84-.293 3.713-.88L9 6.212V2H7v4.212l-1.723 3.876Zm-.438.987L3.539 14h8.922l-1.32-2.969C9.096 11.677 7.733 12 7 12c-.74 0-1.463-.315-2.161-.925ZM6 2H5V1h6v1h-1v4l3.375 7.594A1 1 0 0 1 12.461 15H3.54a1 1 0 0 1-.914-1.406L6 6V2Z"
/>
</svg>
<span
class="euiButtonEmpty__text"
>
<span
class="euiFilterButton__textShift"
data-text="Type"
title="Type"
>
Type
</span>
</span>
</span>
</button>
</div>
</div>
<div
class="euiPopover euiPopover--anchorDownCenter"
id="field_value_selection_1"
>
<div
class="euiPopover__anchor"
Expand Down Expand Up @@ -141,7 +184,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
</div>
<div
class="euiPopover euiPopover--anchorDownCenter"
id="field_value_selection_1"
id="field_value_selection_2"
>
<div
class="euiPopover__anchor"
Expand Down Expand Up @@ -184,7 +227,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
</div>
<div
class="euiPopover euiPopover--anchorDownCenter"
id="field_value_selection_2"
id="field_value_selection_3"
>
<div
class="euiPopover__anchor"
Expand Down Expand Up @@ -427,7 +470,82 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_Timestamp_0"
data-test-subj="tableHeaderCell_Query Hashcode_0"
role="columnheader"
scope="col"
>
<button
class="euiTableHeaderButton"
data-test-subj="tableHeaderSortButton"
type="button"
>
<span
class="euiTableCellContent"
>
<span
class="euiTableCellContent__text"
title="Query Hashcode"
>
Query Hashcode
</span>
</span>
</button>
</th>
<th
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_Type_1"
role="columnheader"
scope="col"
>
<button
class="euiTableHeaderButton"
data-test-subj="tableHeaderSortButton"
type="button"
>
<span
class="euiTableCellContent"
>
<span
class="euiTableCellContent__text"
title="Type"
>
Type
</span>
</span>
</button>
</th>
<th
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_measurements_2"
role="columnheader"
scope="col"
>
<button
class="euiTableHeaderButton"
data-test-subj="tableHeaderSortButton"
type="button"
>
<span
class="euiTableCellContent"
>
<span
class="euiTableCellContent__text"
title="Query Count"
>
Query Count
</span>
</span>
</button>
</th>
<th
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_Timestamp_3"
role="columnheader"
scope="col"
>
Expand All @@ -452,7 +570,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_measurements_1"
data-test-subj="tableHeaderCell_measurements_4"
role="columnheader"
scope="col"
>
Expand All @@ -477,7 +595,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_measurements_2"
data-test-subj="tableHeaderCell_measurements_5"
role="columnheader"
scope="col"
>
Expand All @@ -502,7 +620,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_measurements_3"
data-test-subj="tableHeaderCell_measurements_6"
role="columnheader"
scope="col"
>
Expand All @@ -527,7 +645,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_indices_4"
data-test-subj="tableHeaderCell_indices_7"
role="columnheader"
scope="col"
>
Expand All @@ -552,7 +670,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_search_type_5"
data-test-subj="tableHeaderCell_search_type_8"
role="columnheader"
scope="col"
>
Expand All @@ -577,7 +695,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_node_id_6"
data-test-subj="tableHeaderCell_node_id_9"
role="columnheader"
scope="col"
>
Expand All @@ -602,7 +720,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
aria-live="polite"
aria-sort="none"
class="euiTableHeaderCell"
data-test-subj="tableHeaderCell_total_shards_7"
data-test-subj="tableHeaderCell_total_shards_10"
role="columnheader"
scope="col"
>
Expand Down Expand Up @@ -631,7 +749,7 @@ exports[`<QueryInsightsDashboardsApp /> spec renders the component 1`] = `
>
<td
class="euiTableRowCell euiTableRowCell--isMobileFullWidth"
colspan="8"
colspan="11"
>
<div
class="euiTableCellContent euiTableCellContent--alignCenter"
Expand Down
1 change: 1 addition & 0 deletions public/components/app.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { render } from '@testing-library/react';
import { coreMock } from '../../../../src/core/public/mocks';
import { MemoryRouter as Router } from 'react-router-dom';
import { QueryInsightsDashboardsApp } from './app';
import '@testing-library/jest-dom/extend-expect';

describe('<QueryInsightsDashboardsApp /> spec', () => {
it('renders the component', () => {
Expand Down
Loading
Loading