Пример #1
0
def get_table(search_start_date, search_end_date, channel_id=-1, server_id=-1):
    """
        获取用户留存情况
        search_start_date 查询开始时间
        search_end_date 查询结束时间
    """
    new_log_lst = []
    now_date = datetime.date.today()
    if server_id != -1:
        if search_start_date < now_date:
            new_log_lst = dat_log_util.read_file_with_filename(
                "USER_RETAIN", search_start_date, search_end_date, server_id,
                "tables")
        if search_end_date == now_date:
            row_lst, rate_row_lst = get_row_lst(now_date, channel_id,
                                                server_id)
            new_log_lst.append(row_lst)
            new_log_lst.append(rate_row_lst)
    else:
        total_days = (search_end_date - search_start_date).days + 1
        for i in xrange(total_days):
            search_date = search_start_date + datetime.timedelta(days=i)
            row_lst, rate_row_lst = get_row_lst(search_date, channel_id,
                                                server_id)
            new_log_lst.append(row_lst)
            new_log_lst.append(rate_row_lst)

    return new_log_lst
Пример #2
0
def get_table(search_start_date, search_end_date, server_id):
    table_lst = dat_log_util.read_file_with_filename("STAMINA_COST",
                                                     search_start_date,
                                                     search_end_date,
                                                     server_id, 'tables')

    return table_lst
def get_cost_gold_table(search_start_date, server_id):
    """
        获取表格
    """
    table_lst = []
    # 获取首次消耗钻石的日志列表
    first_cost_gold_log_lst = dat_log_util.read_file_with_filename(
        "USER_FIRST_GOLD_CONSUME", search_start_date, search_start_date,
        server_id)

    for _log in first_cost_gold_log_lst:
        _action = _log['action']
        action_name = game_define.EVENT_LOG_ACTION_DICT[_action]
        action_total_cost_gold = _log['gold_num']
        user_num = _log['user_num']
        cur_user_num_rate = _log['user_rate']
        first_cost_gold_rate = _log['gold_rate']

        row = [
            action_name, action_total_cost_gold, user_num,
            str(cur_user_num_rate * 100) + "%",
            str(first_cost_gold_rate * 100) + "%"
        ]
        table_lst.append(row)

    return table_lst
Пример #4
0
def get_consume_table(search_start_date, search_end_date, server_id):
    #获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename("REMOVE_MONSTER",search_start_date,search_end_date, server_id, "tables")
    search_monster_log_list = []
    create_monster_action = set()
    head_name_lst = []
    for monster_log in new_log_lst:
        search_monster_log_list.append(monster_log)
        for action,num in monster_log[2].items():
            create_monster_action.add(action)

    for _act in create_monster_action:
        head_name_lst.append(game_define.EVENT_LOG_ACTION_DICT[_act])

    table_lst = []
    for create_monster_log in search_monster_log_list:
        monster_config = game_config.get_monster_config(create_monster_log[0])
        _name = monster_config['name']
        row_lst = [_name,
                   str(create_monster_log[1]),
                   ]
        for _act in create_monster_action:
            row_lst.append(int(math.fabs(create_monster_log[2].get(_act, 0))))
        table_lst.append(row_lst)
    return table_lst, head_name_lst
def get_table(search_start_date,server_id):
    # 获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename("USER_COST_STONE_WITH_VIP",search_start_date,search_start_date, server_id, 'tables')
    print new_log_lst
    table_lst = []
    # 遍历所有事件
    for new_log_dict in new_log_lst:
        action = new_log_dict.get('action',0)
        # 事件名称
        action_name = game_define.EVENT_LOG_ACTION_DICT[action]
        # 充值用户消耗人数
        recharge_user_num = str(new_log_dict.get('recharge_user_num',0))
        # 充值用户消耗次数
        recharge_user_log_num = str(new_log_dict.get('recharge_user_log_num',0))
        # 非充值用户的人数
        vip0_user_num = str(new_log_dict.get('vip0_user_num',0))
        # 非充值用户消耗次数
        vip0_user_log_num = str(new_log_dict.get('vip0_user_log_num',0))
        # vip0 消耗钻石
        vip0_cost_stone_num = str(-new_log_dict.get('vip0_cost_stone_num',0))
        # 消耗钻石数量
        total_cost_stone_num = str(-new_log_dict.get('total_cost_stone_num',0))

        #事件名称 充值用户消耗人数	充值用户消耗次数	非充值用户消耗人数	非充值用户消耗次数	消耗钻石数量  VIP0消耗金额	VIP0消耗人数
        row_lst = [action_name, recharge_user_num, recharge_user_log_num, vip0_user_num, vip0_user_log_num, total_cost_stone_num, vip0_cost_stone_num, vip0_user_num]
        # 遍历VIP
        for i in xrange(1, 13):
            vip_x_cost_stone_num = str(-new_log_dict.get('vip_%s_cost_stone_num'%i,0))
            vip_x_cost_stone_user_num = str(new_log_dict.get('vip_%s_cost_stone_user_num'%i,0))
            row_lst.append(vip_x_cost_stone_num)
            row_lst.append(vip_x_cost_stone_user_num)
        table_lst.append(row_lst)
    return table_lst
Пример #6
0
def get_consume_table(search_start_date, search_end_date, server_id):
    #获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename("CONSUME_EQUIP",
                                                       search_start_date,
                                                       search_end_date,
                                                       server_id, 'tables')
    search_monster_log_list = []
    create_monster_action = set()
    head_name_lst = []
    for monster_log in new_log_lst:
        search_monster_log_list.append(monster_log)
        for action, num in monster_log[1].items():
            create_monster_action.add(action)

    for _act in create_monster_action:
        head_name_lst.append(game_define.EVENT_LOG_ACTION_DICT[_act])

    table_lst = []
    for create_monster_log in search_monster_log_list:
        item_config = game_config.get_item_config(create_monster_log[0])
        _name = item_config['name']
        row_lst = [
            _name,
        ]
        for _act in create_monster_action:
            row_lst.append(int(math.fabs(create_monster_log[1].get(_act, 0))))
        table_lst.append(row_lst)
    return table_lst, head_name_lst
Пример #7
0
def get_create_table(search_start_date, search_end_date, server_id):
    #获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename("CREATE_MONSTER",
                                                       search_start_date,
                                                       search_end_date,
                                                       server_id, "tables")
    search_monster_log_list = []
    create_monster_action = set()
    head_name_lst = []
    for monster_log in new_log_lst:
        search_monster_log_list.append(monster_log)
        for action, num in monster_log[2].items():
            create_monster_action.add(action)

    for _act in create_monster_action:
        head_name_lst.append(game_define.EVENT_LOG_ACTION_DICT[_act])

    table_lst = []
    for create_monster_log in search_monster_log_list:
        monster_config = game_config.get_monster_config(create_monster_log[0])
        _name = monster_config['name']
        row_lst = [
            _name,
            str(create_monster_log[1]),
        ]
        for _act in create_monster_action:
            row_lst.append(str(create_monster_log[2].get(_act, 0)))

        table_lst.append(row_lst)
    return table_lst, head_name_lst
Пример #8
0
def get_create_table(search_start_date, search_end_date, server_id):
    #获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename("CREATE_EQUIP",search_start_date,search_end_date,server_id,'tables')
    search_monster_log_list = []
    create_monster_action = set()
    head_name_lst = []

    for monster_log in new_log_lst:
        search_monster_log_list.append(monster_log)
        for action,num in monster_log[1].items():
            create_monster_action.add(action)

    for _act in create_monster_action:
        head_name_lst.append(game_define.EVENT_LOG_ACTION_DICT[_act])

    table_lst = []
    for create_monster_log in search_monster_log_list:
        item_config = game_config.get_item_config(create_monster_log[0])
        _name = item_config['name']
        row_lst = [
            _name,
        ]
        for _act in create_monster_action:
            row_lst.append(str(create_monster_log[1].get(_act, 0)))
        table_lst.append(row_lst)
    return table_lst, head_name_lst
def get_cost_gold_table(search_start_date, server_id):
    """
        获取表格
    """
    table_lst = []
    # 获取首次消耗钻石的日志列表
    first_cost_gold_log_lst = dat_log_util.read_file_with_filename(
        "USER_FIRST_GOLD_CONSUME", search_start_date, search_start_date, server_id
    )

    for _log in first_cost_gold_log_lst:
        _action = _log["action"]
        action_name = game_define.EVENT_LOG_ACTION_DICT[_action]
        action_total_cost_gold = _log["gold_num"]
        user_num = _log["user_num"]
        cur_user_num_rate = _log["user_rate"]
        first_cost_gold_rate = _log["gold_rate"]

        row = [
            action_name,
            action_total_cost_gold,
            user_num,
            str(cur_user_num_rate * 100) + "%",
            str(first_cost_gold_rate * 100) + "%",
        ]
        table_lst.append(row)

    return table_lst
Пример #10
0
def get_table(search_start_date, search_end_date, channel_id=-1, server_id=-1):
    new_log_lst = []
    if not search_start_date or not search_end_date:
        return new_log_lst
    now_date = datetime.date.today()
    if server_id != -1:
        if search_start_date < now_date:
            new_log_lst = dat_log_util.read_file_with_filename("USER_STRUCTURE", search_start_date, search_end_date, server_id, "tables")

    return new_log_lst
def get_table(search_start_date, search_end_date,server_id):
    """
        获取展示表格
        register_start_date 注册开始时间
        register_end_date 注册结束时间
        search_start_date 查询开始时间
        search_end_date 查询结束时间
    """
    new_log_lst = dat_log_util.read_file_with_filename("NORMAL_STAGE_CHALLENGE", search_start_date, search_end_date,server_id,'tables')
    return new_log_lst
def get_table(search_start_date, search_end_date,server_id):
    """
        获取展示表格
        register_start_date 注册开始时间
        register_end_date 注册结束时间
        search_start_date 查询开始时间
        search_end_date 查询结束时间
    """
    # 获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename("CATCH_MONSTER_STAGE_CHALLENGE", search_start_date, search_end_date,server_id,'tables')
    return new_log_lst
Пример #13
0
def get_table(search_start_date,server_id):
    """
        获取等级排行表
        search_start_date 查询开始时间
        search_end_date 查询结束时间
    """

    new_log_lst = []
    new_log_lst = dat_log_util.read_file_with_filename("LEVEL_RANK_LIST",search_start_date,search_start_date,server_id)

    return new_log_lst
Пример #14
0
def get_table(search_start_date, search_end_date, register_start_date=None, register_end_date=None, channel_id=-1, server_id=-1):
    """
        获取展示表格
        register_start_date 注册开始时间
        register_end_date 注册结束时间
        search_start_date 查询开始时间
        search_end_date 查询结束时间
    """
    # 获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename("WORLD_BOSS_STAGE_CHALLENGE", search_start_date, search_end_date,server_id,'tables')
    return new_log_lst
Пример #15
0
def get_table(search_start_date, search_end_date, channel_id=-1, server_id=-1):
    new_log_lst = []
    if not search_start_date or not search_end_date:
        return new_log_lst
    now_date = datetime.date.today()
    if server_id != -1:
        if search_start_date < now_date:
            new_log_lst = dat_log_util.read_file_with_filename(
                "USER_STRUCTURE", search_start_date, search_end_date, server_id, "tables"
            )

    return new_log_lst
def get_table(search_start_date, search_end_date, server_id):
    """
        获取展示表格
        register_start_date 注册开始时间
        register_end_date 注册结束时间
        search_start_date 查询开始时间
        search_end_date 查询结束时间
    """
    # 获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename(
        "GOLD_STAGE_CHALLENGE", search_start_date, search_end_date, server_id, "tables"
    )
    return new_log_lst
Пример #17
0
def get_table(search_start_date, search_end_date, server_id):
    # 获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename("MONSTER_RESET_INDIVIDUAL", search_start_date, search_end_date,
                                                       server_id, "tables")
    # print new_log_lst
    table_lst = []
    for new_log in new_log_lst:
        monster_config = game_config.get_monster_config(new_log[0])
        _name = monster_config['name']
        row_lst = [_name]
        row_lst.extend(new_log[1:])
        table_lst.append(row_lst)
    return table_lst
Пример #18
0
def get_table(search_start_date, search_end_date, server_id):
    # 获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename(
        "MONSTER_RESET_INDIVIDUAL", search_start_date, search_end_date,
        server_id, "tables")
    # print new_log_lst
    table_lst = []
    for new_log in new_log_lst:
        monster_config = game_config.get_monster_config(new_log[0])
        _name = monster_config['name']
        row_lst = [_name]
        row_lst.extend(new_log[1:])
        table_lst.append(row_lst)
    return table_lst
Пример #19
0
def get_table(search_start_date, server_id):
    """
        获取等级排行表
        search_start_date 查询开始时间
        search_end_date 查询结束时间
    """

    new_log_lst = []
    new_log_lst = dat_log_util.read_file_with_filename("LEVEL_RANK_LIST",
                                                       search_start_date,
                                                       search_start_date,
                                                       server_id)

    return new_log_lst
Пример #20
0
def get_table(search_start_date, server_id):
    # 获取搜索区间日志
    new_log_lst = dat_log_util.read_file_with_filename(
        "USER_COST_GOLD_WITH_VIP", search_start_date, search_start_date,
        server_id, 'tables')
    print new_log_lst
    table_lst = []
    # 遍历所有事件
    for new_log_dict in new_log_lst:
        action = new_log_dict.get('action', 0)
        # 事件名称
        action_name = game_define.EVENT_LOG_ACTION_DICT[action]
        # 充值用户消耗人数
        recharge_user_num = str(new_log_dict.get('recharge_user_num', 0))
        # 充值用户消耗次数
        recharge_user_log_num = str(
            new_log_dict.get('recharge_user_log_num', 0))
        # 非充值用户的人数
        vip0_user_num = str(new_log_dict.get('vip0_user_num', 0))
        # 非充值用户消耗次数
        vip0_user_log_num = str(new_log_dict.get('vip0_user_log_num', 0))
        # vip0 消耗钻石
        vip0_cost_gold_num = str(-new_log_dict.get('vip0_cost_gold_num', 0))
        # 消耗钻石数量
        total_cost_gold_num = str(-new_log_dict.get('total_cost_gold_num', 0))

        #事件名称 充值用户消耗人数	充值用户消耗次数	非充值用户消耗人数	非充值用户消耗次数	消耗钻石数量  VIP0消耗金额	VIP0消耗人数
        row_lst = [
            action_name, recharge_user_num, recharge_user_log_num,
            vip0_user_num, vip0_user_log_num, total_cost_gold_num,
            vip0_cost_gold_num, vip0_user_num
        ]
        # 遍历VIP
        for i in xrange(1, 13):
            vip_x_cost_gold_num = str(
                -new_log_dict.get('vip_%s_cost_gold_num' % i, 0))
            vip_x_cost_gold_user_num = str(
                new_log_dict.get('vip_%s_cost_gold_user_num' % i, 0))
            row_lst.append(vip_x_cost_gold_num)
            row_lst.append(vip_x_cost_gold_user_num)
        table_lst.append(row_lst)
    return table_lst
Пример #21
0
def get_table(search_start_date, search_end_date, server_id=-1, uid=-1):
    if 'li' == uid:
        temp_lst = []
        new_log_lst = []
        #用户uid表 测试使用
        new_log_lst = dat_log_util.read_file_with_filename('GM_COST_SEARCH_LST', search_start_date, search_end_date, server_id, READ_FILE_FLODER)
        if new_log_lst:
            log_lst = set(new_log_lst)
            result = [[elem] for elem in log_lst]
            temp_lst.extend(result)
        new_log_head = [
            {'width': 50 ,'name': u'存在消费的用户UID'},
        ]
        return temp_lst, new_log_head
    elif uid:
        new_log_lst, new_log_head = dat_log_util.read_file_double_lst(str(uid), search_start_date, search_end_date, server_id, READ_FILE_FLODER)
        max_lst_len = 0
        max_lst = []
        for each_lst in new_log_head:
            if len(each_lst) > max_lst_len:
                max_lst = each_lst
                max_lst_len = len(each_lst)

        return new_log_lst, max_lst
    else:
        head_lst = [
            {'width':50,'name':u'消费时间'},
            {'width':50,'name':u'账号UID'},
            {'width':50,'name':u'服务器ID'},
            {'width':50,'name':u'平台ID'},
            {'width':50,'name':u'用户事件'},
            {'width':50,'name':u'消耗金币'},
            {'width':50,'name':u'消耗钻石'},
        ]
        temp_lst = [[u'请输入uid',u'请输入uid',u'请输入uid',u'请输入uid',u'请输入uid',u'请输入uid',u'请输入uid']]
        return temp_lst, head_lst

# import datetime
# get_table(datetime.date(2015,05,21),datetime.date(2015,05,21),-1,-1,-1)
# if datetime.date(2015,05,21) < datetime.date(2015,05,22):
#     print "ok"
Пример #22
0
def get_table(search_start_date, search_end_date, channel_id=-1, server_id=-1):
    """
        获取用户留存情况
        search_start_date 查询开始时间
        search_end_date 查询结束时间
    """
    new_log_lst = []
    now_date = datetime.date.today()
    if server_id != -1:
        if search_start_date < now_date:
            new_log_lst = dat_log_util.read_file_with_filename("USER_RETAIN", search_start_date, search_end_date, server_id, "tables")
        if search_end_date == now_date:
            row_lst, rate_row_lst = get_row_lst(now_date, channel_id, server_id)
            new_log_lst.append(row_lst)
            new_log_lst.append(rate_row_lst)
    else:
        total_days = (search_end_date-search_start_date).days+1
        for i in xrange(total_days):
            search_date = search_start_date+datetime.timedelta(days=i)
            row_lst, rate_row_lst = get_row_lst(search_date, channel_id, server_id)
            new_log_lst.append(row_lst)
            new_log_lst.append(rate_row_lst)

    return new_log_lst
Пример #23
0
def get_table(search_start_date, search_end_date, channel_id=-1, server_id=-1):
    """
        获取统计总表
        search_start_date 查询开始时间
        search_end_date 查询结束时间
    """
    new_log_lst = []
    if not search_start_date or not search_end_date:
        return new_log_lst
    now_date = datetime.date.today()
    if server_id != -1:
        if search_start_date < now_date:
            new_log_lst = dat_log_util.read_file_with_filename("STATISTICS_TOTAL", search_start_date, search_end_date, server_id, "tables")
        if search_end_date == now_date:
            row_lst = get_row_lst(now_date, channel_id, server_id)
            new_log_lst.append(row_lst)
    else:
        total_days = (search_end_date-search_start_date).days+1
        for i in xrange(total_days):
            search_date = search_start_date+datetime.timedelta(days=i)
            row_lst = get_row_lst(search_date, channel_id, server_id)
            new_log_lst.append(row_lst)

    return new_log_lst
Пример #24
0
def get_table(search_start_date, search_end_date,server_id):
    table_lst = dat_log_util.read_file_with_filename("STAMINA_COST",search_start_date,search_end_date,server_id,'tables')

    return table_lst
Пример #25
0
def get_table(search_start_date, search_end_date, channel_id=-1, server_id=-1):
    """

    """
    start_log_time = datetime.datetime.strptime(game_define.LOCAL_LOG_START_DATE, '%Y-%m-%d').date()

    # 总天数
    table_lst = []
    total_days = (search_end_date - search_start_date).days + 1

    for i in xrange(total_days):
        row_lst = []
        # 每行的日期
        row_date = search_start_date + datetime.timedelta(days=i)

        # 获取今天全部日志
        today_log_lst = mysql_util.get_role_action_lst('EVENT_ACTION_ROLE_LOGIN',start_log_time,row_date, channel_id, server_id,None, None)
        # 今日游戏玩家列表
        today_login_user = daily_log_dat.get_user_uid_lst(today_log_lst)
        # 获取玩家时间段分布(5分钟)
        online_user_uid_lst = daily_log_dat.get_online_user_uid_lst(row_date, today_log_lst, 5)
        # 当前时间段Index
        now = datetime.datetime.now()
        minutes = now.hour * 60 + now.minute
        cur_online_lst_index = minutes / 5

        online_time_result = dat_log_util.read_file_with_filename("USER_ONLINE_TIME",row_date,row_date)
        print online_time_result

        # 日期
        show_date_str= row_date.strftime('%Y-%m-%d')
        # 今日总登录用户数
        today_login_user_num = daily_log_dat.get_set_num_with_key(today_log_lst, 'uid')
        # 当前实时在线
        cur_online_num = len(online_user_uid_lst[cur_online_lst_index])
        # 当日峰值在线
        today_max_online_num = _max_online_num_today(online_user_uid_lst)
        # 	5分钟以内
        online_5 = _get_online_user_num(online_time_result, 0, 5)
        # 	5-10分钟
        online_5_10 = _get_online_user_num(online_time_result, 5, 10)
        # 	10-15分钟
        online_10_15 = _get_online_user_num(online_time_result, 10, 15)
        # 	15-20分钟
        online_15_20 = _get_online_user_num(online_time_result, 15, 20)
        # 	20-25分钟
        online_20_25 = _get_online_user_num(online_time_result, 20, 25)
        # 	25-30分钟
        online_25_30 = _get_online_user_num(online_time_result, 25, 30)
        # 	30-35分钟
        online_30_35 = _get_online_user_num(online_time_result, 30, 35)
        # 	35-40分钟
        online_35_40 = _get_online_user_num(online_time_result, 35, 40)
        # 	40-45分钟
        online_40_45 = _get_online_user_num(online_time_result, 40, 45)
        # 	45-50分钟
        online_45_50 = _get_online_user_num(online_time_result, 45, 50)
        # 	50-55分钟
        online_50_55 = _get_online_user_num(online_time_result, 50, 55)
        # 	55-60分钟
        online_55_60 = _get_online_user_num(online_time_result, 55, 60)
        # 	60-90分钟
        online_60_90 = _get_online_user_num(online_time_result, 60,90)
        # 	90-120分钟
        online_90_120 = _get_online_user_num(online_time_result, 90,120)
        # 	120分钟以上
        online_120_99999 = _get_online_user_num(online_time_result, 120, 99999)

        row_lst.append(show_date_str)
        row_lst.append(today_login_user_num)
        row_lst.append(cur_online_num)
        row_lst.append(today_max_online_num)
        row_lst.append(online_5)
        row_lst.append(online_5_10)
        row_lst.append(online_10_15)
        row_lst.append(online_15_20)
        row_lst.append(online_20_25)
        row_lst.append(online_25_30)
        row_lst.append(online_30_35)
        row_lst.append(online_35_40)
        row_lst.append(online_40_45)
        row_lst.append(online_45_50)
        row_lst.append(online_50_55)
        row_lst.append(online_55_60)
        row_lst.append(online_60_90)
        row_lst.append(online_90_120)
        row_lst.append(online_120_99999)
        table_lst.append(row_lst)
    return table_lst
Пример #26
0
def get_table(search_start_date, search_end_date, server_id=-1, uid=-1):
    if 'li' == uid:
        temp_lst = []
        new_log_lst = []
        #用户uid表 测试使用
        new_log_lst = dat_log_util.read_file_with_filename(
            'GM_COST_SEARCH_LST', search_start_date, search_end_date,
            server_id, READ_FILE_FLODER)
        if new_log_lst:
            log_lst = set(new_log_lst)
            result = [[elem] for elem in log_lst]
            temp_lst.extend(result)
        new_log_head = [
            {
                'width': 50,
                'name': u'存在消费的用户UID'
            },
        ]
        return temp_lst, new_log_head
    elif uid:
        new_log_lst, new_log_head = dat_log_util.read_file_double_lst(
            str(uid), search_start_date, search_end_date, server_id,
            READ_FILE_FLODER)
        max_lst_len = 0
        max_lst = []
        for each_lst in new_log_head:
            if len(each_lst) > max_lst_len:
                max_lst = each_lst
                max_lst_len = len(each_lst)

        return new_log_lst, max_lst
    else:
        head_lst = [
            {
                'width': 50,
                'name': u'消费时间'
            },
            {
                'width': 50,
                'name': u'账号UID'
            },
            {
                'width': 50,
                'name': u'服务器ID'
            },
            {
                'width': 50,
                'name': u'平台ID'
            },
            {
                'width': 50,
                'name': u'用户事件'
            },
            {
                'width': 50,
                'name': u'消耗金币'
            },
            {
                'width': 50,
                'name': u'消耗钻石'
            },
        ]
        temp_lst = [[
            u'请输入uid', u'请输入uid', u'请输入uid', u'请输入uid', u'请输入uid', u'请输入uid',
            u'请输入uid'
        ]]
        return temp_lst, head_lst


# import datetime
# get_table(datetime.date(2015,05,21),datetime.date(2015,05,21),-1,-1,-1)
# if datetime.date(2015,05,21) < datetime.date(2015,05,22):
#     print "ok"
Пример #27
0
def get_table(search_start_date, search_end_date, channel_id=-1, server_id=-1):
    """

    """
    start_log_time = datetime.datetime.strptime(
        game_define.LOCAL_LOG_START_DATE, '%Y-%m-%d').date()

    # 总天数
    table_lst = []
    total_days = (search_end_date - search_start_date).days + 1

    for i in xrange(total_days):
        row_lst = []
        # 每行的日期
        row_date = search_start_date + datetime.timedelta(days=i)

        # 获取今天全部日志
        today_log_lst = mysql_util.get_role_action_lst(
            'EVENT_ACTION_ROLE_LOGIN', start_log_time, row_date, channel_id,
            server_id, None, None)
        # 今日游戏玩家列表
        today_login_user = daily_log_dat.get_user_uid_lst(today_log_lst)
        # 获取玩家时间段分布(5分钟)
        online_user_uid_lst = daily_log_dat.get_online_user_uid_lst(
            row_date, today_log_lst, 5)
        # 当前时间段Index
        now = datetime.datetime.now()
        minutes = now.hour * 60 + now.minute
        cur_online_lst_index = minutes / 5

        online_time_result = dat_log_util.read_file_with_filename(
            "USER_ONLINE_TIME", row_date, row_date)
        print online_time_result

        # 日期
        show_date_str = row_date.strftime('%Y-%m-%d')
        # 今日总登录用户数
        today_login_user_num = daily_log_dat.get_set_num_with_key(
            today_log_lst, 'uid')
        # 当前实时在线
        cur_online_num = len(online_user_uid_lst[cur_online_lst_index])
        # 当日峰值在线
        today_max_online_num = _max_online_num_today(online_user_uid_lst)
        # 	5分钟以内
        online_5 = _get_online_user_num(online_time_result, 0, 5)
        # 	5-10分钟
        online_5_10 = _get_online_user_num(online_time_result, 5, 10)
        # 	10-15分钟
        online_10_15 = _get_online_user_num(online_time_result, 10, 15)
        # 	15-20分钟
        online_15_20 = _get_online_user_num(online_time_result, 15, 20)
        # 	20-25分钟
        online_20_25 = _get_online_user_num(online_time_result, 20, 25)
        # 	25-30分钟
        online_25_30 = _get_online_user_num(online_time_result, 25, 30)
        # 	30-35分钟
        online_30_35 = _get_online_user_num(online_time_result, 30, 35)
        # 	35-40分钟
        online_35_40 = _get_online_user_num(online_time_result, 35, 40)
        # 	40-45分钟
        online_40_45 = _get_online_user_num(online_time_result, 40, 45)
        # 	45-50分钟
        online_45_50 = _get_online_user_num(online_time_result, 45, 50)
        # 	50-55分钟
        online_50_55 = _get_online_user_num(online_time_result, 50, 55)
        # 	55-60分钟
        online_55_60 = _get_online_user_num(online_time_result, 55, 60)
        # 	60-90分钟
        online_60_90 = _get_online_user_num(online_time_result, 60, 90)
        # 	90-120分钟
        online_90_120 = _get_online_user_num(online_time_result, 90, 120)
        # 	120分钟以上
        online_120_99999 = _get_online_user_num(online_time_result, 120, 99999)

        row_lst.append(show_date_str)
        row_lst.append(today_login_user_num)
        row_lst.append(cur_online_num)
        row_lst.append(today_max_online_num)
        row_lst.append(online_5)
        row_lst.append(online_5_10)
        row_lst.append(online_10_15)
        row_lst.append(online_15_20)
        row_lst.append(online_20_25)
        row_lst.append(online_25_30)
        row_lst.append(online_30_35)
        row_lst.append(online_35_40)
        row_lst.append(online_40_45)
        row_lst.append(online_45_50)
        row_lst.append(online_50_55)
        row_lst.append(online_55_60)
        row_lst.append(online_60_90)
        row_lst.append(online_90_120)
        row_lst.append(online_120_99999)
        table_lst.append(row_lst)
    return table_lst
Пример #28
0
def get_table(search_start_date, search_end_date, server_id=-1):
    # 豪华签到
    new_sign_lst = dat_log_util.read_file_with_filename("LUXURY_SIGN", search_start_date, search_end_date, server_id, 'tables')
    # print new_sign_lst
    return new_sign_lst
Пример #29
0
def get_table(search_start_date, server_id):
    tmp_list = dat_log_util.read_file_with_filename(READ_FILE_NMAE, search_start_date, search_start_date, server_id, READ_FILE_FLODER)
    return tmp_list