def add_metric(self, labels, buckets, gsum_value, timestamp=None):
for bucket, value in buckets:<EOL><INDENT>self.samples.append(Sample(<EOL>self.name + '<STR_LIT>',<EOL>dict(list(zip(self._labelnames, labels)) + [('<STR_LIT>', bucket)]),<EOL>value, timestamp))<EOL><DEDENT>self.samples.extend([<EOL>Sample(self.name + '<STR_LIT>', dict(zip(self._labelnames, labels)), buckets[-<NUM_LIT:1>][<NUM_LIT:1>], timestamp),<EOL>Sample(self.name + '<STR_LIT>', dict(zip(self._labelnames, labels)), gsum_value, timestamp),<EOL>])<EOL>
Add a metric to the metric family.

        Args:
          labels: A list of label values
          buckets: A list of pairs of bucket names and values.
              The buckets must be sorted, and +Inf present.
          gsum_value: The sum value of the metric.