Helper function for creating MetricMetadata for event metrics.

def CreateEventMetadata(metric_name,
                        bins=None,
                        fields=None,
                        docstring=None,
                        units=None):
  """Helper function for creating MetricMetadata for event metrics."""
  return rdf_stats.MetricMetadata(
      varname=metric_name,
      bins=bins or [],
      metric_type=rdf_stats.MetricMetadata.MetricType.EVENT,
      value_type=rdf_stats.MetricMetadata.ValueType.DISTRIBUTION,
      fields_defs=FieldDefinitionProtosFromTuples(fields or []),
      docstring=docstring,
      units=units)