当前位置: 首页>>代码示例>>Python>>正文


Python Collector.add_column方法代码示例

本文整理汇总了Python中collector.Collector.add_column方法的典型用法代码示例。如果您正苦于以下问题:Python Collector.add_column方法的具体用法?Python Collector.add_column怎么用?Python Collector.add_column使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在collector.Collector的用法示例。


在下文中一共展示了Collector.add_column方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: PeriodicLog

# 需要导入模块: from collector import Collector [as 别名]
# 或者: from collector.Collector import add_column [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()
开发者ID:,项目名称:,代码行数:104,代码来源:


注:本文中的collector.Collector.add_column方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。