Beispiel #1
0
	def updateDailyActiveUsers(self):
		last_dau = len(self.dau)
		self.dau = set()
		if switch.DEBUG_BASE == 0:
			def update_cb(content):
				if content:
					INFO_MSG("updateDAU: {}".format(content))
				else:
					INFO_MSG("updateDAU: {}: Nothing")

			utility.update_dau(last_dau, update_cb)
		else:
			# 测试服直接打印统计信息
			INFO_MSG("updateDAU: {}".format(last_dau))
Beispiel #2
0
    def updateDailyActiveByGame(self):
        def update_cb(content):
            if content:
                INFO_MSG("updateDAU by game: {}".format(content))
            else:
                INFO_MSG("updateDAU by game: {}: Nothing")

        try:
            if switch.DEBUG_BASE == 0:
                for game_type in self.dau_by_game:
                    utility.update_dau(len(self.dau_by_game[game_type]),
                                       const.GameType2GameName[game_type],
                                       update_cb)
            else:
                for game_type in self.dau_by_game:
                    DEBUG_MSG("update DAU by game {} : {}".format(
                        game_type, len(self.dau_by_game[game_type])))
        except:
            import traceback
            ERROR_MSG(traceback.format_exc())
        self.dau_by_game = {}