rails_performance 1.0.0.beta1 → 1.0.0.beta2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d488f59068653fd127b680b6d2c067fbc23f85c84526d1259b2fb47dd3e25367
4
- data.tar.gz: 6efcf5fb469225f298bf21b2812792acf771aebf27b623d747d4c46e29313dc3
3
+ metadata.gz: 136a862da6c0d5b7d7d458e6c5389314cfe776d0437272d319d89a95eeaa8a11
4
+ data.tar.gz: 913394396bb6d45c8a9d12d8b2f115bc135cf9fe61eee19c79a3a88165c50551
5
5
  SHA512:
6
- metadata.gz: 2513587de28e920769405e717488fe64725e780aa3f33f012e78078c7ece12afe873347c14ec450568066fbe7f2d031a3b04e164836dc3759725416ff5a95406
7
- data.tar.gz: 87f823f42bbaf9c1491e49bbd194d8312ea395cb32372eac58fa97660b9a999c1de5106c5ab13d8ed28d63baebe6d2b8d8d05b933aece8ffaf4d5af338058417
6
+ metadata.gz: 4e07938ad437c12dfc911ca66d06717eded983694436b9936bc038876c685bcd9bc432c42ddc35279eb96e5511220781d790f3322f1f1acd6cfce4cce1fc27c2
7
+ data.tar.gz: 6fd601401eba7c250a31481df0f4bf1bf92c5d856ea9f5c454f3eefd45fbccc669fb1f088538a2a56a0a0decf5627eb87b2e1e93557b0515fd34ee0b575608df
data/README.md CHANGED
@@ -188,6 +188,8 @@ The idea of this gem grew from curriosity how many RPM my app receiving per day.
188
188
 
189
189
  You are welcome to contribute. I've a big list of TODO.
190
190
 
191
+ If "schema" how records are stored i Redis is changed, and this is a breacking change, update: `RailsPerformance::SCHEMA` to a newer value.
192
+
191
193
  ## Big thanks to contributors
192
194
 
193
195
  - https://github.com/synth
@@ -52,17 +52,17 @@ module RailsPerformance
52
52
  def query
53
53
  case type
54
54
  when :requests
55
- "performance|*#{compile_requests_query}*|END|#{RailsPerformance::VERSION}"
55
+ "performance|*#{compile_requests_query}*|END|#{RailsPerformance::SCHEMA}"
56
56
  when :sidekiq
57
- "sidekiq|*#{compile_sidekiq_query}*|END|#{RailsPerformance::VERSION}"
57
+ "sidekiq|*#{compile_sidekiq_query}*|END|#{RailsPerformance::SCHEMA}"
58
58
  when :delayed_job
59
- "delayed_job|*#{compile_delayed_job_query}*|END|#{RailsPerformance::VERSION}"
59
+ "delayed_job|*#{compile_delayed_job_query}*|END|#{RailsPerformance::SCHEMA}"
60
60
  when :grape
61
- "grape|*#{compile_grape_query}*|END|#{RailsPerformance::VERSION}"
61
+ "grape|*#{compile_grape_query}*|END|#{RailsPerformance::SCHEMA}"
62
62
  when :rake
63
- "rake|*#{compile_rake_query}*|END|#{RailsPerformance::VERSION}"
63
+ "rake|*#{compile_rake_query}*|END|#{RailsPerformance::SCHEMA}"
64
64
  when :custom
65
- "custom|*#{compile_custom_query}*|END|#{RailsPerformance::VERSION}"
65
+ "custom|*#{compile_custom_query}*|END|#{RailsPerformance::SCHEMA}"
66
66
  else
67
67
  raise "wrong type for datasource query builder"
68
68
  end
@@ -7,7 +7,7 @@ module RailsPerformance
7
7
  # TODO change to set
8
8
  CurrentRequest.current.ignore.add(:performance)
9
9
 
10
- now = Time.now
10
+ now = Time.now
11
11
  CurrentRequest.current.data ||= {}
12
12
  CurrentRequest.current.record ||= RailsPerformance::Models::GrapeRecord.new(request_id: CurrentRequest.current.request_id)
13
13
  CurrentRequest.current.record.datetimei ||= now.to_i
@@ -38,7 +38,7 @@ module RailsPerformance
38
38
  end
39
39
 
40
40
  def save
41
- key = "custom|tag_name|#{tag_name}|namespace_name|#{namespace_name}|datetime|#{datetime}|datetimei|#{datetimei}|status|#{status}|END|#{RailsPerformance::VERSION}"
41
+ key = "custom|tag_name|#{tag_name}|namespace_name|#{namespace_name}|datetime|#{datetime}|datetimei|#{datetimei}|status|#{status}|END|#{RailsPerformance::SCHEMA}"
42
42
  value = { duration: duration }
43
43
  Utils.save_to_redis(key, value)
44
44
  end
@@ -52,7 +52,7 @@ module RailsPerformance
52
52
  end
53
53
 
54
54
  def save
55
- key = "delayed_job|jid|#{jid}|datetime|#{datetime}|datetimei|#{datetimei}|source_type|#{source_type}|class_name|#{class_name}|method_name|#{method_name}|status|#{status}|END|#{RailsPerformance::VERSION}"
55
+ key = "delayed_job|jid|#{jid}|datetime|#{datetime}|datetimei|#{datetimei}|source_type|#{source_type}|class_name|#{class_name}|method_name|#{method_name}|status|#{status}|END|#{RailsPerformance::SCHEMA}"
56
56
  value = { duration: duration }
57
57
  Utils.save_to_redis(key, value)
58
58
  end
@@ -50,7 +50,7 @@ module RailsPerformance
50
50
  end
51
51
 
52
52
  def save
53
- key = "grape|datetime|#{datetime}|datetimei|#{datetimei}|format|#{format}|path|#{path}|status|#{status}|method|#{method}|request_id|#{request_id}|END|#{RailsPerformance::VERSION}"
53
+ key = "grape|datetime|#{datetime}|datetimei|#{datetimei}|format|#{format}|path|#{path}|status|#{status}|method|#{method}|request_id|#{request_id}|END|#{RailsPerformance::SCHEMA}"
54
54
  value = { "endpoint_render.grape" => endpoint_render_grape, "endpoint_run.grape" => endpoint_run_grape, "format_response.grape" => format_response_grape }
55
55
 
56
56
  Utils.save_to_redis(key, value)
@@ -39,7 +39,7 @@ module RailsPerformance
39
39
  end
40
40
 
41
41
  def save
42
- key = "rake|task|#{task.to_json}|datetime|#{datetime}|datetimei|#{datetimei}|status|#{status}|END|#{RailsPerformance::VERSION}"
42
+ key = "rake|task|#{task.to_json}|datetime|#{datetime}|datetimei|#{datetimei}|status|#{status}|END|#{RailsPerformance::SCHEMA}"
43
43
  value = { duration: duration }
44
44
  Utils.save_to_redis(key, value)
45
45
  end
@@ -89,7 +89,7 @@ module RailsPerformance
89
89
 
90
90
  def save
91
91
  value = { view_runtime: view_runtime, db_runtime: db_runtime, duration: duration, http_referer: http_referer }
92
- key = "performance|controller|#{controller}|action|#{action}|format|#{format}|status|#{status}|datetime|#{datetime}|datetimei|#{datetimei}|method|#{method}|path|#{path}|request_id|#{request_id}|END|#{RailsPerformance::VERSION}"
92
+ key = "performance|controller|#{controller}|action|#{action}|format|#{format}|status|#{status}|datetime|#{datetime}|datetimei|#{datetimei}|method|#{method}|path|#{path}|request_id|#{request_id}|END|#{RailsPerformance::SCHEMA}"
93
93
  Utils.save_to_redis(key, value)
94
94
  end
95
95
 
@@ -56,7 +56,7 @@ module RailsPerformance
56
56
  end
57
57
 
58
58
  def save
59
- key = "sidekiq|queue|#{queue}|worker|#{worker}|jid|#{jid}|datetime|#{datetime}|datetimei|#{datetimei}|enqueued_ati|#{enqueued_ati}|start_timei|#{start_timei}|status|#{status}|END|#{RailsPerformance::VERSION}"
59
+ key = "sidekiq|queue|#{queue}|worker|#{worker}|jid|#{jid}|datetime|#{datetime}|datetimei|#{datetimei}|enqueued_ati|#{enqueued_ati}|start_timei|#{start_timei}|status|#{status}|END|#{RailsPerformance::SCHEMA}"
60
60
  value = { message: message, duration: duration }
61
61
  Utils.save_to_redis(key, value)
62
62
  end
@@ -11,7 +11,7 @@ module RailsPerformance
11
11
  def save
12
12
  return if value.empty?
13
13
 
14
- Utils.save_to_redis("trace|#{request_id}|END|#{RailsPerformance::VERSION}", value, RailsPerformance::Reports::RecentRequestsReport::TIME_WINDOW.to_i)
14
+ Utils.save_to_redis("trace|#{request_id}|END|#{RailsPerformance::SCHEMA}", value, RailsPerformance::Reports::RecentRequestsReport::TIME_WINDOW.to_i)
15
15
  end
16
16
 
17
17
  end
@@ -8,7 +8,7 @@ module RailsPerformance
8
8
  end
9
9
 
10
10
  def data
11
- key = "trace|#{request_id}|END|#{RailsPerformance::VERSION}"
11
+ key = "trace|#{request_id}|END|#{RailsPerformance::SCHEMA}"
12
12
  JSON.parse(RP.redis.get(key).presence || '[]')
13
13
  end
14
14
  end
@@ -1,3 +1,4 @@
1
1
  module RailsPerformance
2
- VERSION = '1.0.0.beta1'
2
+ VERSION = '1.0.0.beta2'
3
+ SCHEMA = '1.0.0'
3
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_performance
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta1
4
+ version: 1.0.0.beta2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Kasyanchuk
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-19 00:00:00.000000000 Z
11
+ date: 2021-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -270,7 +270,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
270
270
  - !ruby/object:Gem::Version
271
271
  version: 1.3.1
272
272
  requirements: []
273
- rubygems_version: 3.0.3
273
+ rubygems_version: 3.2.3
274
274
  signing_key:
275
275
  specification_version: 4
276
276
  summary: Simple Rails Performance tracker. Alternative to the NewRelic, Datadog or