|
@@ -185,7 +185,6 @@ class DataCenter(object):
|
|
|
data = np.array(data)
|
|
|
predata = predata + data
|
|
|
self._draw_plot(ax, x, day_stamp, start_pos, end_pos, data, interval, path)
|
|
|
- logger.info("path=%s", path)
|
|
|
|
|
|
self._draw_plot(ax, x, day_stamp, start_pos, end_pos, predata, interval, filer_text)
|
|
|
|
|
@@ -268,9 +267,8 @@ class DataCenter(object):
|
|
|
return filer_text, paths
|
|
|
|
|
|
def _draw_plot(self, ax, x, day_stamp, start_pos, end_pos, data, interval=300, path=''):
|
|
|
- import matplotlib.dates as mdate
|
|
|
# 'commit-succ': 0, 'commit-fail': 1, 'notify-succ': 2, 'notify-fail': 3, 'user_succ': 4
|
|
|
-
|
|
|
+ logging.getLogger('app').debug("path=%s", path)
|
|
|
all = data[2] + data[3]
|
|
|
all = all.reshape((-1, interval))
|
|
|
all = np.sum(all, axis=1)
|
|
@@ -293,7 +291,8 @@ class DataCenter(object):
|
|
|
ySucc = ySucc[pos]
|
|
|
|
|
|
opened = np.where(ySucc > 0)
|
|
|
- if len(opened) == 0:
|
|
|
+ if len(opened[0]) == 0:
|
|
|
+ logging.getLogger('app').debug("path=%s,opened=False", path)
|
|
|
return False
|
|
|
|
|
|
xs = np.array([stime.strftime('%H:%M', stime.localtime(d + day_stamp)) for d in x])
|
|
@@ -308,15 +307,15 @@ class DataCenter(object):
|
|
|
(_, _sday, _chname, _quality, _card_type, _amount) = items
|
|
|
card_type = ''
|
|
|
if _card_type == '1':
|
|
|
- card_type = 'sy'
|
|
|
+ card_type = 'SY'
|
|
|
elif _card_type == '2':
|
|
|
- card_type = 'sh'
|
|
|
+ card_type = 'SH'
|
|
|
elif _card_type == '4':
|
|
|
- card_type = 'yd'
|
|
|
+ card_type = 'YD'
|
|
|
elif _card_type == '5':
|
|
|
- card_type = 'lt'
|
|
|
+ card_type = 'LT'
|
|
|
elif _card_type == '6':
|
|
|
- card_type = 'dianxin'
|
|
|
+ card_type = 'DX'
|
|
|
return f"{_chname}-{_quality}-{card_type}-{_amount}"
|
|
|
else:
|
|
|
return path
|