original_docstring: 
          Spawn a process_ionosphere_echo check to create features profiles at
          settings.FULL_DURATION for Mirage metrics
  
          :param i: python process id
          :param metric_check_file: full path to the metric check file
          :type i: object
          :type metric_check_file: str
          :return: boolean
          :rtype: boolean
  
          
docstring: Spawn a process_ionosphere_echo check to create features profiles at
  settings.FULL_DURATION for Mirage metrics
docstring_tokens: Spawn a process_ionosphere_echo check to create features profiles at settings . FULL_DURATION for Mirage metrics
code: def process_ionosphere_echo(self, i, metric_check_file):
          """
          Spawn a process_ionosphere_echo check to create features profiles at
          settings.FULL_DURATION for Mirage metrics
  
          :param i: python process id
          :param metric_check_file: full path to the metric check file
          :type i: object
          :type metric_check_file: str
          :return: boolean
          :rtype: boolean
  
          """
  
          try:
              # Load and validate metric variables
              metric_vars_array = self.new_load_metric_vars(str(metric_check_file))
          except:
              logger.info(traceback.format_exc())
              logger.error('error :: process_ionosphere_echo :: failed to load metric variables from check file - %s' % (metric_check_file))
              return
          added_by = None
          try:
              key = 'added_by'
              value_list = [var_array[1] for var_array in metric_vars_array if var_array[0] == key]
              added_by = str(value_list[0])
              if settings.ENABLE_IONOSPHERE_DEBUG:
                  logger.info('debug :: metric variable - added_by - %s' % added_by)
          except:
              logger.error('error :: process_ionosphere_echo failed to read added_by variable from check file - %s' % (metric_check_file))
              added_by = None
          if not added_by:
              return
          if added_by != 'mirage':
              # @modified 20200109 - Feature #3380: Create echo features profile when a Mirage features profile is created
              # Allow to be added by webapp
              if added_by == 'webapp':
                  logger.info('process_ionosphere_echo :: metric added_by %s OK' % added_by)
              else:
                  logger.info('process_ionosphere_echo :: only mirage metrics are processed not metrics added_by %s' % added_by)
                  return
          metric = None
          try:
              # metric_vars.metric
              key = 'metric'
              value_list = [var_array[1] for var_array in metric_vars_array if var_array[0] == key]
              metric = str(value_list[0])
              if settings.ENABLE_IONOSPHERE_DEBUG:
                  logger.info('debug :: metric variable - metric - %s' % metric)
          except:
              logger.info(traceback.format_exc())
              logger.error('error :: failed to read metric variable from check file - %s' % (metric_check_file))
              metric = None
          if not metric:
              logger.error('error :: process_ionosphere_echo failed to load metric variable from check file - %s' % (metric_check_file))
              return
  
          # @added 20190413 - Feature #2484: FULL_DURATION feature profiles
          # Only process if it is an ionosphere enabled metric
          try:
              # @modified 20191030 - Bug #3266: py3 Redis binary objects not strings
              #                      Branch #3262: py3
              # ionosphere_unique_metrics = list(self.redis_conn.smembers('ionosphere.unique_metrics'))
              ionosphere_unique_metrics = list(self.redis_conn_decoded.smembers('ionosphere.unique_metrics'))
          except:
              logger.error(traceback.format_exc())
              logger.error('error :: failed to get ionosphere.unique_metrics from Redis')
              ionosphere_unique_metrics = []
          if ionosphere_unique_metrics:
              # @modified 20190413 - Bug #2942: process_ionosphere_echo metric mismatch
              #                      Feature #2484: FULL_DURATION feature profiles
              # Matching bug for not in list comprehension it must be an absolute
              # match
              # if not metric in ionosphere_unique_metrics:
              metric_name = '%s%s' % (str(settings.FULL_NAMESPACE), str(metric))
              # @modified 20190522: Task #3034: Reduce multiprocessing Manager list usage
              # if not metric_name in ionosphere_unique_metrics:
              if metric_name not in ionosphere_unique_metrics:
                  # @modified 20200109 - Feature #3380: Create echo features profile when a Mirage features profile is created
                  # Allow metrics added by webapp to skip this check as they may
                  # be new ionosphere metrics and not be in the ionosphere.unique_metrics
                  # set yet
                  if added_by == 'webapp':
                      logger.info('process_ionosphere_echo :: %s is not in ionosphere.unique_metrics but added by webapp so possibly a new metric' % metric)
                  else:
                      logger.info('process_ionosphere_echo :: only ionosphere enabled metrics are processed, skipping %s' % metric)
                      return
  
          full_duration = None
          try:
              # metric_vars.full_duration
              key = 'full_duration'
              value_list = [var_array[1] for var_array in metric_vars_array if var_array[0] == key]
              full_duration = int(value_list[0])
              if settings.ENABLE_IONOSPHERE_DEBUG:
                  logger.info('debug :: metric variable - full_duration - %s' % str(full_duration))
          except:
              logger.error('error :: process_ionosphere_echo failed to read full_duration variable from check file - %s' % (metric_check_file))
              full_duration = None
          if not full_duration:
              return
  
          logger.info('process_ionosphere_echo :: processing - %s' % (metric))
          ionosphere_echo(metric, full_duration)
code_tokens: def process_ionosphere_echo ( self , i , metric_check_file ) : try : metric_vars_array = self . new_load_metric_vars ( str ( metric_check_file ) ) except : logger . info ( traceback . format_exc ( ) ) logger . error ( 'error :: process_ionosphere_echo :: failed to load metric variables from check file - %s' % ( metric_check_file ) ) return added_by = None try : key = 'added_by' value_list = [ var_array [ 1 ] for var_array in metric_vars_array if var_array [ 0 ] == key ] added_by = str ( value_list [ 0 ] ) if settings . ENABLE_IONOSPHERE_DEBUG : logger . info ( 'debug :: metric variable - added_by - %s' % added_by ) except : logger . error ( 'error :: process_ionosphere_echo failed to read added_by variable from check file - %s' % ( metric_check_file ) ) added_by = None if not added_by : return if added_by != 'mirage' : if added_by == 'webapp' : logger . info ( 'process_ionosphere_echo :: metric added_by %s OK' % added_by ) else : logger . info ( 'process_ionosphere_echo :: only mirage metrics are processed not metrics added_by %s' % added_by ) return metric = None try : key = 'metric' value_list = [ var_array [ 1 ] for var_array in metric_vars_array if var_array [ 0 ] == key ] metric = str ( value_list [ 0 ] ) if settings . ENABLE_IONOSPHERE_DEBUG : logger . info ( 'debug :: metric variable - metric - %s' % metric ) except : logger . info ( traceback . format_exc ( ) ) logger . error ( 'error :: failed to read metric variable from check file - %s' % ( metric_check_file ) ) metric = None if not metric : logger . error ( 'error :: process_ionosphere_echo failed to load metric variable from check file - %s' % ( metric_check_file ) ) return try : ionosphere_unique_metrics = list ( self . redis_conn_decoded . smembers ( 'ionosphere.unique_metrics' ) ) except : logger . error ( traceback . format_exc ( ) ) logger . error ( 'error :: failed to get ionosphere.unique_metrics from Redis' ) ionosphere_unique_metrics = [ ] if ionosphere_unique_metrics : metric_name = '%s%s' % ( str ( settings . FULL_NAMESPACE ) , str ( metric ) ) if metric_name not in ionosphere_unique_metrics : if added_by == 'webapp' : logger . info ( 'process_ionosphere_echo :: %s is not in ionosphere.unique_metrics but added by webapp so possibly a new metric' % metric ) else : logger . info ( 'process_ionosphere_echo :: only ionosphere enabled metrics are processed, skipping %s' % metric ) return full_duration = None try : key = 'full_duration' value_list = [ var_array [ 1 ] for var_array in metric_vars_array if var_array [ 0 ] == key ] full_duration = int ( value_list [ 0 ] ) if settings . ENABLE_IONOSPHERE_DEBUG : logger . info ( 'debug :: metric variable - full_duration - %s' % str ( full_duration ) ) except : logger . error ( 'error :: process_ionosphere_echo failed to read full_duration variable from check file - %s' % ( metric_check_file ) ) full_duration = None if not full_duration : return logger . info ( 'process_ionosphere_echo :: processing - %s' % ( metric ) ) ionosphere_echo ( metric , full_duration )
short_docstring: Spawn a process_ionosphere_echo check to create features profiles at
  settings.FULL_DURATION for Mirage metrics
short_docstring_tokens: Spawn a process_ionosphere_echo check to create features profiles at settings . FULL_DURATION for Mirage metrics
comment: """
          Spawn a process_ionosphere_echo check to create features profiles at
          settings.FULL_DURATION for Mirage metrics
  
          :param i: python process id
          :param metric_check_file: full path to the metric check file
          :type i: object
          :type metric_check_file: str
          :return: boolean
          :rtype: boolean
  
          """$SEP$# Load and validate metric variables$SEP$# @modified 20200109 - Feature #3380: Create echo features profile when a Mirage features profile is created$SEP$# Allow to be added by webapp$SEP$# metric_vars.metric$SEP$# @added 20190413 - Feature #2484: FULL_DURATION feature profiles$SEP$# Only process if it is an ionosphere enabled metric$SEP$# @modified 20191030 - Bug #3266: py3 Redis binary objects not strings$SEP$#                      Branch #3262: py3$SEP$# ionosphere_unique_metrics = list(self.redis_conn.smembers('ionosphere.unique_metrics'))$SEP$# @modified 20190413 - Bug #2942: process_ionosphere_echo metric mismatch$SEP$#                      Feature #2484: FULL_DURATION feature profiles$SEP$# Matching bug for not in list comprehension it must be an absolute$SEP$# match$SEP$# if not metric in ionosphere_unique_metrics:$SEP$# @modified 20190522: Task #3034: Reduce multiprocessing Manager list usage$SEP$# if not metric_name in ionosphere_unique_metrics:$SEP$# @modified 20200109 - Feature #3380: Create echo features profile when a Mirage features profile is created$SEP$# Allow metrics added by webapp to skip this check as they may$SEP$# be new ionosphere metrics and not be in the ionosphere.unique_metrics$SEP$# set yet$SEP$# metric_vars.full_duration