{"id":13484434,"url":"https://github.com/codemancers/rbkit","last_synced_at":"2025-04-06T03:08:21.737Z","repository":{"id":137623632,"uuid":"18526721","full_name":"codemancers/rbkit","owner":"codemancers","description":"A new profiler for Ruby. With a GUI","archived":false,"fork":false,"pushed_at":"2023-08-29T03:57:11.000Z","size":363,"stargazers_count":355,"open_issues_count":19,"forks_count":11,"subscribers_count":30,"default_branch":"master","last_synced_at":"2025-03-30T02:05:15.756Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://rbkit.c9s.dev/","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/codemancers.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-04-07T17:40:54.000Z","updated_at":"2025-03-14T23:58:18.000Z","dependencies_parsed_at":null,"dependency_job_id":"bb625b80-05f9-4fb8-b362-09026538fcc3","html_url":"https://github.com/codemancers/rbkit","commit_stats":null,"previous_names":["codemancers/rbkit"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemancers%2Frbkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemancers%2Frbkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemancers%2Frbkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/codemancers%2Frbkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/codemancers","download_url":"https://codeload.github.com/codemancers/rbkit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"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":[],"created_at":"2024-07-31T17:01:24.374Z","updated_at":"2025-04-06T03:08:21.697Z","avatar_url":"https://github.com/codemancers.png","language":"Ruby","readme":"\u003cimg src=\"./logo.png\" height=\"30px\" /\u003e Rbkit\n============================================\n\n## [WARNING]\nThis project is not maintained at the moment. We have plans to work on a universal profiling protocol after which we intend to rewrite major parts of Rbkit.\n\n[![Join the chat at https://gitter.im/code-mancers/rbkit](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/code-mancers/rbkit?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n\n[![Gem Version](https://badge.fury.io/rb/rbkit.svg)](http://badge.fury.io/rb/rbkit)\n[![Build Status](https://travis-ci.org/code-mancers/rbkit.svg?branch=tests)](https://travis-ci.org/code-mancers/rbkit)\n\n`rbkit` is a Ruby gem that plugs into your ruby process, taps profiling data\nin realtime and sends it across the wire to the [rbkit-client](https://github.com/code-mancers/rbkit-client)\nas packed messages.\n\n## Usage\n\n#### Install prerequisites\n\nRbkit requires the following executables to be present :\n\n* libtool\n* autoconf\n* automake\n\nInstall these with your operating system's package manager before proceeding\nto install Rbkit gem.\n\n#### Add `rbkit` to Gemfile\n\nAdd the following to the project's Gemfiles\n\n```\ngem 'rbkit', path: \u003cRBKIT_PATH\u003e\n```\n\n\nand run `bundle install`\n\n#### Installation without Rubygems\n\nYou can also install `rbkit` without bundler/rubygems. This can\nbe useful, if you are profiling a Ruby app where you want to measure\noverhead of Rubygems/Bundler.\n\nJust clone the repository or download from a release tag and run:\n\n```\n# Run from root of rbkit directory.\n~\u003e ruby setup.rb\n```\n\nThis should install `rbkit`\nin ruby's `site_dir` and then you don't need `rbkit` added to your\n`Gemfile` for requiring `rbkit`.\n\n#### Inject `rbkit` into code\n\nWherever you want to start profiling, add the following :\n\n```ruby\nrequire 'rbkit' # Not needed in Rails\nRbkit.start_server\n```\n\nIf using Rails, and you want to measure everything from the boot process,\na good place to put this would be at the end of `config/boot.rb`.\n\n## Rbkit API\n\n### Rbkit.start_server\n\nWithout any arguments, it's same as :\n```ruby\nRbkit.start_server(pub_port: nil, request_port: nil)\n```\n\nStarts the Rbkit server and waits for a client to connect and issue\ncommands to the request_port, until then there's zero performance overhead.\nProfiling data is sent asynchronously over pub_port.\nThis method can be called early in a ruby application so that\nwhenever profiling needs to be done, the client can attach itself to the\ninactive server, do the profiling and leave. Returns an instance of\n`Rbkit::Server` if server was started successfully, else returns false.\n\n\n|argument      | valid values | default value | description                                       |\n|--------------|--------------|---------------|---------------------------------------------------|\n|pub_port      | nil, fixnum  | nil           | Override default message publishing port of 5555  |\n|request_port  | nil, fixnum  | nil           | Override default command listener port of 5556    |\n\n\n### Rbkit.start_profiling\n\nWithout any arguments, it's same as :\n```ruby\nRbkit.start_profiling(\n  pub_port: nil,\n  request_port: nil,\n  enable_object_trace: true,\n  enable_gc_stats: true,\n  enable_cpu_profiling: true,\n  clock_type: :wall,\n  cpu_profiling_mode: :sampling,\n  cpu_sampling_interval_usec: 1000\n)\n```\n\nStarts the server with all tracepoints enabled by default. User can\noptionally disable tracepoints using the optional arguments.\nThis method can be used to profile the startup process of a ruby\napplication where sending commands from the client to enable\nprofiling is not feasible. Returns an instance of `Rbkit::Server`\nif server was started successfully, else returns false.\n\nArguments:\n\n|argument                   | valid values | default value | description                                      |\n|---------------------------|--------------|---------------|--------------------------------------------------|\n|pub_port                   | nil, fixnum  | nil           | Override default message publishing port of 5555 |\n|request_port               | nil, fixnum  | nil           | Override default command listener port of 5556   |\n|enable_object_trace        | true/false   | true          | Enables object creation/deletion events          |\n|enable_gc_stats            | true/false   | true          | Enables GC stats which is sent every 5 seconds   |\n|enable_cpu_profiling       | true/false   | true          | Enables CPU profiling                            |\n|clock_type                 | :wall/:cpu   | :wall         | Specifies clock type to use in CPU profiling     |\n|cpu_profiling_mode         | :sampling    | :sampling     | CPU profiling mode - currently only sampling     |\n|cpu_sampling_interval_usec | Fixnums      | 1000          | CPU Sampling interval un usec, if sampling mode  |\n\n\n## Development\n\n#### Install zmq and msgpack\n\nIf zmq and msgpack are not installed, Rbkit automatically downloads\nand installs the two libraries from source during gem installation.\nBut if you are developing Rbkit, it makes sense to have these\npreinstalled:\n\nOn OSX - Using `homebrew` following command should suffice:\n\n```\n~\u003e brew install zeromq\n~\u003e brew install msgpack\n```\n\nOn Linux - we recommend to download these libraries\nfrom their respective home pages and manually compiling\nand installing.\n\nRecommended versions are:\n\nZeromq: 4.0.5_2\nMsgpack: 0.5.9\n\n#### Clone the repo\n\n`git clone git@github.com:code-mancers/rbkit.git`\n\nWe'll call this `\u003cRBKIT_PATH\u003e`.\n\n#### Set RBKIT_DEV environment flag\n\nSet the environment variable `RBKIT_DEV` to true.\nIf using bash, put `export RBKIT_DEV=true` in your `~/.bashrc`.\n\nThis compiles the C extension with debug flag and also sets a macro named\n`RBKIT_DEV` inside the C extension.\n\n#### Compile the C extension\n\nTwo ways to do this :\n\n##### Using rake\n\n```\ncd \u003cRBKIT_PATH\u003e\nbundle install\nbundle exec rake compile\n\n```\n\n##### Or do it manually\n\n```\ncd \u003cRBKIT_PATH/ext\u003e\nruby extconf.rb\nmake\n# Create a symlink at `lib/rbkit_server.bundle` (or .so if on linux)\n# that points to `ext/rbkit_server.bundle`\n# (in order to use `rbkit` gem in Gemfiles using `path` option)\n```\n\n#### Run the tests\n\n```\nbundle exec rake\n```\n\n## TODO\n\nTODOs are tracked as github issues.\n","funding_links":[],"categories":["Profiler and Optimization","Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemancers%2Frbkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcodemancers%2Frbkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcodemancers%2Frbkit/lists"}