-
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.
- Loading branch information
Showing
7 changed files
with
175 additions
and
39 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,82 @@ | ||
[ | ||
{ | ||
"Container Id": "user.qwer1234", | ||
"Process name": "process-1", | ||
"CPU user": 34567890, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 12345678 | ||
}, | ||
{ | ||
"Container Id": "user.asdf5678", | ||
"Process name": "process-2", | ||
"CPU user": 90876543, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 87654321 | ||
}, | ||
{ | ||
"Container Id": "user.zxcv9012", | ||
"Process name": "process-3", | ||
"CPU user": 56789012, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 21098765 | ||
}, | ||
{ | ||
"Container Id": "user.poiuy3456", | ||
"Process name": "process-4", | ||
"CPU user": 123456789, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 98765432 | ||
}, | ||
{ | ||
"Container Id": "user.lkjh7890", | ||
"Process name": "process-5", | ||
"CPU user": 67890123, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 32109876 | ||
}, | ||
{ | ||
"Container Id": "user.hjkl1234", | ||
"Process name": "process-6", | ||
"CPU user": 234567890, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 10987654 | ||
}, | ||
{ | ||
"Container Id": "user.gfed5678", | ||
"Process name": "process-7", | ||
"CPU user": 78901234, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 43210987 | ||
}, | ||
{ | ||
"Container Id": "user.tyuio9012", | ||
"Process name": "process-8", | ||
"CPU user": 345678901, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 11098765 | ||
}, | ||
{ | ||
"Container Id": "user.rewq2345", | ||
"Process name": "process-9", | ||
"CPU user": 89012345, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 54321098 | ||
}, | ||
{ | ||
"Container Id": "user.asdfg6789", | ||
"Process name": "process-10", | ||
"CPU user": 45678901, | ||
"CPU quota": 0, | ||
"CPU throttling": 0, | ||
"CPU kernel": 12109876 | ||
} | ||
] |
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,17 +1,19 @@ | ||
const express = require('express'); | ||
const cors = require('cors') | ||
const { exec } = require('child_process'); | ||
const cors = require('cors'); | ||
const cpuData = require('./data/cpu_utilization.json'); // Changed variable name for better readability | ||
|
||
const app = express(); | ||
app.use(cors()); | ||
const port = 3001; | ||
|
||
app.listen(port, () => { | ||
console.log(`Server is running on port ${port}`); | ||
}); | ||
|
||
// Middleware to enable CORS | ||
app.use(cors()); | ||
|
||
app.get('/rundocker', (req, res) => { | ||
// Route handler for GET requests to /getdata endpoint | ||
app.get('/getdata', (req, res) => { | ||
req.send("Hello from server"); // Sending JSON data as response | ||
}); | ||
|
||
|
||
// Start the server | ||
app.listen(port, () => { | ||
console.log(`Server is running on port ${port}`); | ||
}); |