code: def _replace_and_publish(self, path, prettyname, value, device):
          
          if value is None:
              return
          newpath = path
          # Change metric name before publish if needed.
          newpath = ".".join([".".join(path.split(".")[:-1]), prettyname])
          metric = Metric(newpath, value, precision=4, host=device)
          self.publish_metric(metric)
docs: Inputs a complete path for a metric and a value.
          Replace the metric name and publish.