提交 8170e37d authored 作者: blu's avatar blu

feature: report status

上级 0cfeb9aa
...@@ -1332,6 +1332,7 @@ public: ...@@ -1332,6 +1332,7 @@ public:
json ipcsData = this->peerData["ipcStatus"]; json ipcsData = this->peerData["ipcStatus"];
json summary; json summary;
json stats; json stats;
vector<string> tags = {"E0C0", "E0C1", "E1C0", "E1C1"};
for(auto &[k,v]: ipcsData.items()){ for(auto &[k,v]: ipcsData.items()){
json diff = json::diff(v["expected"], v["current"]); json diff = json::diff(v["expected"], v["current"]);
if(diff.size() != 0) { if(diff.size() != 0) {
...@@ -1340,16 +1341,14 @@ public: ...@@ -1340,16 +1341,14 @@ public:
summary["ok"].push_back(k); summary["ok"].push_back(k);
} }
vector<string> tags = {"E0C0", "E0C1", "E1C0", "E1C1"};
for(auto &[m, n]: v["current"].items()){ for(auto &[m, n]: v["current"].items()){
auto x = v["expected"][m].get<bool>(); auto x = v["expected"][m].get<bool>();
int c = n?1:0; int c = n?1:0;
int e = x?1:0; int e = x?1:0;
int r = (e<<1)|c; int r = (e<<1)|c;
auto tag = tags[r]; auto tag = tags[r];
auto mod = strutils::split(m, ':'); auto mod = strutils::split(m, ':');
if(mod.size() == 3) { if(mod.size() == 3) {
// init // init
if(stats.count(mod[1]) == 0) { if(stats.count(mod[1]) == 0) {
...@@ -1358,7 +1357,6 @@ public: ...@@ -1358,7 +1357,6 @@ public:
stats[mod[1]][t] = 0; stats[mod[1]][t] = 0;
} }
} }
// increment // increment
stats[mod[1]][tag] = stats[mod[1]][tag].get<int>() + 1; stats[mod[1]][tag] = stats[mod[1]][tag].get<int>() + 1;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论