code: func period(start, end time.Time) time.Duration {
  	switch n := end.Sub(start).Hours(); {
  	case n > 24:
  		return time.Hour * 24
  	default:
  		return time.Hour
  	}
  }
docs: // period returns the resolution of metrics.