本文整理匯總了Python中collector.Collector.scheduled_time方法的典型用法代碼示例。如果您正苦於以下問題:Python Collector.scheduled_time方法的具體用法?Python Collector.scheduled_time怎麽用?Python Collector.scheduled_time使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類collector.Collector
的用法示例。
在下文中一共展示了Collector.scheduled_time方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: PeriodicLog
# 需要導入模塊: from collector import Collector [as 別名]
# 或者: from collector.Collector import scheduled_time [as 別名]
#.........這裏部分代碼省略.........
def get_slice_on_interval(self, column, start, end, interval, extended=0):
stream = self.log.get_slice(column, start, end, extended)
return _IntervalStreamFilter(interval, stream)
def get_slice(self, column, start, stop, extended=0):
return self.log.get_slice(column, start, stop, extended)
def get_last_record(self):
return self.log.get_last_record()
def get_first_record(self):
return self.log.get_first_record()
def get_last_logged_value(self, column_name):
last_record = self.log.get_last_record()
if last_record:
if last_record.has_key(column_name):
rtValue = last_record[column_name]
else:
rtValue = None
else:
rtvalue = None
return rtValue
def get_first_logged_value(self, column):
first_record = self.log.get_first_record()
if first_record:
return first_record[column]
return None
def get_columns(self):
return self.log.get_columns()
def get_column_names(self):
return self._column_names()
def describe_columns(self):
return self.log.describe_columns()
def get_column_name(self, column_index):
return self.log.get_column_name(column_index)
def trim_ge(self, column_name, value):
if self.debug:
msg = (("calling trim_ge on LOG: COLUMN: " + str(column_name)) + " VALUE: ") + str(value)
mpx.lib.msglog.log("broadway", mpx.lib.msglog.types.DB, msg)
self.log.trim_ge(column_name, value)
def trim_gt(self, column_name, value):
if self.debug:
msg = (("calling trim_gt on LOG: COLUMN: " + str(column_name)) + " VALUE: ") + str(value)
mpx.lib.msglog.log("broadway", mpx.lib.msglog.types.DB, msg)
self.log.trim_gt(column_name, value)
def trim_le(self, column_name, value):
if self.debug:
msg = (("calling trim_le on LOG: COLUMN: " + str(column_name)) + " VALUE: ") + str(value)
mpx.lib.msglog.log("broadway", mpx.lib.msglog.types.DB, msg)
self.log.trim_le(column_name, value)
def trim_lt(self, column_name, value):
if self.debug:
msg = (("calling trim_lt on LOG: COLUMN: " + str(column_name)) + " VALUE: ") + str(value)
mpx.lib.msglog.log("broadway", mpx.lib.msglog.types.DB, msg)
self.log.trim_lt(column_name, value)
def start(self):
if self.debug:
msg = "Package: mpx.service.logger.periodic_log\n"
msg = msg + "Class: PeriodicLog\n"
msg = msg + "Method: start"
msg = msg + "starting the periodic log collecting..."
mpx.lib.msglog.log("broadway", mpx.lib.msglog.types.DB, msg)
if self.collector is not None:
self.collector.stop()
self.collector = Collector(self, self.period, self.trigger)
for node in self.get_child("columns").children_nodes():
self.collector.add_column(node)
Log.start(self)
self.collector.start()
def stop(self):
if self.debug:
msg = "Package: mpx.service.logger.periodic_log\n"
msg = msg + "Class: PeriodicLog\n"
msg = msg + "Method: start"
msg = msg + "stopping the periodic log collecting..."
mpx.lib.msglog.log("broadway", mpx.lib.msglog.types.DB, msg)
if self.collector != None:
self.collector.stop()
self.collector = None
Log.stop(self)
def next_scheduled_time(self):
return self.collector.next_scheduled_time()
def scheduled_time(self):
return self.collector.scheduled_time()