parameters: (self, ctx, manager, config, name, logger)
docstring: Test reproducibility
docstring_summary: Test reproducibility
docstring_tokens: Test reproducibility
function: def __init__(self, ctx, manager, config, name, logger):
          super(MonitorThrasher, self).__init__()
  
          self.ctx = ctx
          self.manager = manager
          self.manager.wait_for_clean()
  
          self.stopping = False
          self.logger = logger
          self.config = config
          self.name = name
  
          if self.config is None:
              self.config = dict()
  
          """ Test reproducibility """
          self.random_seed = self.config.get('seed', None)
  
          if self.random_seed is None:
              self.random_seed = int(time.time())
  
          self.rng = random.Random()
          self.rng.seed(int(self.random_seed))
  
          """ Monitor thrashing """
          self.revive_delay = float(self.config.get('revive_delay', 10.0))
          self.thrash_delay = float(self.config.get('thrash_delay', 0.0))
  
          self.thrash_many = self.config.get('thrash_many', False)
          self.maintain_quorum = self.config.get('maintain_quorum', True)
  
          self.scrub = self.config.get('scrub', True)
  
          self.freeze_mon_probability = float(self.config.get('freeze_mon_probability', 10))
          self.freeze_mon_duration = float(self.config.get('freeze_mon_duration', 15.0))
  
          assert self.max_killable() > 0, \
              'Unable to kill at least one monitor with the current config.'
  
          """ Store thrashing """
          self.store_thrash = self.config.get('store_thrash', False)
          self.store_thrash_probability = int(
              self.config.get('store_thrash_probability', 50))
          if self.store_thrash:
              assert self.store_thrash_probability > 0, \
                  'store_thrash is set, probability must be > 0'
              assert self.maintain_quorum, \
                  'store_thrash = true must imply maintain_quorum = true'
  
          #MDS failover
          self.mds_failover = self.config.get('check_mds_failover', False)
  
          if self.mds_failover:
              self.mds_cluster = MDSCluster(ctx)
  
          self.thread = gevent.spawn(self.do_thrash)
function_tokens: def __init__ ( self , ctx , manager , config , name , logger ) : super ( MonitorThrasher , self ) . __init__ ( ) self . ctx = ctx self . manager = manager self . manager . wait_for_clean ( ) self . stopping = False self . logger = logger self . config = config self . name = name if self . config is None : self . config = dict ( ) self . random_seed = self . config . get ( 'seed' , None ) if self . random_seed is None : self . random_seed = int ( time . time ( ) ) self . rng = random . Random ( ) self . rng . seed ( int ( self . random_seed ) ) """ Monitor thrashing """ self . revive_delay = float ( self . config . get ( 'revive_delay' , 10.0 ) ) self . thrash_delay = float ( self . config . get ( 'thrash_delay' , 0.0 ) ) self . thrash_many = self . config . get ( 'thrash_many' , False ) self . maintain_quorum = self . config . get ( 'maintain_quorum' , True ) self . scrub = self . config . get ( 'scrub' , True ) self . freeze_mon_probability = float ( self . config . get ( 'freeze_mon_probability' , 10 ) ) self . freeze_mon_duration = float ( self . config . get ( 'freeze_mon_duration' , 15.0 ) ) assert self . max_killable ( ) > 0 , 'Unable to kill at least one monitor with the current config.' """ Store thrashing """ self . store_thrash = self . config . get ( 'store_thrash' , False ) self . store_thrash_probability = int ( self . config . get ( 'store_thrash_probability' , 50 ) ) if self . store_thrash : assert self . store_thrash_probability > 0 , 'store_thrash is set, probability must be > 0' assert self . maintain_quorum , 'store_thrash = true must imply maintain_quorum = true' #MDS failover self . mds_failover = self . config . get ( 'check_mds_failover' , False ) if self . mds_failover : self . mds_cluster = MDSCluster ( ctx ) self . thread = gevent . spawn ( self . do_thrash )