Skip to content

Commit

Permalink
v.2023.10.15.07.25.19
Browse files Browse the repository at this point in the history
  • Loading branch information
snmatus committed Oct 15, 2023
1 parent b9cac77 commit 2218b0f
Show file tree
Hide file tree
Showing 15 changed files with 54 additions and 586 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
frontend/public/aws-exports.json
server/aws-exports.json
2 changes: 1 addition & 1 deletion conf/DBTopMonitoringSolution.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Metadata:
ParameterGroups:
-
Label:
default: "Application Updates - Disclaimer"
default: "Application Update - Disclaimer"
Parameters:
- ApplicationUpdateEnabled
- ApplicationUpdateUrl
Expand Down
4 changes: 2 additions & 2 deletions frontend/public/aws-exports.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"aws_region": "us-east-1",
"aws_cognito_user_pool_id": "",
"aws_cognito_user_pool_web_client_id": "",
"aws_cognito_user_pool_id": "user_pool_id",
"aws_cognito_user_pool_web_client_id": "web_client_id",
"aws_token_expiration": "24h",
"aws_application_update_url" : "https://iwpeiaj68k.execute-api.us-east-1.amazonaws.com/",
"aws_application_update_enabled" : true
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/CompAuroraNode01.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ChartRadialBar01 from './ChartRadialBar01';
import { createLabelFunction } from '../components/Functions';
import CustomTable from "./Table01";

import { StatusIndicator } from '@awsui/components-react';
import Container from "@awsui/components-react/container";
import CompMetric01 from './Metric01';
import CompMetric04 from './Metric04';
Expand Down Expand Up @@ -106,7 +107,7 @@ const ComponentObject = memo(({ sessionId, clusterId, nodeStats }) => {
<Link fontSize="body-s" onFollow={() => onClickNode()}>{nodeStats.name}</Link>
</td>
<td style={{"width":"6%", "text-align":"center", "border-top": "1pt solid " + configuration.colors.lines.separator100}}>
{nodeStats.status}
<StatusIndicator type={nodeStats.status === 'available' ? 'success' : 'pending'}> {nodeStats.status} </StatusIndicator>
</td>
<td style={{"width":"6%", "text-align":"center", "border-top": "1pt solid " + configuration.colors.lines.separator100}}>
{nodeStats.size}
Expand Down
3 changes: 2 additions & 1 deletion frontend/src/components/CompAuroraNode02.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ChartRadialBar01 from './ChartRadialBar01';
import { createLabelFunction } from '../components/Functions';
import CustomTable from "./Table01";

import { StatusIndicator } from '@awsui/components-react';
import Container from "@awsui/components-react/container";
import CompMetric01 from './Metric01';
import CompMetric04 from './Metric04';
Expand Down Expand Up @@ -105,7 +106,7 @@ const ComponentObject = memo(({ sessionId, clusterId, nodeStats }) => {
<Link fontSize="body-s" onFollow={() => onClickNode()}>{nodeStats.name}</Link>
</td>
<td style={{"width":"6%", "text-align":"center", "border-top": "1pt solid " + configuration.colors.lines.separator100}}>
{nodeStats.status}
<StatusIndicator type={nodeStats.status === 'available' ? 'success' : 'pending'}> {nodeStats.status} </StatusIndicator>
</td>
<td style={{"width":"6%", "text-align":"center", "border-top": "1pt solid " + configuration.colors.lines.separator100}}>
{nodeStats.size}
Expand Down
563 changes: 0 additions & 563 deletions frontend/src/components/CompDocumentDBNode01.1.js

This file was deleted.

3 changes: 2 additions & 1 deletion frontend/src/components/CompDocumentDBNode01.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import ChartRadialBar01 from './ChartRadialBar01';
import { createLabelFunction } from '../components/Functions';
import CustomTable from "./Table01";

import { StatusIndicator } from '@awsui/components-react';
import Container from "@awsui/components-react/container";
import CompMetric01 from './Metric01';
import CompMetric04 from './Metric04';
Expand Down Expand Up @@ -107,7 +108,7 @@ const ComponentObject = memo(({ sessionId, clusterId, nodeStats }) => {
<Link fontSize="body-s" onFollow={() => onClickNode()}>{nodeStats.name}</Link>
</td>
<td style={{"width":"5%", "text-align":"center", "border-top": "1pt solid " + configuration.colors.lines.separator100}}>
{nodeStats.status}
<StatusIndicator type={nodeStats.status === 'available' ? 'success' : 'pending'}> {nodeStats.status} </StatusIndicator>
</td>
<td style={{"width":"6%", "text-align":"center", "border-top": "1pt solid " + configuration.colors.lines.separator100}}>
{nodeStats.size}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/HeaderApp.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export default function App() {
{ type: 'button', iconName: 'settings', title: 'Settings', ariaLabel: 'Settings' },
{
type: 'menu-dropdown',
text: user.signInUserSession.idToken.payload.email /*"[email protected]"*/,
text: /*user.signInUserSession.idToken.payload.email*/ "[email protected]",
iconName: 'user-profile',
items: profileActions,
onItemClick : handleClickMenu
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Sm-clustersAurora-01.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ function Login() {
//-- Variables Table
const columnsTable = [
{id: 'identifier',header: 'Cluster identifier',cell: item => item.identifier,ariaLabel: createLabelFunction('Cluster identifier'),sortingField: 'identifier',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'error'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'pending'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'nodes',header: 'Nodes',cell: item => item.nodes,ariaLabel: createLabelFunction('Nodes'),sortingField: 'nodes',},
{id: 'engine',header: 'Engine',cell: item => item.engine,ariaLabel: createLabelFunction('Engine'),sortingField: 'engine',},
{id: 'version',header: 'Engine Version',cell: item => item.version,ariaLabel: createLabelFunction('Engine Version"'),sortingField: 'version',},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Sm-clustersDocumentDB-01.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ function Login() {
//-- Variables Table
const columnsTable = [
{id: 'identifier',header: 'Cluster identifier',cell: item => item.identifier,ariaLabel: createLabelFunction('Cluster identifier'),sortingField: 'identifier',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'error'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'pending'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'nodes',header: 'Nodes',cell: item => item.nodes,ariaLabel: createLabelFunction('Nodes'),sortingField: 'nodes',},
{id: 'engine',header: 'Engine',cell: item => item.engine,ariaLabel: createLabelFunction('Engine'),sortingField: 'engine',},
{id: 'version',header: 'Engine Version',cell: item => item.version,ariaLabel: createLabelFunction('Engine Version"'),sortingField: 'version',},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Sm-clustersElasticache-01.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ function Login() {
//-- Variables Table
const columnsTable = [
{id: 'identifier',header: 'Cluster identifier',cell: item => item.identifier,ariaLabel: createLabelFunction('Cluster identifier'),sortingField: 'identifier',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'error'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'pending'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'size',header: 'Size',cell: item => item.size,ariaLabel: createLabelFunction('Size'),sortingField: 'size',},
{id: 'engine',header: 'Engine',cell: item => item.engine,ariaLabel: createLabelFunction('Engine'),sortingField: 'engine',},
{id: 'shards',header: 'Shards',cell: item => item.shards,ariaLabel: createLabelFunction('Shards'),sortingField: 'shards',},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Sm-clustersMemorydb-01.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ function Login() {
//-- Variables Table
const columnsTable = [
{id: 'identifier',header: 'Cluster identifier',cell: item => item.identifier,ariaLabel: createLabelFunction('Cluster identifier'),sortingField: 'identifier',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'error'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'pending'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'size',header: 'Size',cell: item => item.size,ariaLabel: createLabelFunction('Size'),sortingField: 'size',},
{id: 'engine',header: 'Engine',cell: item => item.engine,ariaLabel: createLabelFunction('Engine'),sortingField: 'engine',},
{id: 'version',header: 'Engine Version',cell: item => item.version,ariaLabel: createLabelFunction('Engine Version"'),sortingField: 'version',},
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Sm-rdsInstances-01.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function Login() {
//-- Variables Table
const columnsTable = [
{id: 'identifier',header: 'DB identifier',cell: item => item.identifier,ariaLabel: createLabelFunction('DB identifier'),sortingField: 'identifier',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'error'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'status',header: 'Status',cell: item => ( <> <StatusIndicator type={item.status === 'available' ? 'success' : 'pending'}> {item.status} </StatusIndicator> </> ),ariaLabel: createLabelFunction('Status'),sortingField: 'status',},
{id: 'size',header: 'Size',cell: item => item.size,ariaLabel: createLabelFunction('Size'),sortingField: 'size',},
{id: 'engine',header: 'Engine',cell: item => item.engine,ariaLabel: createLabelFunction('Engine'),sortingField: 'engine',},
{id: 'version',header: 'Engine Version',cell: item => item.version,ariaLabel: createLabelFunction('Engine Version"'),sortingField: 'version',},
Expand Down
44 changes: 35 additions & 9 deletions server/api.core.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,13 +217,17 @@ class classMetric {
getDeltaByIndex(propertyName) {
try
{
if ( this.totalSnaps > 2 )
return (
(
(this.currentObject[propertyName] - this.oldObject[propertyName]) /
(Math.abs(this.currentTime - this.oldTime) / 1000)
) || 0
) ;
if ( this.totalSnaps > 2 ) {
if ( (this.currentObject[propertyName] - this.oldObject[propertyName]) > 0)
return (
(
(this.currentObject[propertyName] - this.oldObject[propertyName]) /
(Math.abs(this.currentTime - this.oldTime) / 1000)
) || 0
) ;
else
return 0;
}
else
return 0;
}
Expand Down Expand Up @@ -3327,11 +3331,29 @@ async function updateStatsDocumentDBNode(connectionId,clusterId,nodeId, resource
{
var timeNow = new Date();



// Current Instance Status
var parameter = {
DBInstanceIdentifier : nodeId.substring(1)
};

var instanceInfo = { status : "", size : ""};
var instanceData = await rds.describeDBInstances(parameter).promise();

if (instanceData.DBInstances.length > 0) {
instanceInfo.status = instanceData.DBInstances[0]['DBInstanceStatus'];
instanceInfo.size = instanceData.DBInstances[0]['DBInstanceClass'];

}

//-- Current Operations
const currentOperations = await documentDBCluster[connectionId][clusterId][nodeId]["connection"].db("admin").command({ serverStatus: 1 });


//-- Current Operations
const currentStatus = await documentDBCluster[connectionId][clusterId][nodeId]["connection"].db("admin").command({ isMaster : 1 });


//-- OS Metrics
const osMetrics = await gatherDocumentDBOsMetrics({ resourceId : resourceId, instanceId : nodeId.substring(1), monitoring : monitoring });
documentDBCluster[connectionId][clusterId][nodeId]["node"].newSnapshot({
Expand Down Expand Up @@ -3369,7 +3391,11 @@ async function updateStatsDocumentDBNode(connectionId,clusterId,nodeId, resource
timeNow.getTime());

documentDBCluster[connectionId][clusterId][nodeId]["property"]["timestamp"] = osMetrics.timestamp;

documentDBCluster[connectionId][clusterId][nodeId]["property"] = {...documentDBCluster[connectionId][clusterId][nodeId]["property"],
role : (currentStatus.ismaster == true ? "P" : "R" ),
status : instanceInfo.status,
size : instanceInfo.size
};



Expand Down
4 changes: 2 additions & 2 deletions server/aws-exports.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"aws_region": "us-east-1",
"aws_cognito_user_pool_id": "",
"aws_cognito_user_pool_web_client_id": "",
"aws_cognito_user_pool_id": "user_pool_id",
"aws_cognito_user_pool_web_client_id": "web_client_id",
"aws_api_port": 3000,
"aws_token_expiration": 24,
"aws_application_update_url" : "https://iwpeiaj68k.execute-api.us-east-1.amazonaws.com/",
Expand Down

0 comments on commit 2218b0f

Please sign in to comment.