spark_plugin.py
def configure(self, config_map):
        """
        Configuration callback for collectd

        Args:
        config_map (dict): mapping of config name to value
        """
        collectd.info("Configuring Spark Process Plugin ...")

        if "MasterPort" not in config_map and "WorkerPorts" not in config_map:
            raise ValueError(
                "No port provided for metrics url - \
                please provide key 'MasterPort' and/or 'WorkerPorts'"
            )
            return

        for key, value in config_map.items():
            if key == METRIC_ADDRESS:
                if not _validate_url(value):
                    raise ValueError("URL is not prefixed with http://")
                self.metric_address = value
            elif key == "MasterPort":
                collectd.info("MasterPort detected")
                self.master_port = str(int(value))
            elif key == "WorkerPorts":
                collectd.info("WorkerPort(s) detected")
                for port in value:
                    self.worker_ports.append(str(int(port)))
            elif key == "Dimensions" or key == "Dimension":
                self.global_dimensions.update(_dimensions_str_to_dict(value))
            elif key == "EnhancedMetrics" and value == "True":
                self.enhanced_flag = True
            elif key == "IncludeMetrics":
                _add_metrics_to_set(self.include, value)
            elif key == "ExcludeMetrics":
                _add_metrics_to_set(self.exclude, value)

        collectd.info("Successfully configured Spark Process Plugin ...")

        Configuration callback for collectd

        Args:
        config_map (dict): mapping of config name to value
        
Configuration callback for collectd
Args:
config_map (dict): mapping of config name to value
Configuration callback for collectd Args : config_map ( dict ) : mapping of config name to value
def configure(self, config_map):
        collectd.info("Configuring Spark Process Plugin ...")
        if "MasterPort" not in config_map and "WorkerPorts" not in config_map:
            raise ValueError(
                "No port provided for metrics url - \
                please provide key 'MasterPort' and/or 'WorkerPorts'"
            )
            return
        for key, value in config_map.items():
            if key == METRIC_ADDRESS:
                if not _validate_url(value):
                    raise ValueError("URL is not prefixed with http://")
                self.metric_address = value
            elif key == "MasterPort":
                collectd.info("MasterPort detected")
                self.master_port = str(int(value))
            elif key == "WorkerPorts":
                collectd.info("WorkerPort(s) detected")
                for port in value:
                    self.worker_ports.append(str(int(port)))
            elif key == "Dimensions" or key == "Dimension":
                self.global_dimensions.update(_dimensions_str_to_dict(value))
            elif key == "EnhancedMetrics" and value == "True":
                self.enhanced_flag = True
            elif key == "IncludeMetrics":
                _add_metrics_to_set(self.include, value)
            elif key == "ExcludeMetrics":
                _add_metrics_to_set(self.exclude, value)
        collectd.info("Successfully configured Spark Process Plugin ...")
def configure ( self , config_map ) : collectd . info ( "Configuring Spark Process Plugin ..." ) if "MasterPort" not in config_map and "WorkerPorts" not in config_map : raise ValueError ( "No port provided for metrics url - \
                please provide key 'MasterPort' and/or 'WorkerPorts'" ) return for key , value in config_map . items ( ) : if key == METRIC_ADDRESS : if not _validate_url ( value ) : raise ValueError ( "URL is not prefixed with http://" ) self . metric_address = value elif key == "MasterPort" : collectd . info ( "MasterPort detected" ) self . master_port = str ( int ( value ) ) elif key == "WorkerPorts" : collectd . info ( "WorkerPort(s) detected" ) for port in value : self . worker_ports . append ( str ( int ( port ) ) ) elif key == "Dimensions" or key == "Dimension" : self . global_dimensions . update ( _dimensions_str_to_dict ( value ) ) elif key == "EnhancedMetrics" and value == "True" : self . enhanced_flag = True elif key == "IncludeMetrics" : _add_metrics_to_set ( self . include , value ) elif key == "ExcludeMetrics" : _add_metrics_to_set ( self . exclude , value ) collectd . info ( "Successfully configured Spark Process Plugin ..." )
Configuration callback for collectd
Args:
config_map (dict): mapping of config name to value
Configuration callback for collectd Args : config_map ( dict ) : mapping of config name to value
"""
        Configuration callback for collectd

        Args:
        config_map (dict): mapping of config name to value
        """
self
config_map