(self, path, derivative, multiplier, prettyname,
                          device)
For some metrics we need to divide the delta for one metric
        with the delta of another.
        Publishes a metric if the convertion goes well.
For some metrics we need to divide the delta for one metric
        with the delta of another.
        Publishes a metric if the convertion goes well.
For some metrics we need to divide the delta for one metric with the delta of another . Publishes a metric if the convertion goes well .
def _gen_delta_depend(self, path, derivative, multiplier, prettyname,
                          device):
        """
        For some metrics we need to divide the delta for one metric
        with the delta of another.
        Publishes a metric if the convertion goes well.
        """
        primary_delta = derivative[path]
        shortpath = ".".join(path.split(".")[:-1])
        basename = path.split(".")[-1]
        secondary_delta = None
        if basename in self.DIVIDERS.keys():
            mateKey = ".".join([shortpath, self.DIVIDERS[basename]])
        else:
            return
        if mateKey in derivative.keys():
            secondary_delta = derivative[mateKey]
        else:
            return

        # If we find a corresponding secondary_delta, publish a metric
        if primary_delta > 0 and secondary_delta > 0:
            value = (float(primary_delta) / secondary_delta) * multiplier
            self._replace_and_publish(path, prettyname, value, device)
def _gen_delta_depend ( self , path , derivative , multiplier , prettyname , device ) : primary_delta = derivative [ path ] shortpath = "." . join ( path . split ( "." ) [ : - 1 ] ) basename = path . split ( "." ) [ - 1 ] secondary_delta = None if basename in self . DIVIDERS . keys ( ) : mateKey = "." . join ( [ shortpath , self . DIVIDERS [ basename ] ] ) else : return if mateKey in derivative . keys ( ) : secondary_delta = derivative [ mateKey ] else : return # If we find a corresponding secondary_delta, publish a metric if primary_delta > 0 and secondary_delta > 0 : value = ( float ( primary_delta ) / secondary_delta ) * multiplier self . _replace_and_publish ( path , prettyname , value , device )