From 60f9df2c3339f4071476a1cfb2543d5a98347a0f Mon Sep 17 00:00:00 2001 From: Anisha1234 Date: Thu, 19 Nov 2020 16:22:08 +0530 Subject: [PATCH] adds chart and legends --- src/pages/Overview/index.js | 428 +++++++++++++++++++++++++++++++--- src/pages/Overview/index.less | 19 +- 2 files changed, 419 insertions(+), 28 deletions(-) diff --git a/src/pages/Overview/index.js b/src/pages/Overview/index.js index 6b7144625..48813918f 100644 --- a/src/pages/Overview/index.js +++ b/src/pages/Overview/index.js @@ -11,6 +11,11 @@ import { Tab, } from '@patternfly/react-core'; import { + Chart, + ChartBar, + ChartAxis, + ChartStack, + ChartVoronoiContainer, ChartDonutThreshold, ChartDonutUtilization, ChartThemeColor, @@ -18,7 +23,12 @@ import { import { Icon } from 'antd'; import { connect } from 'dva'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; -import { OutlinedClockIcon, UndoAltIcon } from '@patternfly/react-icons'; +import { + OutlinedClockIcon, + UndoAltIcon, + ExternalLinkAltIcon, + EllipsisVIcon, +} from '@patternfly/react-icons'; import { faExclamationCircle } from '@fortawesome/free-solid-svg-icons'; import Table from '@/components/Table'; // import { Table } from 'antd'; @@ -34,6 +44,7 @@ class Overview extends React.Component { super(props); this.state = { activeTabKey: 0, + barWidth: '20', }; } @@ -55,8 +66,13 @@ class Overview extends React.Component { }); }; + showDrowpdown = () => { + console.log('here'); + }; + render() { - const { activeTabKey } = this.state; + const { activeTabKey, barWidth } = this.state; + const columns = [ { title: 'Result', @@ -89,7 +105,17 @@ class Overview extends React.Component { title: '', dataIndex: 'action', key: 'action', - render: () =>

action

, + render: () => ( +
+ this.showDrowpdown()} /> + {/* */} +
+ ), }, ]; const data = [ @@ -101,19 +127,19 @@ class Overview extends React.Component { }, { key: 2, - result: ['fio_2020.09.10T12.42.11', ' 2020-09-10T 11:52:34:552478'], + result: ['fio_2020.09.10T12.42.12', ' 2020-09-10T 11:52:34:552478'], end: '2020-09-10T 11:52:34:552478', description: 'More content can be added here', }, { key: 3, - result: ['fio_2020.09.10T12.42.11', ' 2020-09-10T 11:52:34:552478'], + result: ['fio_2020.09.10T12.42.13', ' 2020-09-10T 11:52:34:552478'], end: '2020-09-10T 11:52:34:552478', description: 'More content can be added here', }, { key: 4, - result: ['fio_2020.09.10T12.42.11', ' 2020-09-10T 11:52:34:552478'], + result: ['fio_2020.09.10T12.42.14', ' 2020-09-10T 11:52:34:552478'], end: '2020-09-10T 11:52:34:552478', description: 'More content can be added here', }, @@ -130,7 +156,7 @@ class Overview extends React.Component { }; return ( -
+
@@ -212,6 +238,85 @@ class Overview extends React.Component {
+ +
+ + + + 2020-09-10T + 11:52:34:552478 + + +
+
+ +
+ + + + 2020-09-10T + 11:52:34:552478 + + +
+
+ +
+ + + + 2020-09-10T + 11:52:34:552478 + + +
+
+ +
+ + + + 2020-09-10T + 11:52:34:552478 + + +
+
+ +
+ + + + 2020-09-10T + 11:52:34:552478 + + +
+
+ + +
+ + + + 2020-09-10T + 11:52:34:552478 + + +
+
@@ -256,14 +361,16 @@ class Overview extends React.Component { Unabled - {/*
-

{record.description}

} - dataSource={data} - /> - */} + +
+
( +

{record.description}

+ )} + dataSource={data} + /> @@ -273,18 +380,32 @@ class Overview extends React.Component {
- Analysis + + + Analysis + + + + {' '} + Total runs: 1,179 + + +
- + {' '} Runs - @@ -294,15 +415,15 @@ class Overview extends React.Component { - + {' '} - Click on sections of the graph to view detai;ed data + Click on sections of the graph to view detailed data - +
datum.x ? `${datum.x}: ${datum.y}%` : null } - title="60%" themeColor={ChartThemeColor.yellow} thresholds={[{ value: 60 }, { value: 90 }]} /> @@ -329,7 +449,7 @@ class Overview extends React.Component {
datum.x ? `${datum.x}: ${datum.y}%` : null } - title="45%" />
@@ -355,7 +474,262 @@ class Overview extends React.Component {
-
kmwlkemfc
+
+ + + perf102.perf.lab.eng.bos.redhat.com + + Field + run.controller + Value + scale-ci-http-tfg6k + Count + 54(3.81%) + +
+
+ + + +
+ + + + Legend + + + + ip-172-31-88-27.ec2.internal + + perf44-85qp8-infra-c-6qtbg.c + + + dhcp31-25.perf.lab.eng.bos.redhat.com + + + + frival-l64sv2-rhel8-Standard-L64s-v2-1-vm + + + scale-ci-http-dzms4 + +
+
+ + + + + +
+ + + {' '} + Runs over time + + + +
+
+ + + + + + {' '} + @metadata.satellite.EC2: filters + + + +
+ `${datum.name}: ${datum.y}`} + constrainToVisibleArea + /> + } + domainPadding={{ x: [50, 50] }} + height={500} + padding={{ + bottom: 50, + left: 50, + right: 200, + top: 50, + }} + width={1200} + > + + + + + + + +
+ + + {' '} + NOT @metadata.satellite.EC2: filters + + +
+ `${datum.name}: ${datum.y}`} + constrainToVisibleArea + /> + } + domainPadding={{ x: [50, 50] }} + height={500} + padding={{ + bottom: 50, + left: 50, + right: 200, + top: 50, + }} + themeColor={ChartThemeColor.gold} + width={1200} + > + + + + + + + +
+
+
+ +
+ + + Legend + +
+ + pbench-user-benchmark +
+
+ + trafficgen +
+
+ + uperf +
+
+ + linpack +
+
+ + fio +
+
+
diff --git a/src/pages/Overview/index.less b/src/pages/Overview/index.less index 14406694b..69ff7a20e 100644 --- a/src/pages/Overview/index.less +++ b/src/pages/Overview/index.less @@ -41,7 +41,7 @@ } .expiringValues { - height: 25vh; + height: 43vh; overflow: scroll; } @@ -55,3 +55,20 @@ .borderedCard { border: solid 1px #b3b2b2; } +.colorBox, +.colorBoxInline { + width: 0.7rem; + height: 0.7rem; + margin-left: 24px; + display: inline-block; +} + +.colorBoxInline { + display: inline-block; +} + +.legendLabel { + margin-left: 8px; + font-size: var(--pf-global--FontSize--sm); + color: var(--pf-global--Color--300); +}