{"id":16643454,"url":"https://github.com/sonots/mysql2-metrics","last_synced_at":"2026-04-22T11:04:54.189Z","repository":{"id":22711969,"uuid":"26056183","full_name":"sonots/mysql2-metrics","owner":"sonots","description":"Instrument mysql2 queries","archived":false,"fork":false,"pushed_at":"2014-11-11T07:50:20.000Z","size":156,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-04-03T10:41:42.634Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/sonots.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-01T16:36:16.000Z","updated_at":"2015-09-16T00:28:33.000Z","dependencies_parsed_at":"2022-08-20T13:10:53.729Z","dependency_job_id":null,"html_url":"https://github.com/sonots/mysql2-metrics","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/sonots/mysql2-metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Fmysql2-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Fmysql2-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Fmysql2-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Fmysql2-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sonots","download_url":"https://codeload.github.com/sonots/mysql2-metrics/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sonots%2Fmysql2-metrics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32132975,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T08:34:57.708Z","status":"ssl_error","status_checked_at":"2026-04-22T08:34:55.583Z","response_time":58,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-10-12T08:08:38.125Z","updated_at":"2026-04-22T11:04:51.030Z","avatar_url":"https://github.com/sonots.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mysql2::Metrics\n\nInstrument mysql2 queries.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'mysql2-metrics'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install mysql2-metrics\n\n## Usage\n\nJust require `mysql2/metrics` in addition to `mysql2`, ans use mysql2 as usual. \n\n```ruby\nrequire 'mysql2'\nrequire 'mysql2-metrics'\n\nclient = Mysql2::Client.new(:host =\u003e \"localhost\", :username =\u003e \"root\", :database =\u003e \"test\")\nresults = client.query(\"CREATE TABLE IF NOT EXISTS test (id INT)\")\n```\n\nThis will output a measured time to STDOUT as:\n\n```\ntime:2014-11-02T01:38:25+09:00  query:CREATE TABLE IF NOT EXISTS test (id INT)  elapsed:0.000299591\n```\n\nwhere `elapsed` is the elapsed time in second. \n\n## ToDo\n\n* write tests\n* output to a file path\n\n## Contributing\n\n1. Fork it ( https://github.com/sonots/mysql2-metrics/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonots%2Fmysql2-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsonots%2Fmysql2-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsonots%2Fmysql2-metrics/lists"}