STUDY MEMO

学習のメモ書き

<Ruby on Rails> rails serverを立ちあげてページを表示した時に画面左上に出てくる表示について

背景

rails serverを立ち上げてページを開くと、左上にprofiler-resultの表示が出ていた。
これは何かということと、非表示方法を記載する。

Image from Gyazo

profiler-resultを出すgem

gem 'rack-mini-profiler', '~> 2.0'

公式での記載

Middleware that displays speed badge for every html page. Designed to work both in production and in development.
Features
・Database profiling - Currently supports Mysql2, Postgres, Oracle (oracle_enhanced ~> 1.5.0) and Mongoid3 (with fallback support to ActiveRecord)
・Call-stack profiling - Flame graphs showing time spent by gem
・Memory profiling - Per-request memory usage, GC stats, and global allocation metrics

↓DeepLでの翻訳
HTMLページごとにスピードバッジを表示するミドルウェア。本番環境でも開発環境でも動作するように設計されています。

特徴 ・データベースのプロファイリング - 現在、Mysql2、Postgres、Oracleoracle_enhanced ~> 1.5.0)、Mongoid3(ActiveRecordへのフォールバックをサポート)をサポートしています。 ・コールスタックプロファイリング - gemの使用時間を炎のグラフで表示します。 ・メモリプロファイリング - リクエストごとのメモリ使用量、GC スタット、グローバルアロケーションメトリクス

非表示方法

邪魔なので非表示にしたい。
参考のqiitaに記載されている方法もあるが、option + pで非表示にもできる。

参考

rack-mini-profilerの計測結果がWebページに表示しないようにする - Qiita

GitHub - MiniProfiler/rack-mini-profiler: Profiler for your development and production Ruby rack apps.