diff --git a/portal/mock-server/src/all-experiments.json b/portal/mock-server/src/all-experiments.json index 4b9a9061..1176ca9b 100644 --- a/portal/mock-server/src/all-experiments.json +++ b/portal/mock-server/src/all-experiments.json @@ -7,47 +7,56 @@ { "id": 354, "algorithm": "prime256v1", - "iterations": 100 + "iterations": 500, + "message_size": 2048 }, { "id": 355, "algorithm": "prime256v1", - "iterations": 500 + "iterations": 100, + "message_size": 1024 }, { "id": 356, "algorithm": "prime256v1", - "iterations": 1000 + "iterations": 1000, + "message_size": 1024 }, { "id": 357, "algorithm": "p256_kyber512", - "iterations": 100 + "iterations": 100, + "message_size": 1024 }, { "id": 358, "algorithm": "p256_kyber512", - "iterations": 500 + "iterations": 500, + "message_size": 2048 }, { "id": 359, "algorithm": "p256_kyber512", - "iterations": 1000 + "iterations": 1000, + "message_size": 1024 }, { "id": 360, "algorithm": "bikel3", - "iterations": 100 + "iterations": 100, + "message_size": 512 }, { "id": 361, "algorithm": "bikel3", - "iterations": 500 + "iterations": 500, + "message_size": 1024 }, { "id": 362, "algorithm": "bikel3", - "iterations": 1000 + "iterations": 1000, + "message_size": 512 } ] }, @@ -59,17 +68,20 @@ { "id": 363, "algorithm": "kyber512", - "iterations": 1000 + "iterations": 1000, + "message_size": 1024 }, { "id": 364, "algorithm": "bikel3", - "iterations": 1000 + "iterations": 1000, + "message_size": 1024 }, { "id": 365, "algorithm": "prime256v1", - "iterations": 1000 + "iterations": 1000, + "message_size": 2048 } ] }, @@ -81,22 +93,26 @@ { "id": 366, "algorithm": "prime256v1", - "iterations": 500 + "iterations": 500, + "message_size": 1024 }, { "id": 367, "algorithm": "bikel3", - "iterations": 1000 + "iterations": 1000, + "message_size": 1024 }, { "id": 368, "algorithm": "bikel3", - "iterations": 1000 + "iterations": 1000, + "message_size": 512 }, { "id": 369, "algorithm": "prime256v1", - "iterations": 5000 + "iterations": 5000, + "message_size": 512 } ] }, @@ -108,12 +124,14 @@ { "id": 370, "algorithm": "kyber512", - "iterations": 500 + "iterations": 500, + "message_size": 1024 }, { "id": 371, "algorithm": "kyber512", - "iterations": 1500 + "iterations": 1500, + "message_size": 1024 } ] } diff --git a/portal/mock-server/src/message_sizes.json b/portal/mock-server/src/message_sizes.json new file mode 100644 index 00000000..0412d5da --- /dev/null +++ b/portal/mock-server/src/message_sizes.json @@ -0,0 +1,3 @@ +{ + "message_sizes": [0, 1, 2, 100, 1024, 102400, 204800, 1048576, 2097152, 10485760] +} \ No newline at end of file diff --git a/portal/mock-server/src/router.ts b/portal/mock-server/src/router.ts index 5db6a10d..51298d6c 100644 --- a/portal/mock-server/src/router.ts +++ b/portal/mock-server/src/router.ts @@ -29,6 +29,14 @@ router.get('/iterations', async (req: Request, res: Response) => { }, 1500); }); +router.get('/message_sizes', async (req: Request, res: Response) => { + console.log(`-${req.method} ${req.url}`); + const data = (await import('./message_sizes.json')).default; + setTimeout(() => { + res.json(data); + }, 1500); +}); + router.get('/qujata-api/test_suites/:testSuiteId', async (req: Request, res: Response) => { console.log(`-${req.method} ${req.url}`); const data = (await import('./test.json')).default; diff --git a/portal/mock-server/src/test.json b/portal/mock-server/src/test.json index ed4ca2d7..2d8bee0f 100644 --- a/portal/mock-server/src/test.json +++ b/portal/mock-server/src/test.json @@ -14,12 +14,12 @@ "operatingSystem": "RELACE_WITH_OPERATING_SYSTEM", "resourceName": "RELACE_WITH_RESOURCE_NAME" }, - "test_runs": [ { "id":1, "algorithm": "bikel1", "iterations": 1000, + "message_size": 1024, "results": { "averageCPU": 3.5, "averageMemory": 3 @@ -29,6 +29,7 @@ "id":2, "algorithm": "bikel1", "iterations": 2000, + "message_size": 2048, "results": { "averageCPU": 7.0, "averageMemory": 6 @@ -38,6 +39,7 @@ "id":3, "algorithm": "kyber512", "iterations": 1000, + "message_size": 1024, "results": { "averageCPU": 1.7, "averageMemory": 2 @@ -47,6 +49,7 @@ "id":4, "algorithm": "kyber512", "iterations": 2000, + "message_size": 1024, "results": { "averageCPU": 2.6, "averageMemory": 2 diff --git a/portal/package.json b/portal/package.json index 025ccd6b..1a8e93c7 100644 --- a/portal/package.json +++ b/portal/package.json @@ -9,6 +9,7 @@ "chartjs-plugin-annotation": "^3.0.1", "classnames": "^2.3.2", "date-fns": "^3.3.0", + "filesize": "^10.1.0", "lodash": "^4.17.21", "react": "^18.2.0", "react-chartjs-2": "3.1.1", diff --git a/portal/src/app/apis.ts b/portal/src/app/apis.ts index 409568eb..45b92eb3 100644 --- a/portal/src/app/apis.ts +++ b/portal/src/app/apis.ts @@ -4,6 +4,7 @@ export const APIS: { [key in keyof typeof API_URLS]: string } = { analyze: 'analyze', algorithms: 'algorithms', iterations: 'iterations', + message_sizes: 'message_sizes', testRunResults: `${testSuites}/:testSuiteId`, editExperiment: `${testSuites}/:testSuiteId`, deleteExperiment: `${testSuites}/:testSuiteId`, @@ -15,6 +16,7 @@ enum API_URLS { analyze, algorithms, iterations, + message_sizes, testRunResults, editExperiment, deleteExperiment, diff --git a/portal/src/app/components/all-experiments/Experiments.tsx b/portal/src/app/components/all-experiments/Experiments.tsx index 024f3b52..7a60339b 100644 --- a/portal/src/app/components/all-experiments/Experiments.tsx +++ b/portal/src/app/components/all-experiments/Experiments.tsx @@ -106,6 +106,11 @@ export const Experiments: React.FC = () => { name: ALL_EXPERIMENTS_TABLE_EN.TABLE_COLUMNS.ITERATIONS.NAME, accessor: (row: ExperimentData) => row.iterations?.join(', ') }, + { + id: ALL_EXPERIMENTS_TABLE_EN.TABLE_COLUMNS.MESSAGE_SIZES.ID, + name: ALL_EXPERIMENTS_TABLE_EN.TABLE_COLUMNS.MESSAGE_SIZES.NAME, + accessor: (row: ExperimentData) => row.message_sizes?.join(', ') + }, { id: ALL_EXPERIMENTS_TABLE_EN.TABLE_COLUMNS.DATE.ID, name: ALL_EXPERIMENTS_TABLE_EN.TABLE_COLUMNS.DATE.NAME, diff --git a/portal/src/app/components/all-experiments/hooks/useExperimentsData.test.ts b/portal/src/app/components/all-experiments/hooks/useExperimentsData.test.ts index 9318385d..a7a26b56 100644 --- a/portal/src/app/components/all-experiments/hooks/useExperimentsData.test.ts +++ b/portal/src/app/components/all-experiments/hooks/useExperimentsData.test.ts @@ -20,22 +20,26 @@ describe('useExperimentsData', () => { { id: 366, algorithm: "prime256v1", - iterations: 500 + iterations: 500, + message_size: 1024 }, { id: 367, algorithm: "bikel3", - iterations: 1000 + iterations: 1000, + message_size: 512 }, { id: 368, algorithm: "p256_kyber512", - iterations: 10000 + iterations: 10000, + message_size: 1024 }, { id: 369, algorithm: "prime256v1", - iterations: 5000 + iterations: 5000, + message_size: 512 } ] }, @@ -47,12 +51,14 @@ describe('useExperimentsData', () => { { id: 370, algorithm: "kyber512", - iterations: 500 + iterations: 500, + message_size: 1024 }, { id: 371, algorithm: "kyber512", - iterations: 1000 + iterations: 1000, + message_size: 2048 } ] } diff --git a/portal/src/app/components/all-experiments/models/experiments.interface.ts b/portal/src/app/components/all-experiments/models/experiments.interface.ts index ab9f8f73..9e5dc347 100644 --- a/portal/src/app/components/all-experiments/models/experiments.interface.ts +++ b/portal/src/app/components/all-experiments/models/experiments.interface.ts @@ -1,6 +1,6 @@ import { ITestRunResult, ITestRunResultData } from '../../../shared/models/test-run-result.interface'; -export type TestRunSubset = Pick; +export type TestRunSubset = Pick; export type Experiment = Pick & { test_runs: TestRunSubset[] }; export interface ExperimentData { @@ -8,5 +8,6 @@ export interface ExperimentData { name: string; algorithms: string[]; iterations: number[]; + message_sizes: number[]; end_time: number; }; diff --git a/portal/src/app/components/all-experiments/translate/en.ts b/portal/src/app/components/all-experiments/translate/en.ts index 993412fa..4d23e3dc 100644 --- a/portal/src/app/components/all-experiments/translate/en.ts +++ b/portal/src/app/components/all-experiments/translate/en.ts @@ -14,6 +14,10 @@ export const ALL_EXPERIMENTS_TABLE_EN = { NAME: 'Iterations', ID: 'iterations' }, + MESSAGE_SIZES: { + NAME: 'Message Size (KB)', + ID: 'message_size' + }, DATE: { NAME: 'Date', ID: 'date' diff --git a/portal/src/app/components/all-experiments/utils/parse-experiments-data.utils.test.ts b/portal/src/app/components/all-experiments/utils/parse-experiments-data.utils.test.ts index 6695e3da..3f85434f 100644 --- a/portal/src/app/components/all-experiments/utils/parse-experiments-data.utils.test.ts +++ b/portal/src/app/components/all-experiments/utils/parse-experiments-data.utils.test.ts @@ -1,6 +1,5 @@ import { parseExperimentsData } from './parse-experiments-data.utils'; -import { ITestRunResultData } from '../../../shared/models/test-run-result.interface'; -import { Experiment, ExperimentData } from '../models/experiments.interface'; +import { Experiment, ExperimentData, TestRunSubset } from '../models/experiments.interface'; describe('parseExperimentsData', () => { it('should parse experiments data correctly', () => { @@ -9,8 +8,8 @@ describe('parseExperimentsData', () => { id: 1, name: 'Experiment 1', test_runs: [ - { algorithm: 'Algorithm 1', iterations: 1000 } as ITestRunResultData, - { algorithm: 'Algorithm 2', iterations: 5000 } as ITestRunResultData, + { algorithm: 'Algorithm 1', iterations: 1000, message_size: 512 } as TestRunSubset, + { algorithm: 'Algorithm 2', iterations: 5000, message_size: 1024 } as TestRunSubset, ], end_time: 1705240065192, }, @@ -22,6 +21,7 @@ describe('parseExperimentsData', () => { name: 'Experiment 1', algorithms: ['Algorithm 1', 'Algorithm 2'], iterations: [1000, 5000], + message_sizes: [512, 1024], end_time: 1705240065192, }, ]; diff --git a/portal/src/app/components/all-experiments/utils/parse-experiments-data.utils.ts b/portal/src/app/components/all-experiments/utils/parse-experiments-data.utils.ts index 3ddfa6ac..84e43c56 100644 --- a/portal/src/app/components/all-experiments/utils/parse-experiments-data.utils.ts +++ b/portal/src/app/components/all-experiments/utils/parse-experiments-data.utils.ts @@ -6,16 +6,23 @@ export function parseExperimentsData(test_suites: Experiment[]) { test_suites.forEach((experiment: Experiment) => { const algorithms = new Set(); const iterations = new Set(); + const message_sizes = new Set(); experiment.test_runs?.forEach((testRun: TestRunSubset) => { algorithms.add(testRun.algorithm); iterations.add(testRun.iterations); + message_sizes.add(testRun.message_size); }); + const sortedAlgorithms = Array.from(algorithms).sort(); + const sortedIterations = Array.from(iterations).sort((a, b) => a - b); + const sortedMessageSizes = Array.from(message_sizes).sort((a, b) => a - b); + experimentsData.push({ id: experiment.id, name: experiment.name, - algorithms: Array.from(algorithms), - iterations: Array.from(iterations), + algorithms: sortedAlgorithms, + iterations: sortedIterations, + message_sizes: sortedMessageSizes, end_time: experiment.end_time }); }); diff --git a/portal/src/app/components/dashboard/Dashboard.test.tsx b/portal/src/app/components/dashboard/Dashboard.test.tsx index 5510aa29..eeb66e44 100644 --- a/portal/src/app/components/dashboard/Dashboard.test.tsx +++ b/portal/src/app/components/dashboard/Dashboard.test.tsx @@ -23,6 +23,10 @@ describe('Dashboard', () => { label: '1000', value: '1000', }, + messageSizes: { + label: '1024', + value: '1024' + }, description: 'Sample description', }; diff --git a/portal/src/app/components/dashboard/components/charts/Charts.test.tsx b/portal/src/app/components/dashboard/components/charts/Charts.test.tsx index f59b5248..8eb781f2 100644 --- a/portal/src/app/components/dashboard/components/charts/Charts.test.tsx +++ b/portal/src/app/components/dashboard/components/charts/Charts.test.tsx @@ -17,6 +17,10 @@ describe('Charts', () => { label: '1000', value: '1000', }, + messageSizes: { + label: '1024', + value: '1024' + }, description: 'test' }; diff --git a/portal/src/app/components/home/Home.test.tsx b/portal/src/app/components/home/Home.test.tsx index c76bf9f1..97b1445a 100644 --- a/portal/src/app/components/home/Home.test.tsx +++ b/portal/src/app/components/home/Home.test.tsx @@ -49,6 +49,7 @@ describe('Home', () => { experimentName: 'test', algorithms: { label: 'regular', value: 'regular' }, iterationsCount: { label: 'regular', value: 'regular' }, + messageSizes: [{ label: '1024', value: '1024' }], description: 'test' }); } diff --git a/portal/src/app/components/home/components/experiment/components/__mocks__/mocks.ts b/portal/src/app/components/home/components/experiment/components/__mocks__/mocks.ts index 4308d519..78abb681 100644 --- a/portal/src/app/components/home/components/experiment/components/__mocks__/mocks.ts +++ b/portal/src/app/components/home/components/experiment/components/__mocks__/mocks.ts @@ -21,7 +21,8 @@ export const MOCK_DATA_FOR_EXPERIMENT: ITestRunResult = { { id: 1, algorithm: "Algorithm1", - iterations: 1024, + iterations: 2000, + message_size: 1024, results: { averageCPU: 25.5, @@ -31,7 +32,8 @@ export const MOCK_DATA_FOR_EXPERIMENT: ITestRunResult = { { id: 2, algorithm: "Algorithm2", - iterations: 1024, + iterations: 1000, + message_size: 1024, results: { averageCPU: 25.5, @@ -41,7 +43,8 @@ export const MOCK_DATA_FOR_EXPERIMENT: ITestRunResult = { { id: 3, algorithm: "Algorithm1", - iterations: 104, + iterations: 1000, + message_size: 1024, results: { averageCPU: 2, @@ -72,7 +75,8 @@ export const MOCK_DATA_FOR_EXPERIMENT_TABLE: ExperimentTableProps = { { id: 1, algorithm: "Algorithm1", - iterations: 1024, + iterations: 1000, + message_size: 1024, results: { averageCPU: 25.5, @@ -82,7 +86,8 @@ export const MOCK_DATA_FOR_EXPERIMENT_TABLE: ExperimentTableProps = { { id: 2, algorithm: "Algorithm2", - iterations: 1024, + iterations: 2000, + message_size: 512, results: { averageCPU: 25.5, @@ -92,7 +97,8 @@ export const MOCK_DATA_FOR_EXPERIMENT_TABLE: ExperimentTableProps = { { id: 3, algorithm: "Algorithm1", - iterations: 104, + iterations: 500, + message_size: 2048, results: { averageCPU: 2, @@ -181,6 +187,7 @@ export const MOCK_SUB_HEADER: ITestRunResult = { id:1, algorithm: "bikel1", iterations: 1000, + message_size: 1024, results: { averageCPU: 3.5, averageMemory: 3 @@ -194,6 +201,7 @@ export const CSV_MOCK: ITestRunResultData[] = [ id: 1, algorithm: 'App1', iterations: 1000, + message_size: 1024, results: { averageCPU: 2000, averageMemory: 3000, @@ -203,6 +211,7 @@ export const CSV_MOCK: ITestRunResultData[] = [ id: 2, algorithm: 'App2', iterations: 4000, + message_size: 2048, results: { averageCPU: 5000, averageMemory: 6000, diff --git a/portal/src/app/components/home/components/experiment/components/charts/Charts.tsx b/portal/src/app/components/home/components/experiment/components/charts/Charts.tsx index 929e33b5..f3a51eff 100644 --- a/portal/src/app/components/home/components/experiment/components/charts/Charts.tsx +++ b/portal/src/app/components/home/components/experiment/components/charts/Charts.tsx @@ -1,10 +1,12 @@ import { IExperimentData } from '../../Experiment'; import styles from './Charts.module.scss'; import { DynamicChart } from './components/dynamic-chart'; +import { CHARTS_EN } from './translate/en'; export const Charts: React.FC = (props: IExperimentData) => { return (
+
{CHARTS_EN.TITLE}
); diff --git a/portal/src/app/components/home/components/experiment/components/charts/__mocks__/mocks.ts b/portal/src/app/components/home/components/experiment/components/charts/__mocks__/mocks.ts index 102dd207..42142a14 100644 --- a/portal/src/app/components/home/components/experiment/components/charts/__mocks__/mocks.ts +++ b/portal/src/app/components/home/components/experiment/components/charts/__mocks__/mocks.ts @@ -21,7 +21,8 @@ export const MOCK_DATA_FOR_CHARTS: IExperimentData = { { id: 1, algorithm: "Algorithm1", - iterations: 1024, + iterations: 2000, + message_size: 1024, results: { averageCPU: 25.5, @@ -31,7 +32,8 @@ export const MOCK_DATA_FOR_CHARTS: IExperimentData = { { id: 2, algorithm: "Algorithm2", - iterations: 1024, + iterations: 1000, + message_size: 512, results: { averageCPU: 25.5, @@ -41,7 +43,8 @@ export const MOCK_DATA_FOR_CHARTS: IExperimentData = { { id: 3, algorithm: "Algorithm1", - iterations: 104, + iterations: 500, + message_size: 1024, results: { averageCPU: 2, diff --git a/portal/src/app/components/home/components/experiment/components/charts/hooks/useChartsData.test.ts b/portal/src/app/components/home/components/experiment/components/charts/hooks/useChartsData.test.ts index fa0ee268..0bdabf31 100644 --- a/portal/src/app/components/home/components/experiment/components/charts/hooks/useChartsData.test.ts +++ b/portal/src/app/components/home/components/experiment/components/charts/hooks/useChartsData.test.ts @@ -22,7 +22,8 @@ describe('useChartsData', () => { { id: 1, algorithm: 'Algorithm1', - iterations: 1024, + iterations: 2000, + message_size: 1024, results: { averageCPU: 25.5, averageMemory: 512, @@ -31,7 +32,8 @@ describe('useChartsData', () => { { id: 2, algorithm: 'Algorithm2', - iterations: 1024, + iterations: 1000, + message_size: 512, results: { averageCPU: 25.5, averageMemory: 512, @@ -40,7 +42,8 @@ describe('useChartsData', () => { { id: 3, algorithm: 'Algorithm1', - iterations: 104, + iterations: 500, + message_size: 1024, results: { averageCPU: 2, averageMemory: 52, @@ -51,7 +54,7 @@ describe('useChartsData', () => { 'averageCPU', 'averageMemory', ], - lineChartData: { labels: [104, 1024], datasets: [ + lineChartData: { labels: [500, 1000, 2000], datasets: [ { backgroundColor: "#086CE1", borderColor: "#086CE1", diff --git a/portal/src/app/components/home/components/experiment/components/charts/models/bar-chart.const.ts b/portal/src/app/components/home/components/experiment/components/charts/models/bar-chart.const.ts index 92fbda90..8cee51f0 100644 --- a/portal/src/app/components/home/components/experiment/components/charts/models/bar-chart.const.ts +++ b/portal/src/app/components/home/components/experiment/components/charts/models/bar-chart.const.ts @@ -1,7 +1,9 @@ +import { ITestRunResultData } from '../../../../../../../shared/models/test-run-result.interface'; import { CHARTS_EN } from '../translate/en'; -export const tooltipKeys = ['algorithm', 'iterations']; -export const tooltipLabels = ['Algorithm', 'Iterations']; +type TooltipKeys = keyof ITestRunResultData; +export const tooltipKeys: TooltipKeys[] = ['iterations', 'message_size']; +export const tooltipLabels = ['Iterations', 'Message Size']; export enum ChartKey { averageCPU = 'averageCPU', diff --git a/portal/src/app/components/home/components/experiment/components/charts/utils/__mocks__/mocks.ts b/portal/src/app/components/home/components/experiment/components/charts/utils/__mocks__/mocks.ts index 77a9a4ba..1322d11a 100644 --- a/portal/src/app/components/home/components/experiment/components/charts/utils/__mocks__/mocks.ts +++ b/portal/src/app/components/home/components/experiment/components/charts/utils/__mocks__/mocks.ts @@ -5,6 +5,7 @@ export const MOCK_DATA_TO_SORT_BY_ALGORITHM: ITestRunResultData[] = [ id: 1, algorithm: "Algorithm1", iterations: 1000, + message_size: 1024, results: { averageCPU: 25.5, @@ -15,6 +16,7 @@ export const MOCK_DATA_TO_SORT_BY_ALGORITHM: ITestRunResultData[] = [ id: 2, algorithm: "Algorithm2", iterations: 100, + message_size: 2048, results: { averageCPU: 25, @@ -25,6 +27,7 @@ export const MOCK_DATA_TO_SORT_BY_ALGORITHM: ITestRunResultData[] = [ id: 3, algorithm: "Algorithm1", iterations: 20000, + message_size: 1024, results: { averageCPU: 25, @@ -38,6 +41,7 @@ export const MOCK_DATA_TO_SORT_BY_ITERATION: ITestRunResultData[] = [ id: 1, algorithm: "Algorithm1", iterations: 1000, + message_size: 1024, results: { averageCPU: 25.5, @@ -48,6 +52,7 @@ export const MOCK_DATA_TO_SORT_BY_ITERATION: ITestRunResultData[] = [ id: 2, algorithm: "Algorithm1", iterations: 100, + message_size: 512, results: { averageCPU: 25, @@ -58,6 +63,7 @@ export const MOCK_DATA_TO_SORT_BY_ITERATION: ITestRunResultData[] = [ id: 3, algorithm: "Algorithm1", iterations: 20000, + message_size: 1024, results: { averageCPU: 25, @@ -71,6 +77,7 @@ export const MOCK_DATA_FOR_CHART_UTILS: ITestRunResultData[] = [ id: 1, algorithm: "Algorithm1", iterations: 1000, + message_size: 1024, results: { averageCPU: 25.5, @@ -81,6 +88,7 @@ export const MOCK_DATA_FOR_CHART_UTILS: ITestRunResultData[] = [ id: 2, algorithm: "Algorithm2", iterations: 100, + message_size: 1024, results: { averageCPU: 25, @@ -91,6 +99,7 @@ export const MOCK_DATA_FOR_CHART_UTILS: ITestRunResultData[] = [ id: 3, algorithm: "Algorithm1", iterations: 20000, + message_size: 2048, results: { averageCPU: 25, diff --git a/portal/src/app/components/home/components/experiment/components/charts/utils/test-run.utils.test.ts b/portal/src/app/components/home/components/experiment/components/charts/utils/test-run.utils.test.ts index 86221250..a836db6b 100644 --- a/portal/src/app/components/home/components/experiment/components/charts/utils/test-run.utils.test.ts +++ b/portal/src/app/components/home/components/experiment/components/charts/utils/test-run.utils.test.ts @@ -9,6 +9,7 @@ describe('test-run utils', () => { id: 1, algorithm: "Algorithm1", iterations: 1000, + message_size: 1024, results: { averageCPU: 25.5, @@ -24,6 +25,7 @@ describe('test-run utils', () => { id: 2, algorithm: "Algorithm1", iterations: 100, + message_size: 512, results: { averageCPU: 25, diff --git a/portal/src/app/components/home/components/experiment/components/experiment-table/translate/en.ts b/portal/src/app/components/home/components/experiment/components/experiment-table/translate/en.ts index bb107b5e..98c49072 100644 --- a/portal/src/app/components/home/components/experiment/components/experiment-table/translate/en.ts +++ b/portal/src/app/components/home/components/experiment/components/experiment-table/translate/en.ts @@ -3,6 +3,7 @@ export const EXPERIMENT_TABLE_EN = { HASHTAG: '#', ALGORITHM: 'Algorithm', ITERATIONS: 'Iterations', + MESSAGE_SIZE: 'Message Size (KB)', AVERAGE_CPU: 'Average CPU', AVERAGE_MEMORY: 'Average Memory', }, diff --git a/portal/src/app/components/home/components/experiment/components/table-options/components/select-columns-popup/utils/convert-data-to-options.utils.test.ts b/portal/src/app/components/home/components/experiment/components/table-options/components/select-columns-popup/utils/convert-data-to-options.utils.test.ts index 4d5e5ec8..500ba524 100644 --- a/portal/src/app/components/home/components/experiment/components/table-options/components/select-columns-popup/utils/convert-data-to-options.utils.test.ts +++ b/portal/src/app/components/home/components/experiment/components/table-options/components/select-columns-popup/utils/convert-data-to-options.utils.test.ts @@ -11,12 +11,16 @@ describe('convertDataToOptions', () => { value: TableOptionsData.options[0] }, { - label: 'results.averageCPU', + label: 'message_size', value: TableOptionsData.options[1] }, { - label: 'results.averageMemory', + label: 'results.averageCPU', value: TableOptionsData.options[2] + }, + { + label: 'results.averageMemory', + value: TableOptionsData.options[3] } ]); }); diff --git a/portal/src/app/components/home/components/experiment/components/table-options/components/select-columns-popup/utils/convert-data-to-options.utils.ts b/portal/src/app/components/home/components/experiment/components/table-options/components/select-columns-popup/utils/convert-data-to-options.utils.ts index 159389e0..815db17f 100644 --- a/portal/src/app/components/home/components/experiment/components/table-options/components/select-columns-popup/utils/convert-data-to-options.utils.ts +++ b/portal/src/app/components/home/components/experiment/components/table-options/components/select-columns-popup/utils/convert-data-to-options.utils.ts @@ -7,12 +7,16 @@ export function convertDataToOptions(data: typeof TableOptionsData) { value: data.options[0] }, { - label: 'results.averageCPU', + label: 'message_size', value: data.options[1] }, { - label: 'results.averageMemory', + label: 'results.averageCPU', value: data.options[2] + }, + { + label: 'results.averageMemory', + value: data.options[3] } ]; } \ No newline at end of file diff --git a/portal/src/app/components/home/components/experiment/components/table-options/constants/table-options.const.ts b/portal/src/app/components/home/components/experiment/components/table-options/constants/table-options.const.ts index b1113438..c908529c 100644 --- a/portal/src/app/components/home/components/experiment/components/table-options/constants/table-options.const.ts +++ b/portal/src/app/components/home/components/experiment/components/table-options/constants/table-options.const.ts @@ -1,6 +1,12 @@ import { EXPERIMENT_TABLE_EN } from '../../experiment-table/translate/en'; import { Environment } from "../../../../../../../../environments/environment"; import { DashBoardPrefixLink } from "../../../../../../../shared/constants/dashboard"; +import { IResult, ITestRunResultData } from '../../../../../../../shared/models/test-run-result.interface'; + +type SelectedColumnsDefaultData = { + label: keyof ITestRunResultData | `results.${keyof IResult}`; + value: string; +}; const generateFromTime: number = Date.now(); export const initialLink: string = `${Environment.dashboardLinkHost}/${DashBoardPrefixLink}&from=${generateFromTime}`; @@ -8,13 +14,15 @@ export const initialLink: string = `${Environment.dashboardLinkHost}/${DashBoard export const TableOptionsData = { options: [ EXPERIMENT_TABLE_EN.TABLE_TITLES.ITERATIONS, + EXPERIMENT_TABLE_EN.TABLE_TITLES.MESSAGE_SIZE, EXPERIMENT_TABLE_EN.TABLE_TITLES.AVERAGE_CPU, EXPERIMENT_TABLE_EN.TABLE_TITLES.AVERAGE_MEMORY, ] }; -export const SelectedColumnsDefaultData = [ +export const SelectedColumnsDefaultData: SelectedColumnsDefaultData[] = [ { label: 'iterations', value: EXPERIMENT_TABLE_EN.TABLE_TITLES.ITERATIONS }, + { label: 'message_size', value: EXPERIMENT_TABLE_EN.TABLE_TITLES.MESSAGE_SIZE }, { label: 'results.averageCPU', value: EXPERIMENT_TABLE_EN.TABLE_TITLES.AVERAGE_CPU }, { label: 'results.averageMemory', value: EXPERIMENT_TABLE_EN.TABLE_TITLES.AVERAGE_MEMORY } ]; diff --git a/portal/src/app/components/protocol-query/ProtocolQuery.tsx b/portal/src/app/components/protocol-query/ProtocolQuery.tsx index c4865ea5..d7f040a5 100644 --- a/portal/src/app/components/protocol-query/ProtocolQuery.tsx +++ b/portal/src/app/components/protocol-query/ProtocolQuery.tsx @@ -7,9 +7,9 @@ import { AttSelect, AttSelectOption } from '../../shared/components/att-select'; import styles from './ProtocolQuery.module.scss'; import { PROTOCOL_QUERY_EN } from './translate/en'; import { Spinner, SpinnerSize } from '../../shared/components/att-spinner'; -import { useGetAlgorithms, useGetIterations } from './hooks'; +import { useGetAlgorithms, useGetIterations, useMessageSizeData } from './hooks'; import { handleAlgorithmsSelection } from './utils'; -import { AlgorithmsSelectorCustomOption, IterationsSelectorCustomOption } from '../../shared/components/selector-custom-option'; +import { AlgorithmsSelectorCustomOption, SelectorCustomOption } from '../../shared/components/selector-custom-option'; import { ExperimentData } from '../all-experiments/models/experiments.interface'; import { useDuplicateData } from './hooks'; @@ -28,19 +28,25 @@ export interface ProtocolQueryProps { export const ProtocolQuery: React.FC = (props: ProtocolQueryProps) => { const { isFetching, onRunClick, duplicateData, setDuplicateData } = props; const { algorithmOptions, algosBySection } = useGetAlgorithms(); - const { iterationsOptions } = useGetIterations(); const [experimentName, setExperimentName] = useState(''); const [algorithms, setAlgorithms] = useState(); const [prevSelectedValues, setPrevSelectedValues] = useState([]); const [description, setDescription] = useState(''); + const { iterationsOptions } = useGetIterations(); const [iterationsCount, setIterationsCount] = useState([]); - const [showInputOption, setShowInputOption] = useState(false); - const [inputValue, setInputValue] = useState(''); + const [showIterationsInputOption, setShowIterationsInputOption] = useState(false); + const [iterationsInputValue, setIterationsInputValue] = useState(''); const [iterationsMenuIsOpen, setIterationsMenuIsOpen] = useState(false); - useDuplicateData({ data: duplicateData, setDuplicateData, setExperimentName, setAlgorithms, setIterationsCount }); + const { messageSizeOptions } = useMessageSizeData(); + const [messageSize, setMessageSize] = useState([]); + const [showMessageSizeInputOption, setShowMessageSizeInputOption] = useState(false); + const [messageSizeInputValue, setMessageSizeInputValue] = useState(''); + const [messageSizeMenuIsOpen, setMessageSizeMenuIsOpen] = useState(false); + + useDuplicateData({ data: duplicateData, setDuplicateData, setExperimentName, setAlgorithms, setIterationsCount, setMessageSize }); const onSubmitHandler = (event: React.FormEvent) => { event.preventDefault(); @@ -48,6 +54,7 @@ export const ProtocolQuery: React.FC = (props: ProtocolQuery experimentName, algorithms: algorithms as SelectOptionType, iterationsCount: iterationsCount as SelectOptionType, + messageSizes: messageSize as SelectOptionType, description }); }; @@ -70,6 +77,12 @@ export const ProtocolQuery: React.FC = (props: ProtocolQuery setIterationsCount(selectedIterationNum); }, []); + const onMessageSizeChanged: OnSelectChanged = useCallback((options: SelectOptionType): void => { + const selectedMessageSize: AttSelectOption[] = options as AttSelectOption[]; + setMessageSizeMenuIsOpen(true); + setMessageSize(selectedMessageSize); + }, []); + const onDescriptionChanged: onTextAreaChangedEvent = (event: React.ChangeEvent) => { setDescription(event.target.value); }; @@ -131,17 +144,46 @@ export const ProtocolQuery: React.FC = (props: ProtocolQuery required customComponent={{ Option: (props: any) => - }} /> +
+ + + + }} + /> +
+
+ +
+ + +
+
+
+
+ +
+
+
+ +
+
+ +
+
diff --git a/portal/src/app/components/protocol-query/hooks/index.ts b/portal/src/app/components/protocol-query/hooks/index.ts index f5861164..9ba4136a 100644 --- a/portal/src/app/components/protocol-query/hooks/index.ts +++ b/portal/src/app/components/protocol-query/hooks/index.ts @@ -1,3 +1,4 @@ +export * from './useDuplicateData'; export * from './useGetAlgorithms'; export * from './useGetIterations'; -export * from './useDuplicateData'; +export * from './useMessageSizeData'; diff --git a/portal/src/app/components/protocol-query/hooks/useDuplicateData.test.ts b/portal/src/app/components/protocol-query/hooks/useDuplicateData.test.ts index b1eefe96..85200484 100644 --- a/portal/src/app/components/protocol-query/hooks/useDuplicateData.test.ts +++ b/portal/src/app/components/protocol-query/hooks/useDuplicateData.test.ts @@ -8,6 +8,7 @@ describe('useDuplicateData', () => { const setExperimentName = jest.fn(); const setAlgorithms = jest.fn(); const setIterationsCount = jest.fn(); + const setMessageSize = jest.fn(); const setDuplicateData = jest.fn(); const duplicateData: ExperimentData = { @@ -15,6 +16,7 @@ describe('useDuplicateData', () => { name: 'test', algorithms: ['algorithm1', 'algorithm2'], iterations: [1, 2, 3], + message_sizes: [4, 5, 6], end_time: 1705240065192, }; @@ -25,7 +27,8 @@ describe('useDuplicateData', () => { setExperimentName, setAlgorithms, setIterationsCount, - } as DuplicateData, + setMessageSize, + } as DuplicateData }); expect(setExperimentName).not.toHaveBeenCalled(); @@ -39,11 +42,13 @@ describe('useDuplicateData', () => { setExperimentName, setAlgorithms, setIterationsCount, + setMessageSize }); expect(setExperimentName).toHaveBeenCalledWith(duplicateData.name); expect(setAlgorithms).toHaveBeenCalledWith(duplicateData.algorithms.map(algorithm => ({ label: algorithm, value: algorithm } as AttSelectOption))); expect(setIterationsCount).toHaveBeenCalledWith(duplicateData.iterations.map(iteration => ({ label: iteration.toString(), value: iteration.toString() } as AttSelectOption))); + expect(setMessageSize).toHaveBeenCalledWith(duplicateData.message_sizes.map(messageSize => ({ label: messageSize.toString(), value: messageSize.toString() } as AttSelectOption))); expect(setDuplicateData).toHaveBeenCalledWith(undefined); }); }); diff --git a/portal/src/app/components/protocol-query/hooks/useDuplicateData.ts b/portal/src/app/components/protocol-query/hooks/useDuplicateData.ts index 8cf59d88..4f03b2a1 100644 --- a/portal/src/app/components/protocol-query/hooks/useDuplicateData.ts +++ b/portal/src/app/components/protocol-query/hooks/useDuplicateData.ts @@ -4,11 +4,13 @@ import { ExperimentData } from '../../all-experiments/models/experiments.interfa export type DuplicateData = { data: ExperimentData | undefined, - setDuplicateData: (data: any) => void, + setDuplicateData: (data?: ExperimentData) => void, setExperimentName: (name: string) => void, setAlgorithms: (options: AttSelectOption[]) => void, - setIterationsCount: (options: AttSelectOption[]) => void + setIterationsCount: (options: AttSelectOption[]) => void, + setMessageSize: (options: AttSelectOption[]) => void } + export const useDuplicateData = (duplicate: DuplicateData) => { useEffect(() => { if (duplicate.data) { @@ -22,13 +24,18 @@ export const useDuplicateData = (duplicate: DuplicateData) => { }); duplicate.setAlgorithms(algorithmOptions); } - if (duplicateData.iterations) { const iterationsOptions = duplicateData.iterations.map((iteration: number) => { return { label: iteration.toString(), value: iteration.toString() } as AttSelectOption; }); duplicate.setIterationsCount(iterationsOptions); } + if (duplicateData.message_sizes) { + const messageSizeOptions = duplicateData.message_sizes.map((messageSize: number) => { + return { label: messageSize.toString(), value: messageSize.toString() } as AttSelectOption; + }); + duplicate.setMessageSize(messageSizeOptions); + } duplicate.setDuplicateData(undefined); } }, [duplicate]); diff --git a/portal/src/app/components/protocol-query/hooks/useMessageSizeData.test.ts b/portal/src/app/components/protocol-query/hooks/useMessageSizeData.test.ts new file mode 100644 index 00000000..309eaddf --- /dev/null +++ b/portal/src/app/components/protocol-query/hooks/useMessageSizeData.test.ts @@ -0,0 +1,24 @@ +import { renderHook } from '@testing-library/react'; +import { useFetch } from '../../../shared/hooks/useFetch'; +import { useMessageSizeData } from './useMessageSizeData'; + +jest.mock('../../../shared/hooks/useFetch', () => ({ + useFetch: jest.fn(), +})); + +describe('useMessageSizeData', () => { + test('Should be in Success mode', () => { + const mockData = { + message_sizes: [1, 2, 3, 4, 5, 6, 7, 8, 9], + }; + + (useFetch as jest.Mock).mockReturnValue({ + get: jest.fn(), + data: mockData, + cancelRequest: jest.fn(), + }); + + const { result } = renderHook(() => useMessageSizeData()); + expect(result.current.messageSizeOptions.length).toEqual(mockData.message_sizes.length + 2); + }); +}); \ No newline at end of file diff --git a/portal/src/app/components/protocol-query/hooks/useMessageSizeData.ts b/portal/src/app/components/protocol-query/hooks/useMessageSizeData.ts new file mode 100644 index 00000000..7c4fa9f8 --- /dev/null +++ b/portal/src/app/components/protocol-query/hooks/useMessageSizeData.ts @@ -0,0 +1,37 @@ +import { AttSelectOption } from "../../../shared/components/att-select"; +import { IHttp, useFetch } from "../../../shared/hooks/useFetch"; +import { useEffect, useState } from "react"; +import { APIS } from "../../../apis"; +import { SELECTOR_CUSTOM_OPTION_EN } from "../../../shared/components/selector-custom-option/translate/en"; + +export interface IUseMessageSizeData { + messageSizeOptions: AttSelectOption[]; +} + +interface IMessageSize { + message_sizes: number[]; +} + +export function useMessageSizeData(): IUseMessageSizeData { + const [messageSizeOptions, setMessageSize] = useState([]); + const { get, data, cancelRequest }: IHttp = useFetch({ url: APIS.message_sizes }); + + useEffect(() => { + get(); + return cancelRequest; + }, [get, cancelRequest]); + + + useEffect(() => { + if (data) { + const messageSizeOptions: AttSelectOption[] = data.message_sizes.map((message_size: number) => ({ label: message_size.toString(), value: message_size.toString() })); + setMessageSize([ + ...messageSizeOptions, + { label: SELECTOR_CUSTOM_OPTION_EN.ADD_NEW, value: SELECTOR_CUSTOM_OPTION_EN.ADD_NEW, metadata: { isInput: true }}, + { label: SELECTOR_CUSTOM_OPTION_EN.ADD_NEW_BUTTON, value: SELECTOR_CUSTOM_OPTION_EN.ADD_NEW_BUTTON, metadata: { isAddNewButton: true }} + ]); + } + }, [data]); + + return { messageSizeOptions }; +} diff --git a/portal/src/app/components/protocol-query/utils/convertBytesToHumanReadable.test.ts b/portal/src/app/components/protocol-query/utils/convertBytesToHumanReadable.test.ts new file mode 100644 index 00000000..fb2a8488 --- /dev/null +++ b/portal/src/app/components/protocol-query/utils/convertBytesToHumanReadable.test.ts @@ -0,0 +1,31 @@ +import { convertBytesToHumanReadable } from './convertBytesToHumanReadable'; +import { AttSelectOption } from '../../../shared/components/att-select'; + +describe('convertBytesToHumanReadable', () => { + it('should convert bytes to human readable format', () => { + const input: AttSelectOption[] = [ + { label: '1024', value: '1024' }, + { label: '204800', value: '204800' }, + { label: '1048576', value: '1048576' }, + ]; + + const output = convertBytesToHumanReadable(input); + + expect(output).toEqual([ + { label: '1.024 kB', value: '1.024 kB', metadata: undefined }, + { label: '204.8 kB', value: '204.8 kB', metadata: undefined }, + { label: '1.049 MB', value: '1.049 MB', metadata: undefined }, + ]); + }); + + it('should return the original option if value is not a number', () => { + const input: AttSelectOption[] = [ + { label: '', value: '', metadata: { isInput: true } }, + { label: '+ Add new', value: '+ Add new', metadata: { isAddNewButton: true } }, + ]; + + const output = convertBytesToHumanReadable(input); + + expect(output).toEqual(input); + }); +}); diff --git a/portal/src/app/components/protocol-query/utils/convertBytesToHumanReadable.ts b/portal/src/app/components/protocol-query/utils/convertBytesToHumanReadable.ts new file mode 100644 index 00000000..395e6547 --- /dev/null +++ b/portal/src/app/components/protocol-query/utils/convertBytesToHumanReadable.ts @@ -0,0 +1,16 @@ +import { filesize } from 'filesize'; +import { AttSelectOption } from '../../../shared/components/att-select'; + +export function convertBytesToHumanReadable(messageSizeOptions: AttSelectOption[]) { + return messageSizeOptions.map((option: AttSelectOption) => { + if (!option.value || isNaN(+option.value)) { + return option; + } + const sizeOption = filesize(+option.value, {round: 3}); + return { + label: sizeOption, + value: sizeOption, + metadata: option.metadata + } as AttSelectOption; + }); +} \ No newline at end of file diff --git a/portal/src/app/components/protocol-query/utils/index.ts b/portal/src/app/components/protocol-query/utils/index.ts index e0b2f89e..49d978da 100644 --- a/portal/src/app/components/protocol-query/utils/index.ts +++ b/portal/src/app/components/protocol-query/utils/index.ts @@ -1 +1,2 @@ -export * from './handleAlgorithmsChange'; \ No newline at end of file +export * from './handleAlgorithmsChange'; +export * from './convertBytesToHumanReadable'; \ No newline at end of file diff --git a/portal/src/app/hooks/useDashboardData.test.ts b/portal/src/app/hooks/useDashboardData.test.ts index d5a906f8..0b0a28a1 100644 --- a/portal/src/app/hooks/useDashboardData.test.ts +++ b/portal/src/app/hooks/useDashboardData.test.ts @@ -50,6 +50,7 @@ describe('useDashboardData', () => { experimentName: 'test', algorithms: [{ label: 'algo1', value: 'algo1' }, { label: 'algo2', value: 'algo2' }, { label: 'algo3', value: 'algo3' }, { label: 'algo4', value: 'algo4' }], iterationsCount: [{ label: '1000', value: '1000' }], + messageSizes: [{ label: '1024', value: '1024' }], description: 'test' }; @@ -62,6 +63,7 @@ describe('useDashboardData', () => { experimentName: 'test', algorithms: ['algo1', 'algo2', 'algo3', 'algo4'], iterationsCount: [1000], + messageSizes: [1024], description: 'test' } }); diff --git a/portal/src/app/hooks/useDashboardData.ts b/portal/src/app/hooks/useDashboardData.ts index fc5052d6..63fbd0ee 100644 --- a/portal/src/app/hooks/useDashboardData.ts +++ b/portal/src/app/hooks/useDashboardData.ts @@ -10,13 +10,18 @@ export interface IUseDashboardData { testSuiteId: string; status: FetchDataStatus; handleRunQueryClick: (queryData: ITestParams) => void; -} +}; + +interface ITestRequestData { + experimentName: string; + algorithms: string[]; + iterationsCount: number[]; + messageSizes: number[]; + description: string; +}; export function useDashboardData(): IUseDashboardData { const { post, data, status, error, cancelRequest }: IHttp = useFetch({ url: APIS.analyze }); - const [dashboardData, setDashboardData] = useState(() => new Map()); - const [algorithms, setAlgorithms] = useState([]); - const [iterationsCount, setIterationsCount] = useState([]); const [testSuiteId, setTestSuiteId] = useState(''); useFetchSpinner(status); @@ -30,44 +35,27 @@ export function useDashboardData(): IUseDashboardData { }, [data, status]); const handleRunQueryClick: (queryData: ITestParams) => void = useCallback((queryData: ITestParams): void => { - let algoValues: string[] = []; + let algorithmsValues: string[] = []; let iterationsValues: number[] = []; - - if (queryData.algorithms) { - const algos = queryData.algorithms as AttSelectOption[]; - const map: ChartDataMap = new Map(); - - algos.forEach((algo: AttSelectOption) => { - map.set(algo, undefined); - algoValues.push(algo.value); - }); - - setAlgorithms(algoValues); - setDashboardData(map); - algoValues = algos.map((item: AttSelectOption) => item.value); - } + let messageSizesValues: number[] = []; - if (queryData.iterationsCount) { - const iterations = queryData.iterationsCount as AttSelectOption[]; - const map: ChartDataMap = new Map(); + const algorithms = queryData.algorithms as AttSelectOption[]; + algorithmsValues = algorithms.map((algorithm: AttSelectOption) => algorithm.value); - iterations.forEach((iteration: AttSelectOption) => { - map.set(iteration, undefined); - iterationsValues.push(+iteration.value); - }); + const iterations = queryData.iterationsCount as AttSelectOption[]; + iterationsValues = iterations.map((iteration: AttSelectOption) => +iteration.value); - setIterationsCount(iterationsValues); - setDashboardData(map); - iterationsValues = iterations.map((item: AttSelectOption) => +item.value); - } + const messageSizes = queryData.messageSizes as AttSelectOption[]; + messageSizesValues = messageSizes.map((messageSize: AttSelectOption) => +messageSize.value); post({ data: { - experimentName: queryData.experimentName, - algorithms: algoValues, + experimentName: queryData.experimentName ?? '', + algorithms: algorithmsValues, iterationsCount: iterationsValues, - description: queryData.description - } + messageSizes: messageSizesValues, + description: queryData.description ?? '' + } as ITestRequestData }); }, [post]); diff --git a/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.module.scss b/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.module.scss index 49f29af9..e2d798c6 100644 --- a/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.module.scss +++ b/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.module.scss @@ -17,7 +17,7 @@ margin-inline-end: 12px; } -.iterations_input_option { +.custom_input_option { margin-inline-end: 10px; cursor: pointer; } diff --git a/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.test.tsx b/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.test.tsx index 2d26c1ad..923a745f 100644 --- a/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.test.tsx +++ b/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.test.tsx @@ -1,5 +1,5 @@ import { render, RenderResult } from '@testing-library/react'; -import { AlgorithmsSelectorCustomOption, IterationsSelectorCustomOption, SelectorCustomOptionProps } from './SelectorCustomOption'; +import { AlgorithmsSelectorCustomOption, SelectorCustomOption, SelectorCustomOptionProps } from './SelectorCustomOption'; describe('SelectorCustomOption', () => { const mockOption = { value: 'option1', label: 'Option 1' }; @@ -39,8 +39,8 @@ describe('SelectorCustomOption', () => { expect(container.firstChild).toMatchSnapshot(); }); - it('should render IterationsSelectorCustomOption correctly', () => { - const { container }: RenderResult = render(); + it('should render SelectorCustomOption correctly', () => { + const { container }: RenderResult = render(); expect(container.firstChild).toMatchSnapshot(); }); }); \ No newline at end of file diff --git a/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.tsx b/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.tsx index b2166fc9..0859d042 100644 --- a/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.tsx +++ b/portal/src/app/shared/components/selector-custom-option/SelectorCustomOption.tsx @@ -39,7 +39,7 @@ export const AlgorithmsSelectorCustomOption: React.FC ); }; -export const IterationsSelectorCustomOption: React.FC = (props: SelectorCustomOptionProps) => { +export const SelectorCustomOption: React.FC = (props: SelectorCustomOptionProps) => { return ( <> {!props.data.metadata && ( @@ -48,7 +48,7 @@ export const IterationsSelectorCustomOption: React.FC props.onOptionChanged} /> diff --git a/portal/src/app/shared/components/selector-custom-option/__snapshots__/SelectorCustomOption.test.tsx.snap b/portal/src/app/shared/components/selector-custom-option/__snapshots__/SelectorCustomOption.test.tsx.snap index b7f7f765..016f0109 100644 --- a/portal/src/app/shared/components/selector-custom-option/__snapshots__/SelectorCustomOption.test.tsx.snap +++ b/portal/src/app/shared/components/selector-custom-option/__snapshots__/SelectorCustomOption.test.tsx.snap @@ -27,7 +27,7 @@ exports[`SelectorCustomOption should render AlgorithmsSelectorCustomOption corre
`; -exports[`SelectorCustomOption should render IterationsSelectorCustomOption correctly 1`] = ` +exports[`SelectorCustomOption should render SelectorCustomOption correctly 1`] = `
diff --git a/portal/src/app/shared/models/quantum.interface.ts b/portal/src/app/shared/models/quantum.interface.ts index 9d246a87..4353b12a 100644 --- a/portal/src/app/shared/models/quantum.interface.ts +++ b/portal/src/app/shared/models/quantum.interface.ts @@ -7,6 +7,7 @@ export interface ITestParams { experimentName: string; algorithms: SelectOptionType; iterationsCount: SelectOptionType; + messageSizes: SelectOptionType; description: string; } diff --git a/portal/src/app/shared/models/test-run-result.interface.ts b/portal/src/app/shared/models/test-run-result.interface.ts index 2f451f4b..db9a8165 100644 --- a/portal/src/app/shared/models/test-run-result.interface.ts +++ b/portal/src/app/shared/models/test-run-result.interface.ts @@ -7,6 +7,7 @@ export interface ITestRunResultData { id: number; algorithm: string; iterations: number; + message_size: number; results: IResult; } export interface IEnvironmentInfo { diff --git a/portal/src/setupProxy.js b/portal/src/setupProxy.js index 739a8e14..cb1b123f 100644 --- a/portal/src/setupProxy.js +++ b/portal/src/setupProxy.js @@ -6,7 +6,7 @@ module.exports = (app) => { return; } app.use( - ['/analyze', '/algorithms', '/iterations', '/qujata-api'], + ['/analyze', '/algorithms', '/iterations', '/message_sizes', '/qujata-api'], createProxyMiddleware({ target, changeOrigin: true, diff --git a/portal/yarn.lock b/portal/yarn.lock index fcf80b7b..ed975f70 100644 --- a/portal/yarn.lock +++ b/portal/yarn.lock @@ -5056,6 +5056,11 @@ filelist@^1.0.1: dependencies: minimatch "^5.0.1" +filesize@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/filesize/-/filesize-10.1.0.tgz#846f5cd8d16e073c5d6767651a8264f6149183cd" + integrity sha512-GTLKYyBSDz3nPhlLVPjPWZCnhkd9TrrRArNcy8Z+J2cqScB7h2McAzR6NBX6nYOoWafql0roY8hrocxnZBv9CQ== + filesize@^8.0.6: version "8.0.7" resolved "https://registry.yarnpkg.com/filesize/-/filesize-8.0.7.tgz#695e70d80f4e47012c132d57a059e80c6b580bd8" diff --git a/run/docker/docker-compose.yml b/run/docker/docker-compose.yml index 9c1ce1f1..a1cafad5 100644 --- a/run/docker/docker-compose.yml +++ b/run/docker/docker-compose.yml @@ -45,7 +45,7 @@ services: - DEFAULT_GROUPS=prime256v1:secp384r1:frodo640aes:frodo640shake:frodo976aes:frodo976shake:frodo1344aes:frodo1344shake:kyber512:p256_kyber512:kyber768:p384_kyber768:x25519_kyber768:kyber1024:bikel1:bikel3:bikel5:hqc128:hqc192:hqc256 portal: - image: qujata/portal:1.1.0 + image: qujata/portal:1.2.0 container_name: qujata-portal ports: - 2000:80