加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
fmt.js 5.72 KB
一键复制 编辑 原始数据 按行查看 历史
Lakrimo 提交于 2020-11-09 12:50 . V2.0
// 1 (WebSocket)
// what frontend send
str = {
"key": "hello",
"value": ""
};
// what backend receive
str = {
"key": "hello",
"value": "",
};
// what backend reply
str = {
"key": "hello"
};
// 2.1 (MQTT)
// what MQTT send and what backend receive
str = {
"key": "result/task/new",
"value": {
"id": "16024697834867",
"type": "Gesture Recognition",
"t1": 16024697834867,
"arriveAt": "1.2.3.4"
}
};
// what backend transfer
str = {
"key": "result/task/new",
"value": {
"id": "16024697834867",
"type": "Gesture Recognition",
"t1": 16024697834867,
"arriveAt": 1
}
};
// 2.2 (MQTT)
// what MQTT send and what backend receive
str = {
"key": "result/task/to",
"value": {
"id": "16024697834867",
"t2": 16024697834867,
"deadline": 1000,
"offloadTo": "1.2.3.4",
"localDelay": 990,
"localEfficiency": 0.85
}
};
// what backend transfer
str = {
"key": "result/task/to",
"value": {
"id": "16024697834867",
"t2": 16024697834867,
"deadline": 1000,
"offloadTo": 1,
"localDelay": 990,
"localEfficiency": 0.85
}
};
// 2.3 (gRPC)
// what MQTT send and what backend receive
str = {
"key": "result/task/fl",
"value": {
"id": "16024697834867",
"ip": "1.2.3.4",
"type": "Face Recognition",
"arrival": "2020-10-22 18:10:19.857",
"snapshot": "[Object object]",
"result": "Kanna Hashimoto"
}
};
// what backend transfer
str = {
"key": "result/task/fl",
"value": {
"id": "16024697834867",
"t3": 16024697834867,
"snapshot": "[Object object]",
"result": "Kanna Hashimoto"
}
};
// what backend send
str = {
"key": "statistics/task",
"value": {
"task": {
"arriveAt": 2,
"deadline": 1000,
"delay": 42,
"delayComposition": {
"FL": 38,
"TO": 4
},
"efficiency": 95.8,
"evaluation": "42ms / 1000ms(95.80%)",
"id": "160489627533733",
"index": 51,
"localDelay": 4410,
"localEfficiency": 0.0,
"offloadFlag": "LC",
"offloadTo": 2,
"pairs": "2 → 2 (LC)",
"result": "unknown",
"snapshot": "D:\\image\\160489627533733.jpeg",
"timestamps": ["20-11-09 12:31:15", "20-11-09 12:31:15", "20-11-09 12:31:15"],
"typeAbbr": "FR"
},
"taskComposition": {
"yValue": {
"FL": 116,
"TO": 1
}
},
"taskDelay": {
"yValue": {
"GR-TO": [],
"GR-LC": [],
"FR-LC": [4410, 4410, 4410, 4410, 4410, 4410, 4410, 4410, 4410, 4410, 4410, 4410, 4410, 4410, 4410],
"FR-TO": [28, 26, 32, 30, 45, 35, 25, 31, 38, 40, 37, 23, 30, 27, 42]
}
},
"taskDelayDist": {
"xAxis": [100, 200, 300, 400, 500, 600, 700, 800, 900, 1000],
"yValue": {
"GR": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"FR": [49, 0, 0, 1, 0, 0, 0, 0, 0, 1]
}
},
"taskEff": {
"yValue": {
"LC": [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
"TO": [97.2, 97.399994, 96.8, 97.0, 95.5, 96.5, 97.5, 96.9, 96.200005, 96.0, 96.3, 97.7, 97.0, 97.299995, 95.8]
}
},
"taskEffDist": {
"xAxis": [10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
"yValue": {
"LC": [51, 0, 0, 0, 0, 0, 0, 0, 0, 0],
"TO": [1, 0, 0, 0, 0, 0, 1, 0, 0, 49]
}
},
"taskFlow": [51, "FR", "2 → 2 (LC)", "42ms / 1000ms(95.80%)", "unknown"],
"xAxisDynamic": [37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51]
}
};
// 3 (MQTT+WebSocket)
// what ComNet send and what backend receive
str = {
"key": "result/net/comnet",
"value": {
"ID": "16024697834867",
"Nodes": [
{
"IP": "10.128.254.5",
"RestComputing": [4, 2, 0.9],
"RestStorage": [1000, 0.728]
},
{
"IP": "10.128.248.253",
"RestComputing": [1, 2.5, 0.7],
"RestStorage": [400, 0.114]
}
],
"Links": [
{
"NodeFrom":"10.128.254.5",
"NodeTo":"10.128.248.253",
"Rate":3.44,
"EsDelay": 1
},
{
"NodeFrom":"10.128.248.253",
"NodeTo":"10.128.254.5",
"Rate":4.82,
"EsDelay": 1
}
]
}
};
// what backend send
str = {
"key": "statistics/net",
"value": {
"comNet": {
"id": "1604896967519",
"links": [{
"esDelay": 6.0,
"nodeDes": 2,
"nodeSrc": 1,
"rate": 8.768490572103143
}, {
"esDelay": 7.0,
"nodeDes": 3,
"nodeSrc": 1,
"rate": 13.542092828290581
}, {
"esDelay": 4.0,
"nodeDes": 1,
"nodeSrc": 2,
"rate": 2.6804725650177
}, {
"esDelay": 4.0,
"nodeDes": 3,
"nodeSrc": 2,
"rate": 6.199049924130678
}, {
"esDelay": 6.0,
"nodeDes": 1,
"nodeSrc": 3,
"rate": 3.889724286903977
}, {
"esDelay": 3.0,
"nodeDes": 2,
"nodeSrc": 3,
"rate": 5.846000046198607
}],
"network": {
"computing": 16.0,
"esDelay": 5.0,
"rate": 6.0,
"storage": 58.0
},
"nodes": [{
"id": 1,
"restComputing": [4.0, 2.096, 31.90226992434701],
"restStorage": [4096.0, 75.67005097701632]
}, {
"id": 2,
"restComputing": [6.0, 2.52, 13.780459348627502],
"restStorage": [4096.0, 52.283220676974075]
}, {
"id": 3,
"restComputing": [4.0, 2.496, 3.958333333333328],
"restStorage": [4096.0, 48.3554243389532]
}]
},
"netComputing": {
"yValue": {
"value": [15.0, 16.0, 16.0, 16.0, 16.0, 16.0]
}
},
"netStorage": {
"yValue": {
"value": [58.0, 58.0, 58.0, 58.0, 58.0, 58.0]
}
},
"xAxisDynamic": ["12:42:07", "12:42:15", "12:42:23", "12:42:31", "12:42:39", "12:42:47"]
}
};
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化