-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ui: add end-to-end request/response via grcp-web
fixes #8
- Loading branch information
Showing
6 changed files
with
128 additions
and
46 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,38 @@ | ||
import Typography from '@mui/material/Typography'; | ||
import Box from '@mui/material/Box'; | ||
import Chip from '@mui/material/Chip'; | ||
|
||
import { V1RunLoadtestResponse as Result } from 'src/gen/LoadtestApi'; | ||
import { | ||
RunLoadtestResponse as Result, | ||
} from 'src/gen/orijtech/cosmosloadtester/v1/loadtest_service_pb'; | ||
|
||
interface OutputProps { | ||
data: Result; | ||
data: Result.AsObject; | ||
}; | ||
|
||
interface ResultBarProps { | ||
title: string; | ||
value: string | number; | ||
}; | ||
|
||
function ResultBar(props: ResultBarProps) { | ||
const { title, value } = props; | ||
return ( | ||
<span style={{ marginRight: 5 }}> | ||
<Chip label={title} size='small' variant='outlined' color='info' sx={{ borderRadius: 0 }} /> | ||
<Chip label={value} size='small' variant='filled' color='info' sx={{ borderRadius: 0 }} /> | ||
</span> | ||
); | ||
} | ||
|
||
export default function Inputs(props: OutputProps) { | ||
const { data } = props; | ||
return ( | ||
<Box> | ||
<Typography variant='caption'> | ||
<pre style={{ whiteSpace: 'pre-line', wordWrap: 'break-word' }}> | ||
{JSON.stringify(props.data, null, 2)} | ||
</pre> | ||
</Typography> | ||
<ResultBar title='avg bytes per second' value={data.avgBytesPerSecond} /> | ||
<ResultBar title='avg tx per second' value={data.avgTxsPerSecond} /> | ||
<ResultBar title='total bytes' value={data.totalBytes} /> | ||
<ResultBar title='total time' value={`${data.totalTime?.seconds || 0} seconds`} /> | ||
<ResultBar title='total tx' value={data.totalTxs} /> | ||
</Box> | ||
) | ||
); | ||
} |