Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is my list of generators not complete? Missing performance_test

I'm not at all familiar with Rails, but Google (although very unlike it) couldn't help me out this time.

I'm running an installation of Rails set up by somebody else. This is what I get when I run rails g:

Usage: rails generate GENERATOR [args] [options]

General options:
  -h, [--help]     # Print generator's options and usage
  -p, [--pretend]  # Run but do not make any changes
  -f, [--force]    # Overwrite files that already exist
  -s, [--skip]     # Skip files that already exist
  -q, [--quiet]    # Suppress status output

Please choose a generator below.

Rails:
  assets
  controller
  generator
  helper
  integration_test
  jbuilder
  mailer
  migration
  model
  resource
  scaffold
  scaffold_controller
  task

Bootstrap:
  bootstrap:install
  bootstrap:layout
  bootstrap:partial
  bootstrap:themed

Coffee:
  coffee:assets

Jquery:
  jquery:install

Js:
  js:assets

TestUnit:
  test_unit:plugin

You'll notice a couple of generators missing, amongst which performance_test, the one I'm trying to use.

Why is this list not complete? How can I install missing generators? I'm running version 4.0.3.

like image 548
Honoki Avatar asked Mar 21 '14 08:03

Honoki


People also ask

What is performance testing and what are the issues that can affect it?

Performance testing is a subset of performance engineering. It is abbreviated as “Perf Testing”. It is defined as a software testing process that is used to test the speed, scalability, response time, resource usage, and reliability of a software. It is done to check the working of software for a particular workload.

How do you decide the number of load generator machines required to run a test?

No of load generators = Total no of users/ users per load generator. So, if you want to run 1000 users load test, you would need 4 load generator machines with same configuration.


1 Answers

As of rails 4 performance tests are no longer part of the default stack. If you want to use performance tests simply follow these instructions.

Add this line to your application's Gemfile:

gem 'rails-perftest'

If you want to benchmark/profile under MRI or REE, add this line as well:

gem 'ruby-prof'

Now run bundle install and you're ready to go.

rails-perftest

like image 154
Andreas Lyngstad Avatar answered Oct 12 '22 06:10

Andreas Lyngstad