Example #1
0
	def __init__(self,configData,timeManager):
		#时间管理器,用于储存更新时间数据
		self.timeManager = timeManager
		#配置信息
		self.configData = configData
		#配置logger
		logging.config.fileConfig(self.configData.loggerConfPath)
		self.logger = logging.getLogger(self.configData.loggerName)
		#最近一段时间的数据窗口长度
		self.windowLength = int(configData.windowLength)
		#所有的统计状态
		self.totalStatusKey = "total"
		self.allInOneDic = {}
		self.allInOneDic[self.totalStatusKey] = statsItem(self.windowLength)
		#用于标记新的key值
		self.newKeyFlag = False
		#标准标记符
		self.stdIndex = ":"
		#不同数据类型key尾缀
		self.keySuffixList = [":avgReqCost",":reqSuccessRatio",":reqNum"]
		#前缀
		self.keyPrefix = "eros:server:"
		#日志类型
		self.logTypeList = ["ERROR","INFO","WARNING"]
		self.ccProducer = chartConfProducer(self.configData.keyTablePath,self.keyPrefix,self.keySuffixList)
Example #2
0
	def __init__(self,configData,timeManager):
		#时间管理器,用于储存更新时间数据
		self.timeManager = timeManager
		#配置信息
		self.configData = configData
		#配置logger
		logging.config.fileConfig(self.configData.loggerConfPath)
		self.logger = logging.getLogger(self.configData.loggerName)
		#最近一段时间的数据窗口长度
		self.windowLength = int(configData.windowLength)
		#最大可延迟处理的数据条数,用于解决数据发送时间的混淆
		self.delayPostNum = int(configData.delayPostNum)
		#暂时存储延迟数据
		self.delayDataList = []
		#用于解析key值以便发送数据
		self.parseKeysDic = {}
		#所有的统计状态
		self.allInOneDic = {}
		#用于标记新的key值
		self.newKeyFlag = False
		#用于标记特征、算法、候选
		self.indexList = ["-",":",","]
		#标准标记符
		self.stdIndex = ":"
		#不同数据类型key尾缀
		self.keySuffixList = [":tpoint:ctr",":tpoint:rpm",":tperiod:ctr",":tperiod:rpm"]
		#self.timePeriodMark = ":tperiod"
		#self.timePointMark = ":tpoint"
		#前缀
		self.keyPrefix = "eros:"
		self.ccProducer = chartConfProducer(self.configData.keyTablePath,self.keyPrefix,self.keySuffixList)