[release] v0.12.0-unstable10
This commit is contained in:
parent
2c5ec16653
commit
379c574358
|
@ -1,4 +1,3 @@
|
||||||
import { resolve } from 'eslint-import-resolver-typescript';
|
|
||||||
import configDemo from './demo.config.json';
|
import configDemo from './demo.config.json';
|
||||||
|
|
||||||
interface Route {
|
interface Route {
|
||||||
|
|
|
@ -13,6 +13,7 @@ import * as dockerDemo from './docker.demo';
|
||||||
import * as indexDemo from './index.demo';
|
import * as indexDemo from './index.demo';
|
||||||
import * as marketDemo from './market.demo';
|
import * as marketDemo from './market.demo';
|
||||||
import * as constellationDemo from './constellation.demo';
|
import * as constellationDemo from './constellation.demo';
|
||||||
|
import * as metricsDemo from './metrics.demo';
|
||||||
|
|
||||||
import wrap from './wrap';
|
import wrap from './wrap';
|
||||||
import { redirectToLocal } from '../utils/indexs';
|
import { redirectToLocal } from '../utils/indexs';
|
||||||
|
@ -230,6 +231,7 @@ if(isDemo) {
|
||||||
getDNS = indexDemo.getDNS;
|
getDNS = indexDemo.getDNS;
|
||||||
uploadBackground = indexDemo.uploadBackground;
|
uploadBackground = indexDemo.uploadBackground;
|
||||||
constellation = constellationDemo;
|
constellation = constellationDemo;
|
||||||
|
metrics = metricsDemo;
|
||||||
}
|
}
|
||||||
|
|
||||||
export {
|
export {
|
||||||
|
|
1
client/src/api/metrics.demo.json
Normal file
1
client/src/api/metrics.demo.json
Normal file
File diff suppressed because one or more lines are too long
11
client/src/api/metrics.demo.jsx
Normal file
11
client/src/api/metrics.demo.jsx
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
import metricsDemo from './metrics.demo.json';
|
||||||
|
|
||||||
|
function get() {
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve(metricsDemo)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
export {
|
||||||
|
get,
|
||||||
|
};
|
|
@ -147,6 +147,8 @@ const PlotComponent = ({ title, data, defaultSlot = 'latest' }) => {
|
||||||
},
|
},
|
||||||
|
|
||||||
formatter: (num) => {
|
formatter: (num) => {
|
||||||
|
if(!num) return 0;
|
||||||
|
|
||||||
if (Math.abs(num) >= 1e12) {
|
if (Math.abs(num) >= 1e12) {
|
||||||
return (num / 1e12).toFixed(1) + 'T'; // Convert to Millions
|
return (num / 1e12).toFixed(1) + 'T'; // Convert to Millions
|
||||||
} else if (Math.abs(num) >= 1e9) {
|
} else if (Math.abs(num) >= 1e9) {
|
||||||
|
|
|
@ -73,6 +73,8 @@ function stableSort(array, comparator) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function formatter(num) {
|
function formatter(num) {
|
||||||
|
if(!num) return 0;
|
||||||
|
|
||||||
if (Math.abs(num) >= 1e12) {
|
if (Math.abs(num) >= 1e12) {
|
||||||
return (num / 1e12).toFixed(1) + 'T'; // Convert to Millions
|
return (num / 1e12).toFixed(1) + 'T'; // Convert to Millions
|
||||||
} else if (Math.abs(num) >= 1e9) {
|
} else if (Math.abs(num) >= 1e9) {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "cosmos-server",
|
"name": "cosmos-server",
|
||||||
"version": "0.12.0-unstable9",
|
"version": "0.12.0-unstable10",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "test-server.js",
|
"main": "test-server.js",
|
||||||
"bugs": {
|
"bugs": {
|
||||||
|
|
|
@ -82,10 +82,10 @@ func GetSystemMetrics() {
|
||||||
// Get Network Usage
|
// Get Network Usage
|
||||||
netIO, err := net.IOCountersWithContext(ctx, false)
|
netIO, err := net.IOCountersWithContext(ctx, false)
|
||||||
|
|
||||||
// netIOTest, _ := net.IOCounters(true)
|
netIOTest, _ := net.IOCounters(true)
|
||||||
// for _, v := range netIOTest {
|
for _, v := range netIOTest {
|
||||||
// utils.Debug("Metrics - Network " + v.Name + " : " + strconv.Itoa(int(v.BytesRecv)) + " / " + strconv.Itoa(int(v.BytesSent)) + " / " + strconv.Itoa(int(v.Errin + v.Errout)) + " / " + strconv.Itoa(int(v.Dropin + v.Dropout)))
|
utils.Debug("Metrics - Network " + v.Name + " : " + strconv.Itoa(int(v.BytesRecv)) + " / " + strconv.Itoa(int(v.BytesSent)) + " / " + strconv.Itoa(int(v.Errin + v.Errout)) + " / " + strconv.Itoa(int(v.Dropin + v.Dropout)))
|
||||||
// }
|
}
|
||||||
|
|
||||||
PushSetMetric("system.netRx", int(netIO[0].BytesRecv), DataDef{
|
PushSetMetric("system.netRx", int(netIO[0].BytesRecv), DataDef{
|
||||||
Max: 0,
|
Max: 0,
|
||||||
|
|
Loading…
Reference in a new issue