|
@@ -16,7 +16,7 @@ try {
|
|
|
// 环境配置参数,配置定义在etcd:/matrix/data/api/cfg.json
|
|
|
cfg = {}
|
|
|
try {
|
|
|
- cfg.env = "test";//JSON.parse(etcd.get("/api/cfg.json"));
|
|
|
+ cfg = JSON.parse(etcd.get("/api/cfg.json"));
|
|
|
} catch (e) { }
|
|
|
|
|
|
/*
|
|
@@ -45,7 +45,7 @@ try {
|
|
|
|
|
|
*/
|
|
|
function getDataFromOmdb(ftype, tms, tme) {
|
|
|
- var type = ftype = "FXPS" ? "FXCC" : ftype
|
|
|
+ var type = ftype === 'FXPS' ? 'FXCC' : ftype;
|
|
|
var data = [];
|
|
|
var kpiDef = [
|
|
|
{ "kpi_key": "kpi.IBPS.101.sendnode-recvnode-ratio", title: "网银应答率", "name": "RR" },
|
|
@@ -119,9 +119,9 @@ function getData(type, tms, tme) {
|
|
|
type: type,
|
|
|
time: new Date(t),
|
|
|
RV: parseInt(Math.random() * 500 + 1000), // 交易量
|
|
|
- RS: Math.random() * 5 + 95, // 系统成功率
|
|
|
+ RS: 0.95, // 系统成功率
|
|
|
RD: parseInt(Math.random() * 500 + 100), // 平均响应时间
|
|
|
- RR: Math.random() * 5 + 95, // 交易响应率
|
|
|
+ RR: Math.random() * 0.05 + 0.95, // 交易响应率
|
|
|
FV: parseInt(Math.random() * 10) // 失败笔数
|
|
|
});
|
|
|
}
|
|
@@ -149,15 +149,16 @@ function floatFormat(f, size) {
|
|
|
varchar += aa[i];
|
|
|
if (aa[i] == ".") {
|
|
|
k = 1;
|
|
|
- }
|
|
|
- if (k == 1) {
|
|
|
+ } else if (k == 1) {
|
|
|
num++;
|
|
|
if (num > size) {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- num--;
|
|
|
+ if (k == 0) {
|
|
|
+ varchar += ".";
|
|
|
+ }
|
|
|
//如果位数不够,则补0
|
|
|
for (; num < size; num++) {
|
|
|
varchar += "0";
|