Skip to content

Commit 3948599

Browse files
authored
Benchmark report (#345)
* feat(ui): support for deleting multiple reports * feat(ui): support for comparing runs to benchmark
1 parent 0a0b630 commit 3948599

File tree

19 files changed

+613
-200
lines changed

19 files changed

+613
-200
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ ARG PREDATOR_DOCS_URL
2424
# Build UI from sources
2525
WORKDIR /usr/ui
2626
RUN npm ci --silent
27-
RUN BUCKET_PATH=$BUCKET_PATH PREDATOR_DOCS_URL=$PREDATOR_DOCS_URL npm run build
27+
RUN VERSION=$(node -p -e "require('/usr/package.json').version") && BUCKET_PATH=$BUCKET_PATH PREDATOR_DOCS_URL=$PREDATOR_DOCS_URL VERSION=$VERSION npm run build
2828
# Clean up
2929
RUN mv /usr/ui/dist /tmp/dist && rm -rf /usr/ui/* && mv /tmp/dist /usr/ui/dist
3030

package-lock.json

Lines changed: 46 additions & 46 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/config/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = {
3434
BUCKET_PATH: env.BUCKET_PATH || '/',
3535
}),
3636
new webpack.NamedModulesPlugin(),
37-
new webpack.EnvironmentPlugin(['NODE_ENV', 'BUCKET_PATH', 'PREDATOR_URL', 'PREDATOR_DOCS_URL']),
37+
new webpack.EnvironmentPlugin(['NODE_ENV', 'BUCKET_PATH', 'PREDATOR_URL', 'PREDATOR_DOCS_URL','VERSION']),
3838
new MonacoWebpackPlugin()
3939
]
4040
};

ui/src/App/common/env.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
module.exports = {
22
PREDATOR_URL: generatePredatorUrl(),
33
PREDATOR_DOCS_URL: generatePredatorDocsUrl(),
4-
BUCKET_PATH: generateBucketPath()
4+
BUCKET_PATH: generateBucketPath(),
5+
VERSION: process.env.VERSION || 'dev-mode'
56
};
67

78
function generatePredatorUrl() {

ui/src/features/components/DrawerE/index.js

Lines changed: 48 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ import {connect} from 'react-redux'
55
import history from '../../../store/history';
66
import logo from '../../../images/logo.png';
77
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome';
8-
8+
import {VERSION} from '../../../App/common/env';
9+
import {faPoll} from "@fortawesome/free-solid-svg-icons";
910

1011
const Logo = () => {
1112

@@ -56,7 +57,7 @@ class DrawerE extends Component {
5657
flex: 'initial'
5758

5859
}
59-
const appLogoInnerStyle={
60+
const appLogoInnerStyle = {
6061
display: 'flex',
6162
paddingLeft: '0px',
6263
paddingRight: '0',
@@ -66,13 +67,22 @@ class DrawerE extends Component {
6667
return (
6768
<div className={classes}>
6869
<Drawer
69-
containerStyle={{backgroundImage: 'linear-gradient(142deg,#00041a,#00126b)'}}
70+
containerStyle={{
71+
backgroundImage: 'linear-gradient(142deg,#00041a,#00126b)',
72+
display: 'flex',
73+
flexDirection: 'column'
74+
}}
7075
docked
7176
open={open}
7277
onClose={this.handleClose}>
7378
<AppBar showMenuIconButton={false} title={<Logo/>} titleStyle={style['appbar-logo']}
7479
titleStyle={appLogoTitleStyle} style={appLogoInnerStyle} className={style.appbar}/>
75-
<div style={{marginTop: '45px', paddingLeft: '9px', width: '100%'}}>
80+
<div style={{
81+
marginTop: '45px', paddingLeft: '9px', width: '100%',
82+
display: 'flex',
83+
flexDirection: 'column',
84+
justifyContent: 'space-between'
85+
}}>
7686

7787
<List>
7888
{listItemData.map((listItem) => {
@@ -94,7 +104,7 @@ class DrawerE extends Component {
94104
// className={url.includes(nestedItem.navigateTo) ? style['menu-selected'] : undefined}
95105
primaryText={nestedItem.primaryText}
96106
onClick={nestedItem.linkUrl ? () => window.open(nestedItem.linkUrl, '_blank') : () => this.apiClick(`/${nestedItem.navigateTo}`)}
97-
iconStyle={{fontSize:'5px'}}
107+
iconStyle={{fontSize: '5px'}}
98108
leftIcon={nestedItem.icon &&
99109
<FontAwesomeIcon size={'xs'} className={style.icon}
100110
icon={nestedItem.icon} fixedWidth/>}
@@ -107,6 +117,15 @@ class DrawerE extends Component {
107117
})}
108118
</List>
109119
</div>
120+
<div style={{
121+
color: '#c2c2c28f',
122+
display: 'flex',
123+
flex: 1,
124+
justifyContent: 'center',
125+
alignItems: 'flex-end',
126+
}}>
127+
<Bottom/>
128+
</div>
110129
</Drawer>
111130
<AppBar
112131
// title={<span style={{ cursor: 'default' }}><img width={'50px'} height={'50px'} src={Logo} alt={'Mickey'}/>Predator</span>}
@@ -123,10 +142,34 @@ class DrawerE extends Component {
123142
}
124143
}
125144

145+
146+
const Bottom = () => {
147+
return (
148+
<div style={{
149+
display: 'flex', marginBottom: '10px',
150+
flexDirection: 'row',
151+
flex: 1,
152+
justifyContent: 'space-between',
153+
marginLeft: '10px',
154+
marginRight: '10px',
155+
alignItems: 'center'
156+
}}>
157+
<FontAwesomeIcon size={'2x'} style={{
158+
color: 'white',
159+
cursor: 'pointer'
160+
}} icon={faPoll}
161+
onClick={() => window.open("https://docs.google.com/forms/d/15dozkkA2xBUV7T7ls5XMyBj-JDg5Tj-TXNMp9PkdFsM/viewform?edit_requested=true")}/>
162+
<div> v{VERSION}</div>
163+
</div>
164+
)
165+
}
166+
167+
126168
function mapStateToProps(state) {
127169
return {
128170
url: state.router.location.pathname
129171
}
130172
}
131173

174+
132175
export default connect(mapStateToProps)(DrawerE);

ui/src/features/components/Report/Charts.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const COLORS = [{stroke: "#8884d8", fill: "#8884d8"},
2121
{stroke: "#395B56", fill: "#395B56"},
2222
{stroke: "#617A70", fill: "#617A70"},
2323
{stroke: "#CCC39F", fill: "#CCC39F"},
24-
{stroke: "#FFFAD1", fill: "#FFFAD1"},
24+
{stroke: "#827e5b", fill: "#827e5b"},
2525
];
2626
const COLOR_FAMILY = {
2727
p95: [{stroke: "#BBDEF0", fill: "#BBDEF0"}, {stroke: "#00A6A6", fill: "#00A6A6"}, {
@@ -54,10 +54,10 @@ const getColor = (key, index) => {
5454
};
5555

5656
const filterKeysFromArrayOfObject = (data, graphType, filteredKeys) => {
57-
const keysToFilter = Object.keys(_.pickBy(filteredKeys, (value) => value));
57+
const keysToFilter = Object.keys(_.pickBy(filteredKeys[graphType] || {}, (value) => value));
5858
const filteredData = data.reduce((acc, cur) => {
5959
acc.push(_.omitBy(cur, (value, key) => {
60-
return keysToFilter.includes(`${graphType}${key}`)
60+
return keysToFilter.includes(`${key}`)
6161
}));
6262
return acc;
6363
}, []);
@@ -100,7 +100,6 @@ export const BarChartPredator = ({data = [], keys=[], graphType, onSelectedGraph
100100

101101
export const LineChartPredator = ({data = [], keys = [], labelY, graphType, onSelectedGraphPropertyFilter, filteredKeys}) => {
102102
const filteredData = filterKeysFromArrayOfObject(data, graphType, filteredKeys);
103-
104103
return (
105104
<ResponsiveContainer width="100%" height={300}>
106105
<LineChart
@@ -154,7 +153,7 @@ const renderLegend = (props) => {
154153
style={{margin: '5px', display: 'flex', flexDirection: 'row', alignItems: 'center'}}>
155154
<Checkbox
156155
indeterminate={false}
157-
checked={filteredKeys[`${graphType}${entry.value}`] === undefined || filteredKeys[`${graphType}${entry.value}`] === false}
156+
checked={_.get(filteredKeys,`${graphType}.${entry.value}`) === undefined || _.get(filteredKeys,`${graphType}.${entry.value}`) === false}
158157
// disabled={}
159158
onChange={(value) => {
160159
onSelectedGraphPropertyFilter(graphType, entry.value, value)

0 commit comments

Comments
 (0)