def get_unique_histogram_value(histogram):
  """If histogram has a unique value, returns that value. Otherwise returns a
  string of the format "Not Unique. {count: <number of values>,
  sampleValues: <a representative sample of values>}". If no value is found,
  returns an empty string.

  The decision to return a string instead of raising an exception in these
  failure cases is intentional. The json results produced by cluster telemetry
  / chrome trace processor pipeline often has all kinds of errors, and we don't
  want to choke on them, but we also want to be aware of their presence so we
  can fix the errors if possible.
  """
  if 'running' in histogram:
    running_stats = histogram['running']
    running_max = running_stats[1]
    running_min = running_stats[4]
    if running_min == running_max:
      return running_min
    else:
      return "Not Unique. count: {count}, sampleValues: {sampleValues}".format(
        count=running_stats[0], sampleValues=histogram.get('sampleValues', []))
  return ''