コード例 #1
0
 def ConstructCloudRedis(self):
     """Create the cloud_redis object."""
     if self.config.cloud_redis is None:
         return
     cloud = self.config.cloud_redis.cloud
     providers.LoadProvider(cloud)
     cloud_redis_class = cloud_redis.GetCloudRedisClass(cloud)
     self.cloud_redis = cloud_redis_class(self.config.cloud_redis)
コード例 #2
0
def CheckPrerequisites(benchmark_config):
    """Verifies that the required resources are present.

  Args:
    benchmark_config: benchmark_config
  Raises:
    perfkitbenchmarker.data.ResourceNotFound: On missing resource.
  """
    # TODO(ruwa): This CheckPrerequisites call checks the prerequisites
    # on the resource. Ideally, the benchmark is not responsible for this task.
    # Instead, BaseResource should check prerequisites as part of creation and
    # child resources can override CheckPrerequisites and benefit from it.
    cloud_redis_class = cloud_redis.GetCloudRedisClass(
        benchmark_config.cloud_redis.cloud)
    cloud_redis_class.CheckPrerequisites(benchmark_config)