def add_metric(self, labels, value, timestamp=None):
labels = tuple(labels)<EOL>for state, enabled in sorted(value.items()):<EOL><INDENT>v = (<NUM_LIT:1> if enabled else <NUM_LIT:0>)<EOL>self.samples.append(Sample(<EOL>self.name,<EOL>dict(zip(self._labelnames + (self.name,), labels + (state,))),<EOL>v,<EOL>timestamp,<EOL>))<EOL><DEDENT>
Add a metric to the metric family.

        Args:
          labels: A list of label values
          value: A dict of string state names to booleans