|
@@ -401,8 +401,8 @@ class MchDataCenter(object):
|
|
return predata
|
|
return predata
|
|
|
|
|
|
def _calc_mratio(self,data,startes,end):
|
|
def _calc_mratio(self,data,startes,end):
|
|
- all = data[1] + data[2]
|
|
|
|
- ySucc = data[1]
|
|
|
|
|
|
+ succ = data[1]
|
|
|
|
+ fail = data[2]
|
|
x = np.arange(0, 86400, 1)
|
|
x = np.arange(0, 86400, 1)
|
|
|
|
|
|
result = {}
|
|
result = {}
|
|
@@ -414,18 +414,17 @@ class MchDataCenter(object):
|
|
|
|
|
|
pos = np.where(x >= start_pos)
|
|
pos = np.where(x >= start_pos)
|
|
t = x[pos]
|
|
t = x[pos]
|
|
- _all = all[pos]
|
|
|
|
- _succ = ySucc[pos]
|
|
|
|
|
|
+ _fail = fail[pos]
|
|
|
|
+ _succ = succ[pos]
|
|
|
|
|
|
pos = np.where(t < end)
|
|
pos = np.where(t < end)
|
|
- _all = _all[pos]
|
|
|
|
|
|
+ _fail = _fail[pos]
|
|
_succ = _succ[pos]
|
|
_succ = _succ[pos]
|
|
|
|
|
|
- succ_count = np.sum(_succ) + 0.00001
|
|
|
|
- all_count = np.sum(_all) + 0.00001
|
|
|
|
-
|
|
|
|
- ratio = round(succ_count / all_count, 4)
|
|
|
|
- result[start] = ratio
|
|
|
|
|
|
+ succs = np.sum(_succ)
|
|
|
|
+ fails = np.sum(_fail)
|
|
|
|
+ ratio = round((succs + 0.00001) / (succs + fails + 0.00001), 4)
|
|
|
|
+ result[start] = [succs, fails, ratio]
|
|
return result
|
|
return result
|
|
|
|
|
|
def mratios(self, time_stamp,presecs):
|
|
def mratios(self, time_stamp,presecs):
|