tools/perf/generate_perf_sharding.py
def _DescheduleBenchmark(args):
  """Remove benchmarks from the shard maps without re-sharding."""
  del args
  builders = bot_platforms.ALL_PLATFORMS
  for b in builders:
    benchmarks_to_keep = set(
        benchmark.Name() for benchmark in b.benchmarks_to_run)
    executables_to_keep = set(executable.name for executable in b.executables)
    with open(b.shards_map_file_path, 'r') as f:
      if not os.path.exists(b.shards_map_file_path):
        continue
      shards_map = json.load(f, object_pairs_hook=collections.OrderedDict)
      for shard, shard_map in shards_map.items():
        if shard == 'extra_infos':
          break
        benchmarks = shard_map.get('benchmarks', dict())
        for benchmark in benchmarks.keys():
          if benchmark not in benchmarks_to_keep:
            del benchmarks[benchmark]
        executables = shard_map.get('executables', dict())
        for executable in executables.keys():
          if executable not in executables_to_keep:
            del executables[executable]
    os.remove(b.shards_map_file_path)
    _DumpJson(shards_map, b.shards_map_file_path)
  print('done.')
Remove benchmarks from the shard maps without re-sharding.
Remove benchmarks from the shard maps without re-sharding.
Remove benchmarks from the shard maps without re - sharding .
def _DescheduleBenchmark(args):
  del args
  builders = bot_platforms.ALL_PLATFORMS
  for b in builders:
    benchmarks_to_keep = set(
        benchmark.Name() for benchmark in b.benchmarks_to_run)
    executables_to_keep = set(executable.name for executable in b.executables)
    with open(b.shards_map_file_path, 'r') as f:
      if not os.path.exists(b.shards_map_file_path):
        continue
      shards_map = json.load(f, object_pairs_hook=collections.OrderedDict)
      for shard, shard_map in shards_map.items():
        if shard == 'extra_infos':
          break
        benchmarks = shard_map.get('benchmarks', dict())
        for benchmark in benchmarks.keys():
          if benchmark not in benchmarks_to_keep:
            del benchmarks[benchmark]
        executables = shard_map.get('executables', dict())
        for executable in executables.keys():
          if executable not in executables_to_keep:
            del executables[executable]
    os.remove(b.shards_map_file_path)
    _DumpJson(shards_map, b.shards_map_file_path)
  print('done.')
def _DescheduleBenchmark ( args ) : del args builders = bot_platforms . ALL_PLATFORMS for b in builders : benchmarks_to_keep = set ( benchmark . Name ( ) for benchmark in b . benchmarks_to_run ) executables_to_keep = set ( executable . name for executable in b . executables ) with open ( b . shards_map_file_path , 'r' ) as f : if not os . path . exists ( b . shards_map_file_path ) : continue shards_map = json . load ( f , object_pairs_hook = collections . OrderedDict ) for shard , shard_map in shards_map . items ( ) : if shard == 'extra_infos' : break benchmarks = shard_map . get ( 'benchmarks' , dict ( ) ) for benchmark in benchmarks . keys ( ) : if benchmark not in benchmarks_to_keep : del benchmarks [ benchmark ] executables = shard_map . get ( 'executables' , dict ( ) ) for executable in executables . keys ( ) : if executable not in executables_to_keep : del executables [ executable ] os . remove ( b . shards_map_file_path ) _DumpJson ( shards_map , b . shards_map_file_path ) print ( 'done.' )
Remove benchmarks from the shard maps without re-sharding.
Remove benchmarks from the shard maps without re - sharding .
"""Remove benchmarks from the shard maps without re-sharding."""
args