Skip to content

Commit 158ba7f

Browse files
authored
Merge pull request #18 from aws-samples/aurora/limitless
Aurora/limitless
2 parents b69f5ed + f34b77f commit 158ba7f

19 files changed

+3176
-74
lines changed

conf/DBTopMonitoringSolution.template

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,13 @@ Resources:
154154
],
155155
"Resource": "arn:aws:rds:${AWS::Region}:${AWS::AccountId}:db:*"
156156
},
157+
{
158+
"Effect": "Allow",
159+
"Action": [
160+
"rds:DescribeDBShardGroups"
161+
],
162+
"Resource": "arn:aws:rds:${AWS::Region}:${AWS::AccountId}:shard-group:*"
163+
},
157164
{
158165
"Effect": "Allow",
159166
"Action": [

conf/api.core.service

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Environment=NODE_PORT=3002
99
Type=simple
1010
User=ec2-user
1111
WorkingDirectory=/aws/apps/server/
12-
ExecStart=/home/ec2-user/.nvm/versions/node/v20.11.0/bin/node api.core.js
12+
ExecStart=/home/ec2-user/.nvm/versions/node/v23.4.0/bin/node api.core.js
1313
Restart=on-failure
1414
RestartSec=5s
1515

conf/setup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ cd /aws/apps/server/; wget https://truststore.pki.rds.amazonaws.com/global/globa
4242
curl https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh --output install.sh
4343
sh install.sh
4444
. ~/.nvm/nvm.sh
45-
nvm install 20.11.0
45+
nvm install 23.4.0
4646

4747

4848
#NodeJS API Core Installation

frontend/package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"react-apexcharts": "^1.4.1",
1919
"react-dom": "^18.2.0",
2020
"react-router-dom": "^6.11.1",
21-
"web-vitals": "^2.1.4"
21+
"web-vitals": "^2.1.4",
22+
"zustand": "^5.0.2"
2223
},
2324
"devDependencies": {
2425
"react-scripts": "^5.0.1"
@@ -29,7 +30,7 @@
2930
"test": "react-scripts test",
3031
"eject": "react-scripts eject"
3132
},
32-
"proxy": "http://44.217.218.9:3000",
33+
"proxy": "http://34.192.180.1:3000",
3334
"eslintConfig": {
3435
"extends": [
3536
"react-app",

frontend/src/components/Animation01.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ const ChartAnimation = memo(({ speed="2s", rotate="0deg", width = "30px", height
99
"height": height,
1010
"border-radius": "5px",
1111
"display": "inline-block",
12-
"background": "linear-gradient(#f2f2f2 40%, #8ea9ff 30%, #f2f2f2 60%)",
12+
"background": "linear-gradient(#fff 20%, #8ea9ff 60%, #fff 20%)",
13+
"background2": "linear-gradient(#f2f2f2 40%, #8ea9ff 30%, #f2f2f2 60%)",
1314
"background1": "linear-gradient(#8ea9ff 40%, #f2f2f2 30%, #f2f8ea9ff2f2 60%)",
1415
"background-size":"100% 200%",
1516
"background-repeat": "no-repeat",

frontend/src/components/ChartColumn01.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ function ChartBar({ series, height, width="100%", title }) {
1717
animations: {
1818
enabled: false,
1919
},
20+
labels: series.categories,
2021
dynamicAnimation :
2122
{
2223
enabled: true,
@@ -32,7 +33,7 @@ function ChartBar({ series, height, width="100%", title }) {
3233
}
3334
},
3435
xaxis: {
35-
categories: series.categories,
36+
//categories: series.categories,
3637
labels : {
3738
formatter: function(val, index) {
3839

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import {memo} from 'react';
2+
import Chart from 'react-apexcharts';
3+
4+
const ChartBar = memo(({ series, categories, height, width="100%", title }) => {
5+
6+
console.log(series,categories);
7+
var options = {
8+
chart: {
9+
type: 'bar',
10+
height: height,
11+
foreColor: '#9e9b9a',
12+
zoom: {
13+
enabled: false
14+
},
15+
animations: {
16+
enabled: false,
17+
},
18+
labels: JSON.parse(categories),
19+
dynamicAnimation :
20+
{
21+
enabled: true,
22+
},
23+
toolbar: {
24+
show: false,
25+
}
26+
},
27+
plotOptions: {
28+
bar: {
29+
borderRadius: 4,
30+
horizontal: true,
31+
}
32+
},
33+
xaxis: {
34+
categories: JSON.parse(categories),
35+
labels : {
36+
formatter: function(val, index) {
37+
38+
if(val === 0) return '0';
39+
if(val < 1000) return parseFloat(val).toFixed(0);
40+
41+
var k = 1000,
42+
sizes = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'],
43+
i = Math.floor(Math.log(val) / Math.log(k));
44+
return parseFloat((val / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
45+
46+
},
47+
style: {
48+
fontSize: '11px',
49+
fontFamily: 'Lato',
50+
},
51+
52+
},
53+
},
54+
grid: {
55+
show: false,
56+
yaxis: {
57+
lines: {
58+
show: false
59+
}
60+
},
61+
xaxis: {
62+
lines: {
63+
show: false
64+
},
65+
}
66+
},
67+
tooltip: {
68+
theme: "dark",
69+
},
70+
dataLabels: {
71+
enabled: true,
72+
style: {
73+
fontSize: '11px',
74+
fontWeight: 'bold',
75+
fontFamily: 'Lato',
76+
},
77+
formatter: function(val, index) {
78+
79+
if(val === 0) return '0';
80+
if(val < 1000) return parseFloat(val).toFixed(0);
81+
82+
var k = 1000,
83+
sizes = ['', 'K', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'],
84+
i = Math.floor(Math.log(val) / Math.log(k));
85+
return parseFloat((val / Math.pow(k, i)).toFixed(1)) + ' ' + sizes[i];
86+
87+
},
88+
},
89+
90+
};
91+
92+
93+
return (
94+
<div>
95+
<Chart options={options} series={JSON.parse(series)} type="bar" width={width} height={height} />
96+
</div>
97+
);
98+
});
99+
100+
export default ChartBar;

frontend/src/components/ChartPie-01.js

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {memo} from 'react';
22
import Chart from 'react-apexcharts';
33

4-
const ChartComponent = memo(({ series, labels, title, height="350px", width="100%" }) => {
4+
const ChartComponent = memo(({ series, labels, title="", height="350px", width="100%" }) => {
55

66

77
var options = {
@@ -24,6 +24,17 @@ const ChartComponent = memo(({ series, labels, title, height="350px", width="100
2424
enabled: true
2525
}
2626
},
27+
title: {
28+
text : title,
29+
align: "center",
30+
show: false,
31+
style: {
32+
fontSize: '14px',
33+
fontWeight: 'bold',
34+
fontFamily: 'Lato',
35+
}
36+
37+
},
2738
legend: {
2839
show: true,
2940
showForSingleSeries: true,
@@ -71,7 +82,13 @@ const ChartComponent = memo(({ series, labels, title, height="350px", width="100
7182
fontFamily: 'Lato',
7283
},
7384
},
74-
}
85+
},
86+
dataLabels: {
87+
formatter(val, opts) {
88+
const name = opts.w.globals.labels[opts.seriesIndex]
89+
return [name, val.toFixed(1) + '%']
90+
},
91+
},
7592
};
7693

7794

Lines changed: 22 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,32 @@
1-
import {useState,useEffect,useRef} from 'react';
1+
import {memo} from 'react';
22
import Chart from 'react-apexcharts';
33

4-
function ChartLine({ series, height, width, title, decimal = 2, fontSizeTitle = "11px", fontSizeValue = "22px", fontColorTitle = "#C6C2C1", fontColorValue = "orange" }) {
5-
6-
7-
4+
const ChartLine = memo(({series,history, height="60px", width="100%", title, border=2, type="line" }) => {
5+
86
var options = {
9-
chart: {
10-
type: 'radialBar',
11-
width: 50,
12-
height: 50,
13-
sparkline: {
14-
enabled: true
15-
},
16-
animations: {
17-
enabled: false,
18-
},
19-
},
20-
dataLabels: {
21-
enabled: false
7+
chart: {
8+
type: type,
9+
sparkline: {
10+
enabled: true
2211
},
23-
plotOptions: {
24-
radialBar: {
25-
hollow: {
26-
margin: 0,
27-
size: '50%'
28-
},
29-
track: {
30-
margin: 0
31-
},
32-
dataLabels: {
33-
show: false
34-
}
35-
}
36-
}
37-
};
38-
12+
},
13+
stroke: {
14+
curve: 'straight'
15+
},
16+
fill: {
17+
opacity: 0.3,
18+
},
19+
yaxis: {
20+
min: 0
21+
},
22+
};
23+
24+
3925
return (
4026
<div>
41-
<div style={{height:height, width:width}}>
42-
<Chart options={options} series={series} type={"radialBar"} width={width} height={height} />
43-
</div>
44-
<div style={{"font-size": fontSizeValue, "font-weight": "500","font-family": "Orbitron", "color": fontColorValue}}>
45-
{ parseFloat(series[0] || 0).toLocaleString('en-US', {minimumFractionDigits: decimal, maximumFractionDigits: decimal}) }
46-
</div>
47-
<div style={{"font-size": fontSizeTitle, "color": fontColorTitle, "font-weight": "450","font-family": "Verdana" }}>
48-
{title}
49-
</div>
27+
<Chart options={options} series={JSON.parse(series)} type={type} width={width} height={height} />
5028
</div>
51-
5229
);
53-
}
30+
});
5431

5532
export default ChartLine;

0 commit comments

Comments
 (0)