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


Python DataLogger.get_tablenames方法代码示例

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


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

示例1: get_tablenames

# 需要导入模块: from datalogger import DataLogger [as 别名]
# 或者: from datalogger.DataLogger import get_tablenames [as 别名]
    def get_tablenames(project):
        """
        get available tablenames, for one particular project
        uses directory listing in raw subdirectory for this purpose

        ex: Datalogger/get_tablenames/{projectname}
        <projectname> has to be something from Datalogger/get_projects

        returns:
        json(list of possible tablenames for given project)
        """
        return json.dumps(DataLogger.get_tablenames(basedir, project))
开发者ID:gunny26,项目名称:datalogger,代码行数:14,代码来源:code2.py

示例2: main

# 需要导入模块: from datalogger import DataLogger [as 别名]
# 或者: from datalogger.DataLogger import get_tablenames [as 别名]
def main():
    for datestring in tuple(DataLogger.datewalker(startdate, args.enddate)):
        start_ts, stop_ts = DataLogger.get_ts_for_datestring(datestring)
        logging.debug("working on datestring %s (from %s to %s)", datestring, start_ts, stop_ts)
        for project in DataLogger.get_projects(args.basedir):
            if args.project is not None:
                if project != args.project:
                    logging.debug("skipping project %s", project)
                    continue
            logging.debug("working on project %s", project)
            for tablename in DataLogger.get_tablenames(args.basedir, project):
                if args.tablename is not None:
                    if tablename != args.tablename:
                        logging.debug("skipping tablename %s", tablename)
                        continue
                    logging.debug("working on tablename %s", tablename)
                archive(project, tablename, datestring)
开发者ID:gunny26,项目名称:datalogger,代码行数:19,代码来源:archiver.py

示例3: main

# 需要导入模块: from datalogger import DataLogger [as 别名]
# 或者: from datalogger.DataLogger import get_tablenames [as 别名]
def main():
    project = "nagios"
    for tablename in DataLogger.get_tablenames(BASEDIR, project):
        datalogger = DataLogger(BASEDIR, project, tablename)
        for datestring in datewalker("2015-04-01", "2015-09-23"):
            print datestring, tablename
            try:
                caches = datalogger.get_caches(datestring)
                #for cachetype, cachedata in caches.items():
                #    print "Caches for %s" % cachetype
                #    for key, filename in cachedata["keys"].items():
                #        print "\tfound %s in\n\t\t%s" % (key, filename)
                # there should be only one tsa file
                #print "Number of caches TimeseriesArray objects:", len(caches["tsa"]["keys"])
                #print "Number of caches TimeseriesArrayStats objects:", len(caches["tsastat"]["keys"])
                #print "Number of caches Timeseries objects:", len(caches["ts"]["keys"])
                #print "Number of caches TimeseriesStats objects:", len(caches["tsstat"]["keys"])
                if len(caches["tsa"]["keys"]) == 0:
                    print datestring, "TimeseriesArray cache missing"
                    datalogger.load_tsa(datestring)
                else:
                    #datalogger[datestring] # read from raw, and store tsa and ts caches
                    if len(caches["tsa"]["keys"]) != len(caches["tsastat"]["keys"]):
                        print datestring, "TimeseriesArrayStats caches missing"
                        datalogger.load_tsastats(datestring)
                    else:
                        if len(caches["ts"]["keys"]) != len(caches["tsstat"]["keys"]):
                            print datestring, "Number ob Timeseries and TimeseriesStats should be the same"
                        if len(caches["ts"]["keys"]) > len(caches["tsstat"]["keys"]):
                            print datestring, "some missing TimeseriesStats"
            except tilak_datalogger.DataLoggerRawFileMissing as exc:
                #logging.exception(exc)
                logging.info("%s no RAW Data available", datestring)
                pass
            except StandardError as exc:
                logging.exception(exc)
                pass
开发者ID:gunny26,项目名称:datalogger,代码行数:39,代码来源:test_datalogger.py

示例4: setUp

# 需要导入模块: from datalogger import DataLogger [as 别名]
# 或者: from datalogger.DataLogger import get_tablenames [as 别名]
 def setUp(self):
     self.basedir = "/var/rrd"
     self.datestring = "2015-11-30"
     self.project = DataLogger.get_projects(self.basedir)[0]
     self.tablename = DataLogger.get_tablenames(self.basedir, self.project)[0]
     self.datalogger = DataLogger(self.basedir, self.project, self.tablename)
开发者ID:gunny26,项目名称:datalogger,代码行数:8,代码来源:test_DataLogger.py


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