コード例 #1
0
ファイル: __init__.py プロジェクト: zeta1999/Xpedite
  def gatherBenchmarks(self, count):
    """
    Gathers benchmarks from a list of paths in the file system

    :param count: Max count of benchmarks to load

    """
    benchmarks = []
    if not self.benchmarkPaths:
      return benchmarks

    for i, path in enumerate(self.benchmarkPaths):
      benchmarkPath = os.path.join(path, BENCHMARK_DIR_NAME)
      if os.path.isdir(benchmarkPath):
        info = loadBenchmarkInfo(benchmarkPath)
        if info:
          (benchmarkName, cpuInfo, path, legend, events) = info
          benchmark = Benchmark(benchmarkName, cpuInfo, path, legend, events)
          dataSource = Collector.gatherDataSource(benchmarkPath)
          if dataSource:
            benchmark.dataSource = dataSource
            benchmarks.append(benchmark)
        else:
          LOGGER.warn('skip processing benchmark %s. failed to load benchmark info', path)

        if len(benchmarks) >= count:
          if i + 1 < len(self.benchmarkPaths):
            LOGGER.debug('skip processing %s benchmarks. limit reached.', self.benchmarkPaths[i+1:])
          break
      else:
        LOGGER.warn('skip processing benchmark %s. failed to locate benchmark files', path)
    return benchmarks
コード例 #2
0
 def __init__(self, name, ip, appInfoPath, runId=None, dataSourcePath=None, workspace=None):
   """Constructs an instance of XpediteDormantApp"""
   dataSource = Collector.gatherDataSource(dataSourcePath) if dataSourcePath else None
   if dataSource:
     LOGGER.warn('Data source detected. overriding appinfo to %s', dataSource.appInfoPath)
     appInfoPath = dataSource.appInfoPath
   XpediteApp.__init__(self, name, ip, appInfoPath, dryRun=True, workspace=workspace)
   self.dataSource = dataSource
   self.runId = runId