コード例 #1
0
    def __init__(self,
                 logfile,
                 nickname,
                 timeinterval,
                 logger,
                 dbop,
                 starthead=False,
                 startdate=None):
        '''
        Constructor
        '''
        fileHandleImpl.__init__(self, logfile, nickname, timeinterval, logger,
                                dbop, starthead, startdate)

        # 内部状态
        self.__jvmInfoDatasTypeQPS = {
        }  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
        self.__jvmInfoDatasTypeAVG = {
        }  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
        self.__jvmInfoDatasTypeSUM = {
        }  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}

        self.__jvmKeyFile = 'gc.keys'
        self.__gcViewerInitTimestamp = time.time()  # 初始化时间
        self.__lastMaxTimestamp = 0  # 记录最大的timestamp
        self.__gcViewerPath = os.path.join(
            os.path.dirname(sys._getframe().f_code.co_filename),
            'gcviewer.jar')
        self.__tmpGCViwerLogDir = 'tmp_gcviewerlog'  # gcviewerlog临时目录
        self.__minHanleSize = 200  # 每次处理最少行数
        self.__maxHandleCircle = 6  # 单次输入数据,最多分为6次处理
        try:
            self.__devnull = open('/dev/null', 'w')  # 将结果不显示
        except:
            self.__devnull = None
コード例 #2
0
    def __init__(self,
                 logfile,
                 nickname,
                 timeinterval,
                 logger,
                 dbop,
                 starthead=False,
                 startdate=None):
        '''
        Constructor
        '''
        fileHandleImpl.__init__(self, logfile, nickname, timeinterval, logger,
                                dbop, starthead, startdate)

        # 内部状态
        self.__jvmHandlers = []
        self.__jvmMonitorItems = [
            'parnew', 'parnewper', 'old', 'oldper', 'realtime',
            'realtime_full', 'gc_full', 'gc_young'
        ]

        self.__jvmInfoDatasTypeQPS = [
            (0, {}),
        ]  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
        self.__jvmInfoDatasTypeAVG = [
            (0, {}),
        ]  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
        self.__jvmInfoDatasTypeSUM = [
            (0, {}),
        ]  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
コード例 #3
0
    def __init__( self, logfile , nickname, timeinterval, logger , dbop, starthead = False, startdate = None ):
        '''
        Constructor
        '''
        fileHandleImpl.__init__( self, logfile, nickname, timeinterval, logger, dbop, starthead, startdate )

        # 内部状态
        self.__jvmHandlers = []
        self.__jvmMonitorItems = ['parnew', 'parnewper', 'old', 'oldper', 'realtime', 'realtime_full', 'gc_full', 'gc_young']

        self.__jvmInfoDatasTypeQPS = [( 0, {} ), ]  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
        self.__jvmInfoDatasTypeAVG = [( 0, {} ), ]  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
        self.__jvmInfoDatasTypeSUM = [( 0, {} ), ]  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
コード例 #4
0
    def __init__(self,
                 logfile,
                 nickname,
                 timeinterval,
                 numberkeys,
                 strkeys,
                 logger,
                 dbop,
                 starthead=False,
                 startdate=None,
                 notimestamp=False,
                 enablemultikey=False,
                 datadelaytime=0):
        '''
        Constructor
        '''
        fileHandleImpl.__init__(self, logfile, nickname, timeinterval, logger,
                                dbop, starthead, startdate, notimestamp)

        self.__dataDelayTime = timeinterval  # 数据延时显示时间
        if datadelaytime > timeinterval:
            self.__dataDelayTime = timeinterval * (int(
                (datadelaytime + timeinterval - 1) / timeinterval))
        # 监控项
        self.__enableMultiKey = enablemultikey  # 是否支持单行内处理多个key
        self.__numberKeys = numberkeys
        self.__strKeys = strkeys
        self.__monitorKeys = []  # 为了方面内部使用
        self.__monitorKeys.extend(self.__numberKeys)
        self.__monitorKeys.extend(self.__strKeys)
        self.__monitorKeys = dict.fromkeys(list(set(self.__monitorKeys)), True)
        self.__valuePatternSingle = re.compile(
            r'\s+([\w\.-_]+)\s*=\s*([\w\.]+)')
        self.__valuePatternAll = re.compile(
            r'.*\s+([\w\.-_]+)\s*=\s*([\w\.]+)')
        self.__regexStartIndex = 0  # 正则匹配位置
        # 初始化匹配函数
        if enablemultikey:
            self.extractValesPairs = self.__extractAllValesPairs
        else:
            self.extractValesPairs = self.__extractSingleValesPairs
コード例 #5
0
    def __init__( self, logfile , nickname, timeinterval, logger , dbop, starthead = False, startdate = None ):
        '''
        Constructor
        '''
        fileHandleImpl.__init__( self, logfile, nickname, timeinterval, logger, dbop, starthead, startdate )

        # 内部状态
        self.__jvmInfoDatasTypeQPS = {}  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
        self.__jvmInfoDatasTypeAVG = {}  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}
        self.__jvmInfoDatasTypeSUM = {}  # 未处理数据: 数据存放方式是字典型的, timestamp :{ key :  [values]}

        self.__jvmKeyFile = 'gc.keys'
        self.__gcViewerInitTimestamp = time.time()  # 初始化时间
        self.__lastMaxTimestamp = 0  # 记录最大的timestamp
        self.__gcViewerPath = os.path.join( os.path.dirname( sys._getframe().f_code.co_filename ), 'gcviewer.jar' )
        self.__tmpGCViwerLogDir = 'tmp_gcviewerlog'  # gcviewerlog临时目录
        self.__minHanleSize = 200  # 每次处理最少行数
        self.__maxHandleCircle = 6  # 单次输入数据,最多分为6次处理
        try:
            self.__devnull = open( '/dev/null', 'w' )  # 将结果不显示
        except:
            self.__devnull = None