{"id":27598133,"url":"https://github.com/goyalmunish/request_response_stats","last_synced_at":"2025-08-25T19:07:19.778Z","repository":{"id":56891858,"uuid":"112044788","full_name":"goyalmunish/request_response_stats","owner":"goyalmunish","description":"A Ruby gem which captures request response statistics such as cycle time, memory allocation, etc. for each request response cycle grouped in configurable granularity level. As this library makes use of TCP protocol, using DataDog or NewRelic RPM would be way faster because of UDP protocol.","archived":false,"fork":false,"pushed_at":"2017-12-23T03:16:32.000Z","size":66,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-28T12:46:41.730Z","etag":null,"topics":["mongo","performance-monitoring","profiling","rails","redis","request","request-response","request-response-cycle","request-response-processing","request-response-stats","response","response-time","ruby","stats"],"latest_commit_sha":null,"homepage":"https://rubygems.org/gems/request_response_stats","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/goyalmunish.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-26T00:36:07.000Z","updated_at":"2025-02-02T08:13:05.000Z","dependencies_parsed_at":"2022-08-20T16:00:54.386Z","dependency_job_id":null,"html_url":"https://github.com/goyalmunish/request_response_stats","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/goyalmunish/request_response_stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goyalmunish%2Frequest_response_stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goyalmunish%2Frequest_response_stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goyalmunish%2Frequest_response_stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goyalmunish%2Frequest_response_stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goyalmunish","download_url":"https://codeload.github.com/goyalmunish/request_response_stats/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goyalmunish%2Frequest_response_stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272116988,"owners_count":24876299,"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","status":"online","status_checked_at":"2025-08-25T02:00:12.092Z","response_time":1107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["mongo","performance-monitoring","profiling","rails","redis","request","request-response","request-response-cycle","request-response-processing","request-response-stats","response","response-time","ruby","stats"],"created_at":"2025-04-22T14:12:19.142Z","updated_at":"2025-08-25T19:07:19.753Z","avatar_url":"https://github.com/goyalmunish.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\n**Table of Contents**  *generated with [DocToc](https://github.com/thlorenz/doctoc)*\n\n- [RequestResponseStats](#requestresponsestats)\n  - [Prerequisites](#prerequisites)\n  - [Installation and Setup](#installation-and-setup)\n  - [Usage](#usage)\n    - [Documentation References](#documentation-references)\n    - [Checking current data in redis](#checking-current-data-in-redis)\n    - [Manually moving data from Redis to Mongo](#manually-moving-data-from-redis-to-mongo)\n    - [Deleting data from Redis and Mongo](#deleting-data-from-redis-and-mongo)\n    - [Getting stats from Mongo](#getting-stats-from-mongo)\n  - [Development](#development)\n  - [Contributing](#contributing)\n  - [License](#license)\n  - [Code of Conduct](#code-of-conduct)\n\n\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\n\n# RequestResponseStats\n\n[![Gem Version](https://badge.fury.io/rb/request_response_stats.svg)](https://badge.fury.io/rb/request_response_stats)\n[![Build Status](https://travis-ci.org/goyalmunish/request_response_stats.svg?branch=master)](https://travis-ci.org/goyalmunish/request_response_stats)\n[![codecov](https://codecov.io/gh/goyalmunish/request_response_stats/branch/master/graph/badge.svg)](https://codecov.io/gh/goyalmunish/request_response_stats)\n[![Maintainability](https://api.codeclimate.com/v1/badges/0c231c47679470213426/maintainability)](https://codeclimate.com/github/goyalmunish/request_response_stats/maintainability)\n[![Inline docs](http://inch-ci.org/github/goyalmunish/request_response_stats.svg?branch=master)](http://inch-ci.org/github/goyalmunish/request_response_stats)\n\n## Prerequisites\n\nThe gem uses [Redis](https://github.com/redis/redis-rb) as a temporary storage to store the captured stats data. For permanent storage of this data, [MongoDB](https://github.com/mongodb/mongoid) is being used.\n\nYou can pass your redis connection (by default, it is assumed to be available through `$redis`) and mongoid_doc_model (by default, it is named `ReqResStat`) through `RequestResponseStats::RequestResponse.new`.\n\n## Installation and Setup\n\nAdd gem to your application's Gemfile:\n\n```ruby\ngem 'request_response_stats'\n```\n\nAnd then execute:\n\n```bash\n$ bundle install\n```\n\nOr install it separately as:\n\n```bash\n$ gem install request_response_stats\n```\n\nInclude `RequestResponseStats::ControllerConcern` to the controller whose request response stats are to be captured. For example,\n\n```ruby\nclass ApplicationController \u003c ActionController::Base\n  include RequestResponseStats::ControllerConcern\n  # rest of the code\nend\n```\n\nGenerate customization files:\n\n```ruby\n$ rails g request_response_stats:customization\n```\n\nConfigure `config/initializers/request_response_stat_config.rb` as per your requirement.\n\n## Usage\n\n### Documentation References\n\nReference to Ruby docs: http://www.rubydoc.info/gems/request_response_stats/\n\nBut, you can get better documentation by running tests :wink:. Refer: https://travis-ci.org/goyalmunish/request_response_stats.\n\n### Checking current data in redis\n\n```ruby\n# include RequestResponseStats\nrrs = RequestResponse.new(nil, nil)\nrrs.redis_record.all_keys\nrrs.redis_record.all_keys(support: true)\n# [\n#   [ 0] \"api_req_res_SUPPORT_Munishs-MacBook-Pro.local_Munishs-MacBook-Pro.local_memory\",\n#   [ 1] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words_GET_2017-12-03-0202\",\n#   [ 2] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words_GET_2017-12-03-0200\",\n#   [ 3] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/6/ajax_promote_flag_GET_2017-12-03-0200\",\n#   [ 4] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/5/ajax_promote_flag_GET_2017-12-03-0200\",\n#   [ 5] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/4_GET_2017-12-03-0200\",\n#   [ 6] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/3_GET_2017-12-03-0202\",\n#   [ 7] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/3_GET_2017-12-03-0200\",\n#   [ 8] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/2_GET_2017-12-03-0200\",\n#   [ 9] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/1/ajax_promote_flag_GET_2017-12-03-0202\",\n#   [10] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/users_GET_2017-12-03-0205\",\n#   [11] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/users_GET_2017-12-03-0202\",\n#   [12] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/users_GET_2017-12-03-0201\",\n#   [13] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/generals/2_GET_2017-12-03-0205\",\n#   [14] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/flags_GET_2017-12-03-0202\",\n#   [15] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/dictionaries_GET_2017-12-03-0201\",\n#   [16] \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/admins/1_GET_2017-12-03-0201\"\n# ]\nrrs.redis_record.all_keys.size\n# 16\nrrs.redis_record.hashify_all_data\n```\n\nExample on how data within each key looks like:\n\n```ruby\nrrs.redis_record.hashify_all_data[\"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/1/ajax_promote_flag_GET_2017-12-03-0202\"]\n# =\u003e\n{\n              \"key_name\" =\u003e \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/1/ajax_promote_flag_GET_2017-12-03-0202\",\n           \"server_name\" =\u003e \"Munishs-MacBook-Pro.local\",\n              \"api_name\" =\u003e \"/words/1/ajax_promote_flag\",\n              \"api_verb\" =\u003e \"GET\",\n        \"api_controller\" =\u003e \"words\",\n            \"api_action\" =\u003e \"ajax_promote_flag\",\n         \"request_count\" =\u003e 3,\n              \"min_time\" =\u003e 0.06,\n              \"max_time\" =\u003e 0.095,\n              \"avg_time\" =\u003e 0.075,\n            \"start_time\" =\u003e \"2017-12-03 03:22:00 UTC\",\n              \"end_time\" =\u003e \"2017-12-03 03:23:00 UTC\",\n           \"error_count\" =\u003e 0,\n    \"min_used_memory_MB\" =\u003e 0,\n    \"max_used_memory_MB\" =\u003e 0,\n    \"avg_used_memory_MB\" =\u003e 0,\n    \"min_swap_memory_MB\" =\u003e 0,\n    \"max_swap_memory_MB\" =\u003e 0,\n    \"avg_swap_memory_MB\" =\u003e 0,\n      \"avg_gc_stat_diff\" =\u003e {\n                                          \"count\" =\u003e 0,\n                           \"heap_allocated_pages\" =\u003e 0,\n                             \"heap_sorted_length\" =\u003e 0,\n                         \"heap_allocatable_pages\" =\u003e 0,\n                           \"heap_available_slots\" =\u003e 0,\n                                \"heap_live_slots\" =\u003e -1212,\n                                \"heap_free_slots\" =\u003e -106,\n                               \"heap_final_slots\" =\u003e 0,\n                              \"heap_marked_slots\" =\u003e -1563,\n                               \"heap_swept_slots\" =\u003e -91636,\n                                \"heap_eden_pages\" =\u003e -3,\n                                \"heap_tomb_pages\" =\u003e 0,\n                          \"total_allocated_pages\" =\u003e 0,\n                              \"total_freed_pages\" =\u003e 0,\n                        \"total_allocated_objects\" =\u003e 12121,\n                            \"total_freed_objects\" =\u003e 12025,\n                          \"malloc_increase_bytes\" =\u003e 178165,\n                    \"malloc_increase_bytes_limit\" =\u003e -186507,\n                                 \"minor_gc_count\" =\u003e 0,\n                                 \"major_gc_count\" =\u003e 0,\n              \"remembered_wb_unprotected_objects\" =\u003e 0,\n        \"remembered_wb_unprotected_objects_limit\" =\u003e 0,\n                                    \"old_objects\" =\u003e 0,\n                              \"old_objects_limit\" =\u003e 0,\n                       \"oldmalloc_increase_bytes\" =\u003e -134054,\n                 \"oldmalloc_increase_bytes_limit\" =\u003e 0\n    },\n      \"min_gc_stat_diff\" =\u003e {\n                                          \"count\" =\u003e 0,\n                           \"heap_allocated_pages\" =\u003e 0,\n                             \"heap_sorted_length\" =\u003e 0,\n                         \"heap_allocatable_pages\" =\u003e 0,\n                           \"heap_available_slots\" =\u003e 0,\n                                \"heap_live_slots\" =\u003e -3846,\n                                \"heap_free_slots\" =\u003e -106,\n                               \"heap_final_slots\" =\u003e 0,\n                              \"heap_marked_slots\" =\u003e -4688,\n                               \"heap_swept_slots\" =\u003e -300588,\n                                \"heap_eden_pages\" =\u003e -9,\n                                \"heap_tomb_pages\" =\u003e 0,\n                          \"total_allocated_pages\" =\u003e 0,\n                              \"total_freed_pages\" =\u003e 0,\n                        \"total_allocated_objects\" =\u003e 10513,\n                            \"total_freed_objects\" =\u003e 10437,\n                          \"malloc_increase_bytes\" =\u003e -324416,\n                    \"malloc_increase_bytes_limit\" =\u003e -559519,\n                                 \"minor_gc_count\" =\u003e 0,\n                                 \"major_gc_count\" =\u003e 0,\n              \"remembered_wb_unprotected_objects\" =\u003e 0,\n        \"remembered_wb_unprotected_objects_limit\" =\u003e 0,\n                                    \"old_objects\" =\u003e 0,\n                              \"old_objects_limit\" =\u003e 0,\n                       \"oldmalloc_increase_bytes\" =\u003e -1261072,\n                 \"oldmalloc_increase_bytes_limit\" =\u003e 0\n    },\n      \"max_gc_stat_diff\" =\u003e {\n                                          \"count\" =\u003e 0,\n                           \"heap_allocated_pages\" =\u003e 0,\n                             \"heap_sorted_length\" =\u003e 0,\n                         \"heap_allocatable_pages\" =\u003e 0,\n                           \"heap_available_slots\" =\u003e 0,\n                                \"heap_live_slots\" =\u003e 106,\n                                \"heap_free_slots\" =\u003e -106,\n                               \"heap_final_slots\" =\u003e 0,\n                              \"heap_marked_slots\" =\u003e 0,\n                               \"heap_swept_slots\" =\u003e 12840,\n                                \"heap_eden_pages\" =\u003e 0,\n                                \"heap_tomb_pages\" =\u003e 0,\n                          \"total_allocated_pages\" =\u003e 0,\n                              \"total_freed_pages\" =\u003e 0,\n                        \"total_allocated_objects\" =\u003e 12925,\n                            \"total_freed_objects\" =\u003e 12819,\n                          \"malloc_increase_bytes\" =\u003e 429456,\n                    \"malloc_increase_bytes_limit\" =\u003e 0,\n                                 \"minor_gc_count\" =\u003e 0,\n                                 \"major_gc_count\" =\u003e 0,\n              \"remembered_wb_unprotected_objects\" =\u003e 0,\n        \"remembered_wb_unprotected_objects_limit\" =\u003e 0,\n                                    \"old_objects\" =\u003e 0,\n                              \"old_objects_limit\" =\u003e 0,\n                       \"oldmalloc_increase_bytes\" =\u003e 429456,\n                 \"oldmalloc_increase_bytes_limit\" =\u003e 0\n    }\n}\n```\n\nThe gem uses [free](https://linux.die.net/man/1/free) command to capture memory information of the server. If this command is not available (such as on Mac), then zeros are reported, as you can see in memory keys (keys ending with `memory_MB`) in the above example.\n\nThe last part of the key (such as `0202` in the above key) represents slot within a day. By default, `GROUP_STATS_BY_TIME_DURATION` is set as `1.minute`, so there are `24*60` slots in a day. You can easily configure these settings by overriding these configurations in`request_response_stats_config.rb`.\n\nThe `request_count` key, within data of a single key, gives the number of requests received for a given endpoint in a given timeslot.\n\nFor example, consider the key `\"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/1/ajax_promote_flag_GET_2017-12-03-0202\"`:\n\n```ruby\nrrs.redis_record.get_slot_range_for_key \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words/1/ajax_promote_flag_GET_2017-12-03-0202\"\n# =\u003e\n[\n    [0] 2017-12-03 03:22:00 UTC,\n    [1] 2017-12-03 03:23:00 UTC\n]\n```\n\nThis means that the server `Munishs-MacBook-Pro.local` received `3` (as reported by `request_count`) `GET` requests in between `2017-12-03 03:22:00 UTC` and `2017-12-03 03:23:00 UTC` for the endpoint `/words/1/ajax_promote_flag`.\n\n### Manually moving data from Redis to Mongo\n\nMoving only request_response_stats specific, freezed, non-support (that is `{support: false}`) keys from Redis to Mongo:\n\n```ruby\nrrs.move_data_from_redis_to_mongo  # =\u003e 16\n```\n\nNote: Make use of `lib/tasks/move_req_res_cycle_data_from_redis_to_mongo.rake` to schedule this task using cron.\n\n### Deleting data from Redis and Mongo\n\n```ruby\nrrs.redis_record.all_keys.each{|k| rrs.redis_record.del k}\nReqResStat.all.delete_all\n```\n\n### Getting stats from Mongo\n\n```ruby\nReqResStat.all.size  # =\u003e 16\nReqResStat.all.first\n# =\u003e #\u003cRequestResponseStats::ReqResStat _id: 5a237d55af9080aa7890a968, key_name: \"api_req_res_PUBLIC_Munishs-MacBook-Pro.local_/words_GET_2017-12-03-0202\", server_name: \"Munishs-MacBook-Pro.local\", api_name: \"/words\", api_verb: \"GET\", api_controller: \"words\", api_action: \"index\", request_count: 2, min_time: 2.392, max_time: 2.518, avg_time: 2.455, start_time: 2017-12-03 03:22:00 UTC, end_time: 2017-12-03 03:23:00 UTC, error_count: 0, min_used_memory_MB: 0, max_used_memory_MB: 0, avg_used_memory_MB: 0, min_swap_memory_MB: 0, max_swap_memory_MB: 0, avg_swap_memory_MB: 0, avg_gc_stat_diff: {\"count\"=\u003e2, \"heap_allocated_pages\"=\u003e0, \"heap_sorted_length\"=\u003e0, \"heap_allocatable_pages\"=\u003e0, \"heap_available_slots\"=\u003e0, \"heap_live_slots\"=\u003e-84476, \"heap_free_slots\"=\u003e41108, \"heap_final_slots\"=\u003e0, \"heap_marked_slots\"=\u003e30927, \"heap_swept_slots\"=\u003e76787, \"heap_eden_pages\"=\u003e11, \"heap_tomb_pages\"=\u003e-16, \"total_allocated_pages\"=\u003e0, \"total_freed_pages\"=\u003e0, \"total_allocated_objects\"=\u003e687446, \"total_freed_objects\"=\u003e732295, \"malloc_increase_bytes\"=\u003e-517200, \"malloc_increase_bytes_limit\"=\u003e-1131380, \"minor_gc_count\"=\u003e2, \"major_gc_count\"=\u003e0, \"remembered_wb_unprotected_objects\"=\u003e2595, \"remembered_wb_unprotected_objects_limit\"=\u003e0, \"old_objects\"=\u003e21045, \"old_objects_limit\"=\u003e0, \"oldmalloc_increase_bytes\"=\u003e-4731008, \"oldmalloc_increase_bytes_limit\"=\u003e0}, min_gc_stat_diff: {\"count\"=\u003e2, \"heap_allocated_pages\"=\u003e0, \"heap_sorted_length\"=\u003e0, \"heap_allocatable_pages\"=\u003e0, \"heap_available_slots\"=\u003e0, \"heap_live_slots\"=\u003e-84476, \"heap_free_slots\"=\u003e-2260, \"heap_final_slots\"=\u003e0, \"heap_marked_slots\"=\u003e30927, \"heap_swept_slots\"=\u003e7213, \"heap_eden_pages\"=\u003e6, \"heap_tomb_pages\"=\u003e-16, \"total_allocated_pages\"=\u003e0, \"total_freed_pages\"=\u003e0, \"total_allocated_objects\"=\u003e687446, \"total_freed_objects\"=\u003e692668, \"malloc_increase_bytes\"=\u003e-517200, \"malloc_increase_bytes_limit\"=\u003e-1177069, \"minor_gc_count\"=\u003e2, \"major_gc_count\"=\u003e0, \"remembered_wb_unprotected_objects\"=\u003e2329, \"remembered_wb_unprotected_objects_limit\"=\u003e0, \"old_objects\"=\u003e21045, \"old_objects_limit\"=\u003e0, \"oldmalloc_increase_bytes\"=\u003e-4731008, \"oldmalloc_increase_bytes_limit\"=\u003e0}, max_gc_stat_diff: {\"count\"=\u003e2, \"heap_allocated_pages\"=\u003e0, \"heap_sorted_length\"=\u003e0, \"heap_allocatable_pages\"=\u003e0, \"heap_available_slots\"=\u003e0, \"heap_live_slots\"=\u003e-84476, \"heap_free_slots\"=\u003e84476, \"heap_final_slots\"=\u003e0, \"heap_marked_slots\"=\u003e30927, \"heap_swept_slots\"=\u003e146361, \"heap_eden_pages\"=\u003e16, \"heap_tomb_pages\"=\u003e-16, \"total_allocated_pages\"=\u003e0, \"total_freed_pages\"=\u003e0, \"total_allocated_objects\"=\u003e687446, \"total_freed_objects\"=\u003e771922, \"malloc_increase_bytes\"=\u003e-517200, \"malloc_increase_bytes_limit\"=\u003e-1085691, \"minor_gc_count\"=\u003e2, \"major_gc_count\"=\u003e0, \"remembered_wb_unprotected_objects\"=\u003e2862, \"remembered_wb_unprotected_objects_limit\"=\u003e0, \"old_objects\"=\u003e21045, \"old_objects_limit\"=\u003e0, \"oldmalloc_increase_bytes\"=\u003e-4731008, \"oldmalloc_increase_bytes_limit\"=\u003e0}\u003e\nt = Time.now\nReqResStat.get_max(:max_time, t - 2.day, t, 6.hours).map{|r| r[:data]}\n# =\u003e [nil, nil, nil, nil, nil, nil, nil, 3.96]\nReqResStat.get_avg(:avg_time, t - 2.day, t, 6.hours).map{|r| r[:data]}\n#  =\u003e [0, 0, 0, 0, 0, 0, 0, 0.72]\nReqResStat.get_max(:min_time, t - 2.day, t, 6.hours).map{|r| r[:data]}\nReqResStat.get_details(:max_time, t - 2.day, t, nil, 6.hours)\n# =\u003e\n[\n    [0] {\n              :data =\u003e {},\n        :start_time =\u003e 2017-12-01 04:33:38 UTC,\n          :end_time =\u003e 2017-12-01 10:33:38 UTC\n    },\n    [1] {\n              :data =\u003e {},\n        :start_time =\u003e 2017-12-01 10:33:38 UTC,\n          :end_time =\u003e 2017-12-01 16:33:38 UTC\n    },\n    [2] {\n              :data =\u003e {},\n        :start_time =\u003e 2017-12-01 16:33:38 UTC,\n          :end_time =\u003e 2017-12-01 22:33:38 UTC\n    },\n    [3] {\n              :data =\u003e {},\n        :start_time =\u003e 2017-12-01 22:33:38 UTC,\n          :end_time =\u003e 2017-12-02 04:33:38 UTC\n    },\n    [4] {\n              :data =\u003e {},\n        :start_time =\u003e 2017-12-02 04:33:38 UTC,\n          :end_time =\u003e 2017-12-02 10:33:38 UTC\n    },\n    [5] {\n              :data =\u003e {},\n        :start_time =\u003e 2017-12-02 10:33:38 UTC,\n          :end_time =\u003e 2017-12-02 16:33:38 UTC\n    },\n    [6] {\n              :data =\u003e {},\n        :start_time =\u003e 2017-12-02 16:33:38 UTC,\n          :end_time =\u003e 2017-12-02 22:33:38 UTC\n    },\n    [7] {\n              :data =\u003e {\n                                \"Munishs-MacBook-Pro.local_/words_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/words_GET\",\n                               :data =\u003e 2.518\n                },\n                [1] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/words_GET\",\n                               :data =\u003e 3.962\n                }\n            ],\n            \"Munishs-MacBook-Pro.local_/words/6/ajax_promote_flag_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/words/6/ajax_promote_flag_GET\",\n                               :data =\u003e 0.118\n                }\n            ],\n            \"Munishs-MacBook-Pro.local_/words/5/ajax_promote_flag_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/words/5/ajax_promote_flag_GET\",\n                               :data =\u003e 0.069\n                }\n            ],\n                              \"Munishs-MacBook-Pro.local_/words/4_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/words/4_GET\",\n                               :data =\u003e 0.526\n                }\n            ],\n                              \"Munishs-MacBook-Pro.local_/words/3_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/words/3_GET\",\n                               :data =\u003e 0.286\n                },\n                [1] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/words/3_GET\",\n                               :data =\u003e 0.671\n                }\n            ],\n                              \"Munishs-MacBook-Pro.local_/words/2_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/words/2_GET\",\n                               :data =\u003e 0.458\n                }\n            ],\n            \"Munishs-MacBook-Pro.local_/words/1/ajax_promote_flag_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/words/1/ajax_promote_flag_GET\",\n                               :data =\u003e 0.095\n                }\n            ],\n                                \"Munishs-MacBook-Pro.local_/users_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/users_GET\",\n                               :data =\u003e 0.603\n                },\n                [1] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/users_GET\",\n                               :data =\u003e 0.319\n                },\n                [2] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/users_GET\",\n                               :data =\u003e 0.288\n                }\n            ],\n                           \"Munishs-MacBook-Pro.local_/generals/2_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/generals/2_GET\",\n                               :data =\u003e 0.431\n                }\n            ],\n                                \"Munishs-MacBook-Pro.local_/flags_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/flags_GET\",\n                               :data =\u003e 0.582\n                }\n            ],\n                         \"Munishs-MacBook-Pro.local_/dictionaries_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/dictionaries_GET\",\n                               :data =\u003e 0.397\n                }\n            ],\n                             \"Munishs-MacBook-Pro.local_/admins/1_GET\" =\u003e [\n                [0] {\n                    :server_plus_api =\u003e \"Munishs-MacBook-Pro.local_/admins/1_GET\",\n                               :data =\u003e 0.343\n                }\n            ]\n        },\n        :start_time =\u003e 2017-12-02 22:33:38 UTC,\n          :end_time =\u003e 2017-12-03 04:33:38 UTC\n    }\n]\n\nReqResStat.get_details(:max_time, t - 2.day, t, :max, 6.hours)\nReqResStat.get_details(:max_time, t - 2.day, t, :min, 6.hours)\nReqResStat.get_details(:max_time, t - 2.day, t, :sum, 6.hours)\nReqResStat.get_details(:max_time, t - 2.day, t, :avg, 6.hours)\n```\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/goyalmunish/request_response_stats. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the RequestResponseStats project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/goyalmunish/request_response_stats/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoyalmunish%2Frequest_response_stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoyalmunish%2Frequest_response_stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoyalmunish%2Frequest_response_stats/lists"}