fix
This commit is contained in:
parent
a7caf14401
commit
eff8d4ffea
|
@ -1,6 +1,10 @@
|
||||||
from lib.all import *
|
from lib.all import *
|
||||||
from lib.odps import *
|
from lib.odps import *
|
||||||
|
|
||||||
|
service_name = 'today_dau'
|
||||||
|
log_dir = '.'
|
||||||
|
logger = Logger(service_name, log_dir=log_dir)
|
||||||
|
|
||||||
|
|
||||||
# 今日dau
|
# 今日dau
|
||||||
|
|
||||||
|
@ -31,7 +35,7 @@ FROM
|
||||||
)
|
)
|
||||||
GROUP BY device
|
GROUP BY device
|
||||||
'''.format(get_time_str_by_ts(get_today_zero_time(), "%Y%m%d"))
|
'''.format(get_time_str_by_ts(get_today_zero_time(), "%Y%m%d"))
|
||||||
print(sql)
|
logger.Info("sql: {}".format(sql))
|
||||||
|
|
||||||
dau_app_android = 0
|
dau_app_android = 0
|
||||||
dau_app_ios = 0
|
dau_app_ios = 0
|
||||||
|
@ -48,14 +52,14 @@ GROUP BY device
|
||||||
dau_h5 += dau
|
dau_h5 += dau
|
||||||
dau_total = dau_app_android + dau_app_ios + dau_h5
|
dau_total = dau_app_android + dau_app_ios + dau_h5
|
||||||
|
|
||||||
print(
|
logger.Info(
|
||||||
dau_total, dau_app_android, dau_app_ios, dau_h5
|
"{},{},{},{}".format(dau_total, dau_app_android, dau_app_ios, dau_h5)
|
||||||
)
|
)
|
||||||
|
|
||||||
# 写入
|
# 写入
|
||||||
sql_u = "update today_dau set app_android=%s, app_ios=%s, h5_android=%s, total=%s where id=1"
|
sql_u = "update today_dau set app_android=%s, app_ios=%s, h5_android=%s, total=%s where id=1"
|
||||||
ret = self.mysql_db_bi.exec(sql_u, (dau_app_android, dau_app_ios, dau_h5, dau_total))
|
ret = self.mysql_db_bi.exec(sql_u, (dau_app_android, dau_app_ios, dau_h5, dau_total))
|
||||||
print("update finish, ret: {}".format(ret))
|
logger.Info("update finish, ret: {}".format(ret))
|
||||||
|
|
||||||
|
|
||||||
s = S()
|
s = S()
|
||||||
|
|
Loading…
Reference in New Issue