{"id":20980686,"url":"https://github.com/statful/statful-client-ruby-aop","last_synced_at":"2025-05-14T15:30:49.676Z","repository":{"id":59156385,"uuid":"68224024","full_name":"statful/statful-client-ruby-aop","owner":"statful","description":"Statful client for Ruby applications using Aspect-Oriented Programming.","archived":false,"fork":false,"pushed_at":"2016-10-17T11:29:56.000Z","size":8,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-24T09:43:54.941Z","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/statful.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-09-14T16:37:39.000Z","updated_at":"2016-11-15T22:35:20.000Z","dependencies_parsed_at":"2022-09-13T20:10:53.253Z","dependency_job_id":null,"html_url":"https://github.com/statful/statful-client-ruby-aop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-client-ruby-aop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-client-ruby-aop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-client-ruby-aop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/statful%2Fstatful-client-ruby-aop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/statful","download_url":"https://codeload.github.com/statful/statful-client-ruby-aop/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254171591,"owners_count":22026469,"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-11-19T05:29:37.298Z","updated_at":"2025-05-14T15:30:48.287Z","avatar_url":"https://github.com/statful.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Statful client for Ruby applications using Aspect-Oriented Programming\n==============\n\nStatful client for Ruby applications using Aspect-Oriented Programming.\n\n[![Build Status](https://travis-ci.org/statful/statful-client-ruby-aop.svg?branch=master)](https://travis-ci.org/statful/statful-client-ruby-aop)\n[![Gem Version](https://badge.fury.io/rb/statful-client-aop.svg)](https://badge.fury.io/rb/statful-client-aop)\n\nStaful client for Ruby usgin AOP. This client is intended to gather metrics and send them to Statful.\n\n## Table of Contents\n\n* [Supported Versions of Ruby](#supported-versions-of-ruby)\n* [Installation](#installation)\n* [Quick Start](#quick-start)\n* [Examples](#examples)\n* [Reference](#reference)\n* [Development](#development)\n* [Authors](#authors)\n* [License](#license)\n\n## Supported Versions of Ruby\n\n| Tested Ruby versions  |\n|:---|\n|  `2.1.8`, `2.2.4`, `2.3.0` |\n\n## Installation\n\n```bash\n$ gem install statful-client-aop\n```\n\n## Quick start\n\nThis gem requires a valid initialized statful client - refer to the [documentation](https://github.com/statful/statful-client-ruby) on how to do it.\n\n```ruby\nrequire 'statful-client-aop'\n\nconfig = {\n  :transport =\u003e 'http',\n  :token =\u003e 'test_token',\n}\n\nstatful = StatfulClient.new(config)\nstatful_aspects = StatfulAspects.new(statful)\n```\n\n## Examples\n\n### Annotate method with a timer\n\nCreates a simple client configuration and use it to send some metrics.\n\n```ruby\n# consider statful_aspects is an instance of the previously created StatfulAspects\n\nclass MyClass\n  # measure how long my_method takes to execute in ms\n  # save it as a metric timer called 'execution' with a custom tag\n  statful_aspects.timer(self, 'my_method', 'execution', { :tags =\u003e {:host =\u003e 'test_host', :status =\u003e 'SUCCESS' } })\n  def my_method\n    # do stuff\n  end\nend\n```\n\n## Reference\n\nDetailed reference if you want to take full advantage from Statful.\n\n### Global configuration\n\nThe custom options that can be set on config param are detailed below.\n\n| Option | Description | Type | Default | Required |\n|:---|:---|:---|:---|:---|\n| _statful_ | Initialized Statful client to be used on annotations. | `Object` | **none** | **YES** |\n\n### Timer\n\n```ruby\n- staful_aspects.timer(myClass, 'my_method', 'my_metric_name', { :namespace =\u003e 'sandbox' });\n```\n\nArguments for the `timer` method are much like the `timer` method from the Ruby client with the exceptions:\n\n* the first argument is the class [`Object`] of the method to be annotated\n* the second argument is the name [`String`] of the method to be annotated\n* not possible to set a value for the timer\n\n## Development\n\n### Dependencies\n\nUse bundle to install all dev dependencies:\n\n```\n$ bundle install\n```\n\n### Tests\n\nIt uses [rspec](http://rspec.info/) and [minitest](http://docs.seattlerb.org/minitest/) to specify the unit tests suite.\n\nThere's a rake task which runs the specs:\n\n```\n$ rake spec\n```\n\n### Build\n\nUse gem to build a gem according to the spec if required:\n\n```\n$ gem build statful-client-aop.gemspec\n```\n\n### Docs\n\nIt uses [yard](http://yardoc.org/) to generate documentation.\n\nThere's a rake task which generates the doc directory with the output:\n\n```\n$ rake yard\n```\n\n## Authors\n\n[Mindera - Software Craft](https://github.com/Mindera)\n\n## License\n\nStatful Client For Ruby using AOP is available under the MIT license. See the [LICENSE](https://raw.githubusercontent.com/statful/statful-client-ruby/master/LICENSE) file for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-client-ruby-aop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstatful%2Fstatful-client-ruby-aop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstatful%2Fstatful-client-ruby-aop/lists"}