{"id":23386946,"url":"https://github.com/mbajur/inner_performance","last_synced_at":"2025-04-06T20:13:10.055Z","repository":{"id":264317050,"uuid":"893019231","full_name":"mbajur/inner_performance","owner":"mbajur","description":"Simple database-backed performance monitoring for your Rails app.","archived":false,"fork":false,"pushed_at":"2025-02-21T08:41:55.000Z","size":156,"stargazers_count":46,"open_issues_count":3,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-30T19:08:02.897Z","etag":null,"topics":["apm","performance-monitoring","rails"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mbajur.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-11-23T10:17:43.000Z","updated_at":"2025-02-21T08:41:59.000Z","dependencies_parsed_at":null,"dependency_job_id":"aac0b877-6944-49a4-bf7f-ffa7779b67d7","html_url":"https://github.com/mbajur/inner_performance","commit_stats":{"total_commits":34,"total_committers":3,"mean_commits":"11.333333333333334","dds":0.2941176470588235,"last_synced_commit":"353886495a88b35d5702987494e647542c1772f7"},"previous_names":["mbajur/inner_performance"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbajur%2Finner_performance","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbajur%2Finner_performance/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbajur%2Finner_performance/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mbajur%2Finner_performance/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mbajur","download_url":"https://codeload.github.com/mbajur/inner_performance/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543593,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apm","performance-monitoring","rails"],"created_at":"2024-12-22T01:13:54.398Z","updated_at":"2025-04-06T20:13:10.024Z","avatar_url":"https://github.com/mbajur.png","language":"Ruby","readme":"# ☯️ InnerPerformance [![Gem Version](https://badge.fury.io/rb/inner_performance.svg)](https://badge.fury.io/rb/inner_performance)\nSimple database-backed performance monitoring for your Rails app.\n\n\u003cimg width=\"1188\" alt=\"image\" src=\"https://github.com/user-attachments/assets/cb659c76-8139-4ee0-b683-d6acef227dc6\"\u003e\n\u003cimg width=\"1239\" alt=\"image\" src=\"https://github.com/user-attachments/assets/3d15f993-4575-4a5c-977c-5983d3af13c9\" /\u003e\n\n## Installation\nAdd `inner_performance` gem to your bundle\n\n```ruby\n$ bundle add inner_performance\n```\n\nInstall migrations\n\n```ruby\n$ rails inner_performance:install:migrations\n$ rails db:migrate\n```\n\nMount UI in `routes.rb` (don't forget to protect it!)\n\n```ruby\nmount InnerPerformance::Engine, at: '/inner_performance'\n```\n\n## Configuration\n\ninner_performance comes with some good defaults but in order to customize\nthem, you have a following options available:\n\n```ruby\nInnerPerformance.configure do |config|\n  config.sample_rates = {\n    # 2% of all the requests will be stored and analyzed. I would\n    # recommend keeping it low because otherwise your database will\n    # get full of events quite fast. It will also probably impact\n    # your app's performance. As an example: In a Spree shop with\n    # approx. 170 requests per minute, keeping it at default 2%\n    # provides me more than enough data to analyze and locate the\n    # bottlenecks. Value can be both decimal and integer.\n    'process_action.action_controller' =\u003e (Rails.env.production? ? 2 : 100),\n\n    # 100% of all the jobs will be stored and analyzed.\n    'perform.active_job' =\u003e 100\n  }\n\n  # For how long events should be stored. All the ones that exceeds\n  # this limit will be cleared out by InnerPerformance::CleanupJob.\n  config.events_retention = 1.week\n\n  # Used mostly by UI. Tells the UI what's the middle range when it\n  # comes to event duration. For the example below, all the durations\n  # between 0 and 200ms will be considered fast, all the ones between\n  # 200ms and 999ms will be considered medium and all above 999ms will\n  # be considered slow.\n  config.medium_duration_range = [200, 999]\n\n  # Set it to true to enable tracing of SQL queries and views rendering\n  config.traces_enabled = false\n\n  # Rules for ignoring an event. There are two rules applied by default:\n  # * sample_rates - operates on configured sample rate and drops events\n  #   which do not got lucky when drawing a random number\n  # * InnerPerformance job namespace - we don't want to save events for\n  #   the job that saves the events because that leeds to infinite loop.\n  #   Better not remove this rule as it will lead to stack overflow.\n  config.ignore_rules.unshift(\n    proc { |event| !event.is_a?(ActiveSupport::Notifications::Event) }\n  )\n\n  # Set it to true if you want to cleanup old events right after saving the event\n  config.cleanup_immediately = false\nend\n```\n\n## Regular Housekeeping\nTo ensure optimal performance and avoid data bloat, remember to schedule the cleanup job:\n\n```ruby\nInnerPerformance::CleanupJob.perform_later\n```\n\nAlternatively to scheduling the job yourself, you may utilize the configuration option `config.cleanup_immediately = true`. This configuration is not as optimal so its disabled by default.\n\n# Alternatives\n\n* [rails_performance](https://github.com/igorkasyanchuk/rails_performance) - much\nmore robust but depends on Redis. Operates on `ActiveSupport::LogSubscriber`\ninstead of `ActiveSupport::Notifications`\n\n## License\nThe gem is available as open source under the terms of the\n[MIT License](https://opensource.org/licenses/MIT).\n","funding_links":[],"categories":["Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbajur%2Finner_performance","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmbajur%2Finner_performance","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmbajur%2Finner_performance/lists"}