def buildBuckets(series, bucketCount):
  """
  Builds buckets for given elapsed tsc distribution bundle

  :param series: series of values
  :param bucketCount: number of buckets

  """
  series = sorted(series)
  confidence = series[0:int(.95 * len(series))]
  total = sum(confidence)
  count = len(confidence)
  if count <= 0:
    return None
  mean = total / count
  lowerBound = mean / 2
  upperBound = mean * 2
  bucketSize = (upperBound - lowerBound) / bucketCount
  buckets = []
  if bucketSize != 0:
    bucket = lowerBound
    while bucket <= upperBound:
      buckets.append(bucket)
      bucket += bucketSize
  return buckets