Exemplo n.º 1
0
    def createOdsTable(self, parsMap):
        # 执行控制
        self.dwSqlServcie = DwSql()

        # 日志类型
        logType = parsMap.get('logType')
        if (logType == None or logType == ''):
            self.accessLogStatus = self.accessLog(parsMap)
            self.dwAccessLogStatus = self.dwAccessLog(parsMap)
            self.ubaAppActionLogStatus = self.ubaAppActionLog(parsMap)
            self.ubaWebVisitLogStatus = self.ubaWebVisitLog(parsMap)
            self.ubaWebActionLogStatus = self.ubaWebActionLog(parsMap)

        elif (logType == 'access_log'):
            self.accessLogStatus = self.accessLog(parsMap)

        elif (logType == 'dw_access_log'):
            self.dwAccessLogStatus = self.dwAccessLog(parsMap)

        elif (logType == 'uba_app_action_log'):
            self.ubaAppActionLogStatus = self.ubaAppActionLog(parsMap)

        elif (logType == 'uba_web_visit_log'):
            self.ubaWebVisitLogStatus = self.ubaWebVisitLog(parsMap)

        elif (logType == 'uba_web_action_log'):
            self.ubaWebActionLogStatus = self.ubaWebActionLog(parsMap)
Exemplo n.º 2
0
    def process(self):
        Logger.init()
        # 录入参数:
        parsMap = self.getFormatParameter()

        # 执行控制
        self.dwSqlServcie = DwSql()

        # 日志类型
        logType = parsMap.get('logType')
        if (logType == None or logType == '') :
             # APP 主题  LOG
            self.dwAppAccessLogStatus = self.dwAppAccessLog(parsMap)
            self.dwAppActionDetailLogStatus = self.dwAppActionDetailLog(parsMap)
    
            # WEB 主题 Log
            self.dwWebVisitTrafficLogStatus = self.dwWebVisitTrafficLog(parsMap)
            self.dwWebActionDetailLogStatus = self.dwWebActionDetailLog(parsMap)

        elif (logType == 'dw_app_access_log' ):
            self.dwAppAccessLogStatus = self.dwAppAccessLog(parsMap)

        elif (logType == 'dw_app_action_detail_log' ):
            self.dwAppActionDetailLogStatus = self.dwAppActionDetailLog(parsMap)

        elif (logType == 'dw_web_visit_traffic_log' ):
            self.dwWebVisitTrafficLogStatus = sself.dwWebVisitTrafficLog(parsMap)

        elif (logType == 'dw_web_action_detail_log' ):
            self.dwWebActionDetailLogStatus =  self.dwWebActionDetailLog(parsMap)
Exemplo n.º 3
0
    def storedProcedure(self, date):
        # 存储构成的 sql 文件
        sqlFile = 'monitor/monitor_minireport.sql'

        sqlContent = DwSql().getDwSqlContent(sqlFile, date)

        return self.getRegisterInstance('biDbModel').batchExecuteSql(
            sqlContent)
Exemplo n.º 4
0
class UbaOdsTableRun(DwServiceCore):

    dwSqlServcie = None

    # uba sql 所在目录
    ubaSqlPath = None

    # 最终状态:
    accessLogStatus = None
    dwAccessLogStatus = None
    ubaAppActionLogStatus = None
    ubaWebVisitLogStatus = None
    ubaWebActionLogStatus = None

    def init(self):
        DwServiceCore.init(self)

        Logger.init()

        self.ubaSqlPath = self.getDwCoreInstance().SystemPath(
            'basePath') + '/uba_log/uba_sql'

    def process(self):
        # 录入参数:
        parsMap = self.getFormatParameter()

        self.createOdsTable(parsMap)

    def createOdsTable(self, parsMap):
        # 执行控制
        self.dwSqlServcie = DwSql()

        # 日志类型
        logType = parsMap.get('logType')
        if (logType == None or logType == ''):
            self.accessLogStatus = self.accessLog(parsMap)
            self.dwAccessLogStatus = self.dwAccessLog(parsMap)
            self.ubaAppActionLogStatus = self.ubaAppActionLog(parsMap)
            self.ubaWebVisitLogStatus = self.ubaWebVisitLog(parsMap)
            self.ubaWebActionLogStatus = self.ubaWebActionLog(parsMap)

        elif (logType == 'access_log'):
            self.accessLogStatus = self.accessLog(parsMap)

        elif (logType == 'dw_access_log'):
            self.dwAccessLogStatus = self.dwAccessLog(parsMap)

        elif (logType == 'uba_app_action_log'):
            self.ubaAppActionLogStatus = self.ubaAppActionLog(parsMap)

        elif (logType == 'uba_web_visit_log'):
            self.ubaWebVisitLogStatus = self.ubaWebVisitLog(parsMap)

        elif (logType == 'uba_web_action_log'):
            self.ubaWebActionLogStatus = self.ubaWebActionLog(parsMap)

    def accessLog(self, parsMap):
        parsData = parsMap
        parsData.update({"sql": self.ubaSqlPath + "/ods/access_log.sql"})
        return self.dwSqlServcie.runDwSqlProcess(parsData)

    def dwAccessLog(self, parsMap):
        parsData = parsMap
        parsData.update({"sql": self.ubaSqlPath + "/ods/dw_access_log.sql"})
        return self.dwSqlServcie.runDwSqlProcess(parsData)

    def ubaAppActionLog(self, parsMap):
        parsData = parsMap
        parsData.update(
            {"sql": self.ubaSqlPath + "/ods/uba_app_action_log.sql"})
        return self.dwSqlServcie.runDwSqlProcess(parsData)

    def ubaWebVisitLog(self, parsMap):
        parsData = parsMap
        parsData.update(
            {"sql": self.ubaSqlPath + "/ods/uba_web_visit_log.sql"})
        return self.dwSqlServcie.runDwSqlProcess(parsData)

    def ubaWebActionLog(self, parsMap):
        parsData = parsMap
        parsData.update(
            {"sql": self.ubaSqlPath + "/ods/uba_web_action_log.sql"})
        return self.dwSqlServcie.runDwSqlProcess(parsData)

    def shutdown(self):
        Logger.info("执行结果 access_log : " + str(self.accessLogStatus))
        Logger.info("执行结果 dw_access_log : " + str(self.dwAccessLogStatus))
        Logger.info("执行结果 uba_app_action_log : " +
                    str(self.ubaAppActionLogStatus))
        Logger.info("执行结果 uba_web_visit_log : " +
                    str(self.ubaWebVisitLogStatus))
        Logger.info("执行结果 uba_web_action_log : " +
                    str(self.ubaWebActionLogStatus))
Exemplo n.º 5
0
class UbaRun(DwServiceCore) :

    dwSqlServcie = None

    # uba sql 所在目录
    ubaSqlPath = None

    # 最终状态:
    dwAppAccessLogStatus = None
    dwAppActionDetailLogStatus = None
    dwWebVisitTrafficLogStatus = None
    dwWebActionDetailLogStatus = None


    def init(self):
        DwServiceCore.init(self)

        self.ubaSqlPath = self.getDwCoreInstance().SystemPath('basePath') + '/uba_log/uba_sql'


    def process(self):
        Logger.init()
        # 录入参数:
        parsMap = self.getFormatParameter()

        # 执行控制
        self.dwSqlServcie = DwSql()

        # 日志类型
        logType = parsMap.get('logType')
        if (logType == None or logType == '') :
             # APP 主题  LOG
            self.dwAppAccessLogStatus = self.dwAppAccessLog(parsMap)
            self.dwAppActionDetailLogStatus = self.dwAppActionDetailLog(parsMap)
    
            # WEB 主题 Log
            self.dwWebVisitTrafficLogStatus = self.dwWebVisitTrafficLog(parsMap)
            self.dwWebActionDetailLogStatus = self.dwWebActionDetailLog(parsMap)

        elif (logType == 'dw_app_access_log' ):
            self.dwAppAccessLogStatus = self.dwAppAccessLog(parsMap)

        elif (logType == 'dw_app_action_detail_log' ):
            self.dwAppActionDetailLogStatus = self.dwAppActionDetailLog(parsMap)

        elif (logType == 'dw_web_visit_traffic_log' ):
            self.dwWebVisitTrafficLogStatus = sself.dwWebVisitTrafficLog(parsMap)

        elif (logType == 'dw_web_action_detail_log' ):
            self.dwWebActionDetailLogStatus =  self.dwWebActionDetailLog(parsMap)


    # app 访问 access_log
    def dwAppAccessLog(self, parsMap):
        parsData = parsMap
        parsData.update( {"sql" : self.ubaSqlPath + "/app/dw_app_access_log.sql"} )
        return self.dwSqlServcie.runDwSqlProcess(parsData)


    # app 用户行为log
    def dwAppActionDetailLog(self, parsMap):
        parsData = parsMap
        parsData.update( {"sql" : self.ubaSqlPath + "/app/dw_app_action_detail_log.sql"} )
        return self.dwSqlServcie.runDwSqlProcess(parsData)


    # web 访问 log
    def dwWebVisitTrafficLog(self, parsMap):
        parsData = parsMap
        parsData.update( {"sql" : self.ubaSqlPath + "/web/dw_web_visit_traffic_log.sql"} )
        return self.dwSqlServcie.runDwSqlProcess(parsData)


    # web 行为 log
    def dwWebActionDetailLog(self, parsMap):
        parsData = parsMap
        parsData.update( {"sql" : self.ubaSqlPath + "/web/dw_web_action_detail_log.sql"} )
        return self.dwSqlServcie.runDwSqlProcess(parsData)


    def shutdown(self):
        Logger.info("执行结果 dw_app_access_log : " + str(self.dwAppAccessLogStatus))
        Logger.info("执行结果 dw_app_action_detail_log : " + str(self.dwAppActionDetailLogStatus))
        Logger.info("执行结果 dw_web_visit_traffic_log : " + str(self.dwWebVisitTrafficLogStatus))
        Logger.info("执行结果 dw_web_action_detail_log : " + str(self.dwWebActionDetailLogStatus))