[release] v0.12.0-unstable10

This commit is contained in:
Yann Stepienik 2023-10-28 16:10:39 +01:00
parent 2c5ec16653
commit 379c574358
8 changed files with 23 additions and 6 deletions

View file

@ -1,4 +1,3 @@
import { resolve } from 'eslint-import-resolver-typescript';
import configDemo from './demo.config.json';
interface Route {

View file

@ -13,6 +13,7 @@ import * as dockerDemo from './docker.demo';
import * as indexDemo from './index.demo';
import * as marketDemo from './market.demo';
import * as constellationDemo from './constellation.demo';
import * as metricsDemo from './metrics.demo';
import wrap from './wrap';
import { redirectToLocal } from '../utils/indexs';
@ -230,6 +231,7 @@ if(isDemo) {
getDNS = indexDemo.getDNS;
uploadBackground = indexDemo.uploadBackground;
constellation = constellationDemo;
metrics = metricsDemo;
}
export {

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,11 @@
import metricsDemo from './metrics.demo.json';
function get() {
return new Promise((resolve, reject) => {
resolve(metricsDemo)
});
}
export {
get,
};

View file

@ -147,6 +147,8 @@ const PlotComponent = ({ title, data, defaultSlot = 'latest' }) => {
},
formatter: (num) => {
if(!num) return 0;
if (Math.abs(num) >= 1e12) {
return (num / 1e12).toFixed(1) + 'T'; // Convert to Millions
} else if (Math.abs(num) >= 1e9) {

View file

@ -73,6 +73,8 @@ function stableSort(array, comparator) {
}
function formatter(num) {
if(!num) return 0;
if (Math.abs(num) >= 1e12) {
return (num / 1e12).toFixed(1) + 'T'; // Convert to Millions
} else if (Math.abs(num) >= 1e9) {

View file

@ -1,6 +1,6 @@
{
"name": "cosmos-server",
"version": "0.12.0-unstable9",
"version": "0.12.0-unstable10",
"description": "",
"main": "test-server.js",
"bugs": {

View file

@ -82,10 +82,10 @@ func GetSystemMetrics() {
// Get Network Usage
netIO, err := net.IOCountersWithContext(ctx, false)
// netIOTest, _ := net.IOCounters(true)
// 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)))
// }
netIOTest, _ := net.IOCounters(true)
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)))
}
PushSetMetric("system.netRx", int(netIO[0].BytesRecv), DataDef{
Max: 0,