From 98473ed7e04da1da73e0240b39f418ac2690a910 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Thu, 19 Sep 2019 09:24:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95APM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 3 +++ Gemfile.lock | 2 ++ config/newrelic.yml | 45 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+) create mode 100644 config/newrelic.yml diff --git a/Gemfile b/Gemfile index 28df2328c..8c2425e40 100644 --- a/Gemfile +++ b/Gemfile @@ -96,3 +96,6 @@ gem 'searchkick' gem 'aasm' gem 'enumerize' + +# 性能监控 +gem 'newrelic_rpm' diff --git a/Gemfile.lock b/Gemfile.lock index 6a4a7e08f..9ea3504c9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -169,6 +169,7 @@ GEM multipart-post (2.0.0) mustermann (1.0.3) mysql2 (0.5.2) + newrelic_rpm (6.6.0.358) nio4r (2.3.1) nokogiri (1.8.4) mini_portile2 (~> 2.3.0) @@ -378,6 +379,7 @@ DEPENDENCIES kaminari (~> 1.1, >= 1.1.1) listen (>= 3.0.5, < 3.2) mysql2 (>= 0.4.4, < 0.6.0) + newrelic_rpm oauth2 pdfkit puma (~> 3.11) diff --git a/config/newrelic.yml b/config/newrelic.yml new file mode 100644 index 000000000..175de6f73 --- /dev/null +++ b/config/newrelic.yml @@ -0,0 +1,45 @@ +# +# This file configures the New Relic Agent. New Relic monitors Ruby, Java, +# .NET, PHP, Python, Node, and Go applications with deep visibility and low +# overhead. For more information, visit www.newrelic.com. +# +# Generated September 19, 2019 +# +# This configuration file is custom generated for educoder_1 +# +# For full documentation of agent configuration options, please refer to +# https://docs.newrelic.com/docs/agents/ruby-agent/installation-configuration/ruby-agent-configuration + +common: &default_settings + # Required license key associated with your New Relic account. + license_key: e546e66be1c6d1bab2bbdd97e7bd8ef239b7e9cf + + # Your application name. Renaming here affects where data displays in New + # Relic. For more details, see https://docs.newrelic.com/docs/apm/new-relic-apm/maintenance/renaming-applications + app_name: Educoder_test + + # To disable the agent regardless of other settings, uncomment the following: + # agent_enabled: false + + # Logging level for log/newrelic_agent.log + log_level: error + + +# Environment-specific settings are in this section. +# RAILS_ENV or RACK_ENV (as appropriate) is used to determine the environment. +# If your application has other named environments, configure them here. +development: + <<: *default_settings + app_name: Educoder_test + +test: + <<: *default_settings + # It doesn't make sense to report to New Relic from automated test runs. + monitor_mode: false + +staging: + <<: *default_settings + app_name: Educoder_test + +production: + <<: *default_settings