← к каталогу

📦 prosopite/ charkost

Rails N+1 queries auto-detection with zero false positives / false negatives

Открыть на GitHub ↗обновлён 1мес назад
Звёзды
★ 1.9k
Форки
63
За неделю
3
За месяц
—
Рост %
0.2%
Язык
Ruby

Установка и запуск

Quick start

Add Prosopite to your Gemfile:

gem 'prosopite'
gem 'pg_query' # Optional, with PostgreSQL

With PostgreSQL, pg_query makes the fingerprints of queries more precise, but it's a native extension that doesn't install everywhere, and Prosopite works without it.

Then install it and set it up:

$ bundle install
$ bin/rails generate prosopite:install

The generator creates config/initializers/prosopite.rb, which shows N+1 queries on the pages in development and raises for them in tests, and it scans each test. N+1 queries also go to the Rails log, unless another logger is set. The sections below show how to set it up yourself.

Prosopite needs Ruby 2.7+ and Rails 6.1+. The footer on pages needs Rails 7.1+, and the scanning of fibers Ruby 3.2+.

Из README репозитория · полный README на GitHub

Категории

Теги

performancerails