time_bandits 0.12.3 → 0.12.6

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: b0fce6a47ee1df1c7b253b224baa214c7c13402d3da79f898fb0c3a97e2d722a
4
- data.tar.gz: 022c6a22fd197515a3730185f146eb979cfba9fca9fa1021cbb793eac796ecf4
3
+ metadata.gz: 9bb0e53a2ec6be050ceb69100a522491c7c9aada6ab0571143702cdcb791c952
4
+ data.tar.gz: ad9782ffb7fefd0080059322c79bf9fee94fb604dad425d781d533149cfa99be
5
5
  SHA512:
6
- metadata.gz: 790651148875c6d6010826198a7ea43de2a9ed2c50672fa50d176cac1ad6d677817956b1f63bdd8fde45b2682f388cd9f13814bcbfb0d4ad3f8a1961921b846c
7
- data.tar.gz: d19cab10410f48485ce67adec41c60124c26dab0fd720036613f936f6f97b9697aeb7e40f275bf334ee5674cb9ab6f996640fdb755f8501b75ad2e6953111bf2
6
+ metadata.gz: 41bfddd9121b5c1bd645135b4a83fcd9172039b6fd8f119e46ae37cea60c032fac9be880ecfa2c6e085254384d033e0e1d16eb7953730301a72342ab1caf23c5
7
+ data.tar.gz: b432bb568909ed75a43e7a8b84b78cdacd7557529e06a43e3e47c221860dae00a87bb88250a878eaa2846c233db3fa58b2cef926be6d0a2fd3153213cf22eba4
@@ -0,0 +1,46 @@
1
+ name: build
2
+
3
+ on:
4
+ push:
5
+ branches: [ master ]
6
+ pull_request:
7
+ branches: [ master ]
8
+
9
+ jobs:
10
+ test:
11
+
12
+ runs-on: ubuntu-latest
13
+
14
+ strategy:
15
+ matrix:
16
+ ruby-version: [3.1.2, 3.0.4, 2.7.6]
17
+
18
+ steps:
19
+ - uses: actions/checkout@v2
20
+
21
+ - name: Start containers
22
+ run: docker-compose -f docker-compose.yml up -d
23
+
24
+ - name: Set up Ruby ${{ matrix.ruby-version }}
25
+ uses: ruby/setup-ruby@v1
26
+ with:
27
+ ruby-version: ${{ matrix.ruby-version }}
28
+
29
+ - name: Install dependencies
30
+ run: sudo apt-get install libsasl2-dev
31
+
32
+ - name: Install gems
33
+ run: bundle install
34
+
35
+ - name: Run tests
36
+ run: bundle exec rake test
37
+
38
+ - name: Install appraisals
39
+ run: bundle exec appraisal install
40
+
41
+ - name: Run appraisals
42
+ run: bundle exec appraisal rake test
43
+
44
+ - name: Stop containers
45
+ if: always()
46
+ run: docker-compose -f "docker-compose.yml" down
data/.gitignore CHANGED
@@ -6,3 +6,4 @@ pkg/*
6
6
  .DS_Store
7
7
  .rvmrc
8
8
  dump.rdb
9
+ gemfiles/*
data/Appraisals CHANGED
@@ -1,7 +1,12 @@
1
- [
2
- "5.2.4.3",
3
- "6.0.3.2"
4
- ].each do |rails_version|
1
+ appraisals = [
2
+ "6.0.4.7",
3
+ "6.1.5",
4
+ ]
5
+
6
+ appraisals.insert(0, "5.2.6") if Gem::Version.new(RUBY_VERSION) < Gem::Version.new("3.0.0")
7
+ appraisals << "7.0.2.3" if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new("2.7.0")
8
+
9
+ appraisals.each do |rails_version|
5
10
  appraise "activesupport-#{rails_version}" do
6
11
  gem "activesupport", rails_version
7
12
  gem "activerecord", rails_version
data/CHANGELOG.md ADDED
@@ -0,0 +1,318 @@
1
+ # CHANGELOG
2
+
3
+ ## Version 0.12.6
4
+ * use ruby 3.1.1 in GitHub actions
5
+ * updated appraisals
6
+ * restrict Redis gem to a version before 5.0 until 5.x has become
7
+ stable
8
+ * use monotonic clocks for time measurements
9
+
10
+ ## Version 0.12.5
11
+ * use GC.stat(:malloc_increase_bytes) to measure allocated bytes as fallback
12
+ * support ruby 3.1.0 GC.total_time
13
+ * ruby 3.1.0 needs rails 7.0.1 to run the tests
14
+ * include ruby-3.1.0 on GitHub actions
15
+
16
+ ## Version 0.12.4
17
+ * rails 7.0.0 compatibility
18
+ * only test Rails 3.0.0 with Ruby >= 2.7.0
19
+ * updated Appraisals
20
+ * use safe ruby version to run tests on GitHub
21
+ * switched to GitHub actions (#19)
22
+ * try to fix travis
23
+ * updated appraisals
24
+ * remove gemfiles created by appraisals and git ignore them
25
+
26
+ ## Version 0.12.3
27
+ * relax minitest dependency
28
+ * suppress Ruby 2.7 warnings in action controller tests
29
+ * updated test container versions
30
+
31
+ ## Version 0.12.2
32
+ * fixed that completed line was logged twice in Rails test environment
33
+ * split license into separate file
34
+ * added travis badge
35
+
36
+ ## Version 0.12.1
37
+ * install GC time bandit automatically inRails applications
38
+ * only load railtie if class Rails::Railtie is defined
39
+
40
+ ## Version 0.12.0
41
+ * removed leftover from old Rails plugin times
42
+ * don't need sudo on travis
43
+ * Merge pull request #15 from toy/patch-1
44
+ * try to fix travis build
45
+ * doc rephrasing
46
+ * updated README
47
+ * relax active support version requirement to 5.2.0
48
+ * updated travis build matrix
49
+ * dropped support for old rails and ruby versions
50
+ * silence ruby warnings
51
+ * updated docker images
52
+ * require at least version 5.2.4.3 for activesupport
53
+ * updated appraisals to only test supported Rails versions
54
+ * damn travis
55
+ * travis fu
56
+ * updated ruby versions
57
+ * trying to fix travis
58
+
59
+ ## Version 0.11.0
60
+ * added and updated appraisals
61
+ * support rails 6
62
+ * Add changelog url to gemspec
63
+
64
+ ## Version 0.10.12
65
+ * updated README
66
+ * also support future 5.0.x versions
67
+ * added appraisal for rails 5.0.7
68
+ * Merge pull request #14 from mediafinger/master
69
+ * Call type_casted_binds with only one argument in Rails 5.0.7
70
+
71
+ ## Version 0.10.11
72
+ * prepare 0.10.11 release
73
+ * clarified how TimeBanditry gets activated in railtie
74
+ * test rails 5.2.0 compatibility
75
+ * Merge pull request #13 from sghosh23/update_rails_version_active_record_monkey_patch
76
+ * add rails version 5.2 to support active record monkey patch
77
+ * fix test failures on ActiveRecord 4.1.16
78
+ * reinstalled appraisals
79
+ * try to fix travis builds
80
+
81
+ ## Version 0.10.10
82
+ * make sure sql method can be executed on logsubscriber
83
+ * updated appraisals
84
+
85
+ ## Version 0.10.8
86
+ * added specialized activerecord logging for Rails >= 5.1.5
87
+
88
+ ## Version 0.10.8
89
+ * rails has changed render_bind in 5.0.3
90
+ * updated README
91
+ * added rabbitmq as a service for travis
92
+ * added more rails versions to test against
93
+ * abort rake task when system calls fail
94
+ * fixed deprecation warning for ruby 2.4.1
95
+
96
+ ## Version 0.10.7
97
+ * changed README format to markdown
98
+ * Merge pull request #11 from manveru/patch-1
99
+ * Adapt log_sql_statement for Rails 5.1
100
+ * changed travis command
101
+
102
+ ## Version 0.10.6
103
+ * updated reales notes
104
+ * Merge pull request #9 from pinglamb/master
105
+ * added .travis.yml
106
+ * updated rails versions for appraisals
107
+
108
+ ## Version 0.10.5
109
+ * make activerecord monkey patch available for rails 5.1
110
+
111
+ ## Version 0.10.4
112
+ * protect against Rails 5 firing on_load handlers multiple times
113
+
114
+ ## Version 0.10.3
115
+ * fixed activerecord logging monkey patch
116
+
117
+ ## Version 0.10.2
118
+ * go back to using alias_method to enable testing with rspec
119
+
120
+ ## Version 0.10.1
121
+ * fixed broken module.prepend
122
+
123
+ ## Version 0.10.0
124
+ * updated release notes
125
+ * rebased on master
126
+ * added docker compose file to start redis, memcached, mysql and rabbitmq for testing
127
+ * added rails 5 to appraisals
128
+ * active record log subscriber changes to support rails 5
129
+ * checked and updated action controller hacks for rails 5
130
+ * rails 5 fixed the memcache store stats bug on fetch
131
+ * rails 5 deprecated alias_method_chain, used Module.prepend instead
132
+ * rails 5 deprecated string values for middlewares
133
+
134
+ ## Version 0.9.2
135
+ * fixed sequel gem monkey patch
136
+ * I really hate the stupid decision by rake to force ruby -w on everyone
137
+ * updated rails versions in appraisals
138
+
139
+ ## Version 0.9.1
140
+ * redis time consumer: make sure to log ASCII in debug mode
141
+
142
+ ## Version 0.9.0
143
+ * added beetle time consumer
144
+ * Multiply 1000 to get the actual millisecond
145
+
146
+ ## Version 0.8.1
147
+ * make sure every consumer has a current_runtime methods (duh)
148
+
149
+ ## Version 0.8.0
150
+ * access current database runtime including not yet consumed time
151
+
152
+ ## Version 0.7.4
153
+ * fixed that actions without render showed zero db time
154
+ * removed .lock files
155
+ * use appraisal for testing against multiple active support versions
156
+ * test with rails 4.2.4
157
+
158
+ ## Version 0.7.3
159
+ * in rails 4.2 dalli is always instrumented
160
+ * monkey patches seem to be compatible with rails 4.2
161
+
162
+ ## Version 0.7.2
163
+ * updated to support ruby 2.2.0
164
+
165
+ ## Version 0.7.1
166
+ * style change
167
+ * updated README
168
+ * measure time and calls with sequel
169
+
170
+ ## Version 0.7.0
171
+ * make the most out of an unpatched ruby
172
+
173
+ ## Version 0.6.7
174
+ * fixed wrong nesting of public :sql
175
+
176
+ ## Version 0.6.6
177
+ * fixed duplicate log lines for active record monkey patch and rails 4.1
178
+ * Count redis round trips not calls
179
+
180
+ ## Version 0.6.5
181
+ * rails monkey patches are compatible with 4.1
182
+
183
+ ## Version 0.6.4
184
+ * make sure not to call 'instrument=' if a rails 4 app uses :dalli_store instead of :mem_cache_store
185
+
186
+ ## Version 0.6.3
187
+ * rails 3.2 columns don't understand binary?
188
+
189
+ ## Version 0.6.2
190
+ * rails 4.0 updates to active_record monkey_patch
191
+
192
+ ## Version 0.6.1
193
+ * support for ruby 2.1
194
+ * added test for GC time consumer
195
+
196
+ ## Version 0.6.0
197
+ * updated README
198
+ * added tests for dalli and redis and new completed line behavior
199
+ * patched dalli consumer to work correctly with rails 4
200
+ * added redis time consumer
201
+ * don't include bandits in the the completed line which haven't measured anything
202
+
203
+ ## Version 0.5.1
204
+ * added license information to gemspec
205
+
206
+ ## Version 0.5.0
207
+ * ugly hack to ensure Completed lines are logged in the test environment
208
+ * reset time bandits before running controller tests
209
+ * renamed RailsCache consumer to dalli and rely on dalli for logging
210
+ * avoid calling logger in production
211
+ * install some gems for debugging
212
+ * updated README
213
+ * we're all milliseconds now
214
+ * we are thread safe now. lose the Rack::Lock middleware
215
+ * drop rails 2 support
216
+ * switch database consumer to use base_consumer
217
+ * added a general rails cache consumer (can be used to replace memcache consumers)
218
+ * make memcache consumers threadsafe
219
+ * use structs instead of hashes for counters
220
+ * more groundwork for thread safe time bandits
221
+ * added some tests
222
+
223
+ ## Version 0.4.1
224
+ * added rake dev dependency
225
+ * we can't rely on Rack::Sendfile to be around
226
+
227
+ ## Version 0.4.0
228
+ * rails 4.0 and tagged logging support
229
+
230
+ ## Version 0.3.1
231
+ * need to call TimeBandits.consumed to get correct db time stats
232
+
233
+ ## Version 0.3.0
234
+ * use thread local variables gem
235
+ * make use of thread_local_variable_access gem
236
+
237
+ ## Version 0.2.2
238
+ * enable GC stats after passenger has forked a new worker process
239
+ * reset time bandits after rails initialization process has been completed
240
+
241
+ ## Version 0.2.1
242
+ * use the correct rails version specific code to extract raw_payload
243
+
244
+ ## Version 0.2.0
245
+ * basic rails 3.1 and 32. compatibility
246
+
247
+ ## Version 0.1.4
248
+ * fixed bug related to mixing seconds and millicesonds
249
+
250
+ ## Version 0.1.3
251
+ * db time is already measured in milliseconds
252
+
253
+ ## Version 0.1.2
254
+ * the Rails 3 database consumer no longer uses instance variables for the statistics
255
+
256
+ ## Version 0.1.1
257
+ * use own middlware logger and provide viewtime and action for logjam_agent
258
+
259
+ ## Version 0.1.0
260
+ * ignore some files
261
+ * the version numbering is ridiculous
262
+ * add a bit of backtrace info
263
+ * removed last traces of agent suport
264
+ * provide metrics for rack middlewares
265
+ * metrics for rails2 database adapter
266
+ * improved metrics for memcached
267
+
268
+ ## Version 0.0.9
269
+
270
+ * Relax Rails version check, still running fine on 2.3.14
271
+ * metrics agent support for rails 2
272
+
273
+ ## Version 0.0.8
274
+ * gem compatibility for rails 2.3.x
275
+ * updated README
276
+
277
+ ## Version 0.0.7
278
+ * git ignore the Gemfile.lock
279
+ * Assume status 500 in case of an exception being raised
280
+ * Fail gracefully if an exception occurs during before_dispatch
281
+
282
+ ## Version 0.0.6
283
+ * updated gemspec to pin to the right branch on github
284
+
285
+ ## Version 0.0.5
286
+ * prepare new version (now with activerecord support)
287
+ * updated readme
288
+ * database consumer is now thread safe
289
+ * initial version of ActiveRecord time consumer
290
+
291
+
292
+ ## Version 0.0.4
293
+ * oh man. concentrate!
294
+
295
+ ## Version 0.0.3
296
+ * oops
297
+
298
+ ## Version 0.0.2
299
+ * refactored rack logger
300
+
301
+ ## Version 0.0.1
302
+ * now a proper rails3 gem plugin
303
+ * removed log ouput
304
+ * don't install time bandits per default (app needs control over order of bandits in completed line)
305
+ * use the more accurate timing info
306
+ * Merge branch 'master' into rails3
307
+ * deleted unused file
308
+ * Merge branch 'master' into rails3
309
+ * checked in some xing modifications
310
+ * first stab at supporting rails3
311
+ * JRuby support for GC and memory statistics, using the jmx gem.
312
+ * during initialization, enable memcache and GC stats if they are available
313
+ * we are compatible to activerecord 2.3.5
314
+ * Merge branch 'master' of github.com:skaes/time_bandits
315
+ * time bandits registration interface changed and got a new method for creating log lines outside ActionController
316
+ * added Rakefile with rdoc task
317
+ * removed Rakefile
318
+ * initial import
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in time_bandits.gemspec
4
4
  gemspec
data/README.md CHANGED
@@ -4,7 +4,8 @@
4
4
 
5
5
  Time Bandits is a gem plugin for Rails which enhances Rails' controller/view/db benchmark logging.
6
6
 
7
- [![Travis](https://travis-ci.org/skaes/time_bandits.svg?branch=master)](https://travis-ci.org/github/skaes/time_bandits)
7
+ ![Build](https://github.com/skaes/time_bandits/actions/workflows/run-tests.yml/badge.svg)
8
+
8
9
 
9
10
  ## Usage
10
11
 
@@ -83,114 +84,3 @@ changed so much of the code that is is practically a full rewrite, hence we chan
83
84
  ## Running Tests
84
85
 
85
86
  Run `docker-compose up` to start Redis, MySQL, RabbitMQ and Memached containers, then run `rake`.
86
-
87
-
88
- ## Release Notes
89
-
90
- ## Version 0.12.3
91
- - suppress Ruby 2.7 warnings about keyword parameters in controller tests
92
-
93
- ## Version 0.12.2
94
- - fixed that completed line was logged twice in Rails test environment
95
-
96
- ## Version 0.12.1
97
- - support having the rails gem in a bundle without activating the time bandits railtie
98
- - automatically install the garbage collection time bandit in rails applications
99
-
100
- ## Version 0.12.0
101
- - drops support for Rails versions before 5.2.0 and Ruby versions before 2.2.0
102
- - makes it possible to use individual time bandits without Rails (e.g. in a Sinatra app)
103
-
104
- ## Version 0.11.0
105
- - supports rails 6.0.0
106
-
107
- ## Version 0.10.12
108
- - supports rails 5.0.7
109
-
110
- ## Version 0.10.11
111
- - support rails 5.2.0
112
-
113
- ## Version 0.10.10
114
- - fixed regression introduced in 0.10.9
115
-
116
- ### Version 0.10.9
117
- - added specialized activerecord logging for Rails >= 5.1.5
118
-
119
- ### Version 0.10.8
120
- - rails has changed render_bind in 5.0.3
121
-
122
- ### Version 0.10.7
123
- - fixed bug in activerecord monkeypatch for Rails 5.1
124
-
125
- ### Version 0.10.6
126
- - fixed time calculation for rails 4
127
-
128
- ### Version 0.10.5
129
- - enabled activerecord monkeypatch for rails 5.1
130
-
131
- ### Version 0.10.4
132
- - protect against Rails 5 firing on_load handlers multiple times
133
-
134
- ### Version 0.10.3
135
- - fixed activerecord monkeypatch
136
-
137
- ### Version 0.10.2
138
- - controller testing fixed for rspec
139
-
140
- ### Version 0.10.1
141
- - fixed incorrect module prepend which broke controller testing
142
-
143
- ### Version 0.10.0
144
- - support rails 5
145
-
146
- ### Version 0.9.2
147
- - sequel gem changes broke sequel time consumer
148
-
149
- ### Version 0.9.1
150
- - make sure redis times consumer logs keys in ASCII
151
-
152
- ### Version 0.9.0
153
- - added beetle time consumer
154
-
155
- ### Version 0.8.1
156
- - bugfix
157
-
158
- ### Version 0.8.0
159
- - support retrieving current runtime including not yet consumed time
160
-
161
- ### Version 0.7.4
162
- - use appraisal for testing against multiple rails versions
163
- - bugfix for actions without render
164
-
165
- ### Version 0.7.3
166
- - bugfix dalli consumer for rails 4.2
167
-
168
- ### Version 0.7.2
169
- - support ruby 2.2.0
170
-
171
- ### Version 0.7.1
172
- - support measuring sequel gem
173
-
174
- ### Version 0.7.0
175
- - switched to byebug (debugger does not fully support 2.0 and 2.1 not at all)
176
- - adapted garbage collection statistics to work for 2.1
177
- - improved rails 4.x compatibility
178
- - GC time consumer now tries to make the most out of an unpatched ruby
179
-
180
- ### Version 0.6.0
181
- - added redis time consumer
182
- - fixed rails 4.0 problems with builtin mem_cache_store
183
- - now only consumers which measured something are added to the completed line
184
-
185
- ### Version 0.5.1
186
- - added license file
187
-
188
- ### Version 0.5
189
- - has dropped rails 2 support
190
- - relies on ActiveSupport::Notifications
191
- - is supposedly thread safe
192
- - all measurements are thread local (except GC statistics)
193
- - times are all measured in milliseconds internally
194
- - added class TimeBandits::TimeConsumers::BaseConsumer to simplify writing custom consumers
195
-
196
-
@@ -12,10 +12,11 @@ Sequel::Database.class_eval do
12
12
 
13
13
  def log_connection_yield(*args, &block)
14
14
  begin
15
- start = Time.now
15
+ start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
16
16
  _orig_log_connection_yield(*args, &block)
17
17
  ensure
18
- ActiveSupport::Notifications.instrument('duration.sequel', durationInSeconds: Time.now - start)
18
+ end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
19
+ ActiveSupport::Notifications.instrument('duration.sequel', durationInSeconds: end_time - start_time)
19
20
  end
20
21
  end
21
22
 
@@ -25,10 +26,11 @@ Sequel::Database.class_eval do
25
26
 
26
27
  def log_yield(*args, &block)
27
28
  begin
28
- start = Time.now
29
+ start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
29
30
  _orig_log_yield(*args, &block)
30
31
  ensure
31
- ActiveSupport::Notifications.instrument('duration.sequel', durationInSeconds: Time.now - start)
32
+ end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
33
+ ActiveSupport::Notifications.instrument('duration.sequel', durationInSeconds: end_time - start_time)
32
34
  end
33
35
  end
34
36
 
@@ -27,7 +27,7 @@ module TimeBandits
27
27
  protected
28
28
 
29
29
  def call_app(request, env)
30
- start_time = Time.now
30
+ start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
31
31
  start(request, start_time)
32
32
  resp = @app.call(env)
33
33
  resp[2] = ::Rack::BodyProxy.new(resp[2]) { finish(request) }
@@ -36,12 +36,13 @@ module TimeBandits
36
36
  finish(request)
37
37
  raise
38
38
  ensure
39
- completed(request, (Time.now - start_time) * 1000, resp)
39
+ end_time = Process.clock_gettime(Process::CLOCK_MONOTONIC)
40
+ completed(request, (end_time - start_time) * 1000, resp)
40
41
  ActiveSupport::LogSubscriber.flush_all!
41
42
  end
42
43
 
43
44
  # Started GET "/session/new" for 127.0.0.1 at 2012-09-26 14:51:42 -0700
44
- def started_request_message(request, start_time=Time.now)
45
+ def started_request_message(request, start_time = Process.clock_gettime(Process::CLOCK_MONOTONIC))
45
46
  'Started %s "%s" for %s at %s' % [
46
47
  request.request_method,
47
48
  request.filtered_path,
@@ -7,7 +7,8 @@ module TimeBandits
7
7
  class Railtie < Rails::Railtie
8
8
 
9
9
  initializer "time_bandits" do |app|
10
- app.config.middleware.swap(Rails::Rack::Logger, TimeBandits::Rack::Logger)
10
+ app.config.middleware.insert_after(Rails::Rack::Logger, TimeBandits::Rack::Logger)
11
+ app.config.middleware.delete(Rails::Rack::Logger)
11
12
 
12
13
  ActiveSupport.on_load(:action_controller) do
13
14
  require 'time_bandits/monkey_patches/action_controller'
@@ -29,6 +29,8 @@ module TimeBandits
29
29
 
30
30
  if GC.respond_to?(:time)
31
31
  def _get_gc_time; GC.time; end
32
+ elsif GC.respond_to?(:total_time)
33
+ def _get_gc_time; GC.total_time / 1000; end
32
34
  else
33
35
  def _get_gc_time; 0; end
34
36
  end
@@ -40,7 +42,8 @@ module TimeBandits
40
42
  if GC.respond_to?(:total_malloced_bytes)
41
43
  def _get_allocated_size; GC.total_malloced_bytes; end
42
44
  else
43
- def _get_allocated_size; 0; end
45
+ # this will wrap around :malloc_increase_bytes_limit so is not really correct
46
+ def _get_allocated_size; GC.stat(:malloc_increase_bytes); end
44
47
  end
45
48
 
46
49
  if GC.respond_to?(:heap_slots)
@@ -81,7 +84,9 @@ module TimeBandits
81
84
  end
82
85
 
83
86
  def allocated_size
84
- _get_allocated_size - @allocated_size
87
+ new_size = _get_allocated_size
88
+ old_size = @allocated_size
89
+ new_size <= old_size ? new_size : new_size - old_size
85
90
  end
86
91
 
87
92
  def heap_growth
@@ -1,3 +1,3 @@
1
1
  module TimeBandits
2
- VERSION = "0.12.3"
2
+ VERSION = "0.12.6"
3
3
  end
@@ -32,11 +32,11 @@ class SequelTest < Test::Unit::TestCase
32
32
  end
33
33
 
34
34
  def mysql_port
35
- ENV['TRAVIS'] == "true" ? 3306 : 3601
35
+ 3601
36
36
  end
37
37
 
38
38
  def sequel
39
- @sequel ||= Sequel.mysql2(host: "localhost", port: mysql_port, user: "root")
39
+ @sequel ||= Sequel.mysql2(host: "127.0.0.1", port: mysql_port, user: "root")
40
40
  end
41
41
 
42
42
  def metrics
data/time_bandits.gemspec CHANGED
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
33
33
  s.add_development_dependency("mocha")
34
34
  s.add_development_dependency("mysql2")
35
35
  s.add_development_dependency("rake")
36
- s.add_development_dependency("redis")
36
+ s.add_development_dependency("redis", "< 5.0")
37
37
  s.add_development_dependency("sequel")
38
38
  s.add_development_dependency("activerecord")
39
39
  s.add_development_dependency("beetle", ">= 3.4.1")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: time_bandits
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.3
4
+ version: 0.12.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefan Kaes
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-12-25 00:00:00.000000000 Z
11
+ date: 2022-08-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thread_variables
@@ -168,16 +168,16 @@ dependencies:
168
168
  name: redis
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - ">="
171
+ - - "<"
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: '5.0'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
- - - ">="
178
+ - - "<"
179
179
  - !ruby/object:Gem::Version
180
- version: '0'
180
+ version: '5.0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: sequel
183
183
  requirement: !ruby/object:Gem::Requirement
@@ -227,19 +227,16 @@ executables: []
227
227
  extensions: []
228
228
  extra_rdoc_files: []
229
229
  files:
230
+ - ".github/workflows/run-tests.yml"
230
231
  - ".gitignore"
231
- - ".travis.yml"
232
232
  - Appraisals
233
+ - CHANGELOG.md
233
234
  - Gemfile
234
235
  - LICENSE.txt
235
236
  - README.md
236
237
  - Rakefile
237
238
  - TODO
238
239
  - docker-compose.yml
239
- - gemfiles/activesupport_5.2.4.3.gemfile
240
- - gemfiles/activesupport_5.2.4.3.gemfile.lock
241
- - gemfiles/activesupport_6.0.3.2.gemfile
242
- - gemfiles/activesupport_6.0.3.2.gemfile.lock
243
240
  - lib/time_bandits.rb
244
241
  - lib/time_bandits/monkey_patches/action_controller.rb
245
242
  - lib/time_bandits/monkey_patches/active_record.rb
@@ -292,7 +289,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
292
289
  - !ruby/object:Gem::Version
293
290
  version: '0'
294
291
  requirements: []
295
- rubygems_version: 3.1.4
292
+ rubygems_version: 3.3.19
296
293
  signing_key:
297
294
  specification_version: 4
298
295
  summary: Custom performance logging for Rails
data/.travis.yml DELETED
@@ -1,23 +0,0 @@
1
- dist: bionic
2
- language: ruby
3
- rvm:
4
- - 2.5.7
5
- - 2.6.5
6
- - 2.7.0
7
- before_install:
8
- - gem install bundler
9
- script: "bundle exec rake appraisal:test"
10
- services:
11
- - redis-server
12
- - memcached
13
- - rabbitmq
14
- - mysql
15
- addons:
16
- apt:
17
- sources:
18
- - sourceline: "deb https://packages.erlang-solutions.com/ubuntu bionic contrib"
19
- key_url: "https://packages.erlang-solutions.com/ubuntu/erlang_solutions.asc"
20
- - sourceline: "deb https://dl.bintray.com/rabbitmq/debian bionic main"
21
- key_url: "https://dl.bintray.com/rabbitmq/Keys/rabbitmq-release-signing-key.asc"
22
- packages:
23
- - rabbitmq-server
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "activesupport", "5.2.4.3"
6
- gem "activerecord", "5.2.4.3"
7
-
8
- gemspec path: "../"
@@ -1,81 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- time_bandits (0.11.0)
5
- activesupport (>= 5.2.4.3)
6
- thread_variables
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- activemodel (5.2.4.3)
12
- activesupport (= 5.2.4.3)
13
- activerecord (5.2.4.3)
14
- activemodel (= 5.2.4.3)
15
- activesupport (= 5.2.4.3)
16
- arel (>= 9.0)
17
- activesupport (5.2.4.3)
18
- concurrent-ruby (~> 1.0, >= 1.0.2)
19
- i18n (>= 0.7, < 2)
20
- minitest (~> 5.1)
21
- tzinfo (~> 1.1)
22
- amq-protocol (2.3.1)
23
- amqp (1.8.0)
24
- amq-protocol (>= 2.2.0)
25
- eventmachine
26
- ansi (1.5.0)
27
- appraisal (2.3.0)
28
- bundler
29
- rake
30
- thor (>= 0.14.0)
31
- arel (9.0.0)
32
- beetle (3.4.1)
33
- activesupport (>= 2.3.4)
34
- amq-protocol (= 2.3.1)
35
- amqp (= 1.8.0)
36
- bunny (~> 0.7.12)
37
- hiredis (>= 0.4.5)
38
- redis (>= 4.2.1)
39
- bunny (0.7.12)
40
- byebug (11.1.3)
41
- concurrent-ruby (1.1.6)
42
- dalli (2.7.10)
43
- eventmachine (1.2.7)
44
- hiredis (0.6.3)
45
- i18n (1.8.3)
46
- concurrent-ruby (~> 1.0)
47
- memcached (1.8.0)
48
- minitest (5.14.1)
49
- mocha (1.11.2)
50
- mysql2 (0.5.3)
51
- rake (13.0.1)
52
- redis (4.2.1)
53
- sequel (5.33.0)
54
- thor (1.0.1)
55
- thread_safe (0.3.6)
56
- thread_variables (0.2.0)
57
- tzinfo (1.2.7)
58
- thread_safe (~> 0.1)
59
-
60
- PLATFORMS
61
- ruby
62
-
63
- DEPENDENCIES
64
- activerecord (= 5.2.4.3)
65
- activesupport (= 5.2.4.3)
66
- ansi
67
- appraisal
68
- beetle (>= 3.4.1)
69
- byebug
70
- dalli
71
- memcached (~> 1.8.0)
72
- minitest (~> 5.5)
73
- mocha
74
- mysql2
75
- rake
76
- redis
77
- sequel
78
- time_bandits!
79
-
80
- BUNDLED WITH
81
- 2.1.4
@@ -1,8 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "activesupport", "6.0.3.2"
6
- gem "activerecord", "6.0.3.2"
7
-
8
- gemspec path: "../"
@@ -1,81 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- time_bandits (0.11.0)
5
- activesupport (>= 5.2.4.3)
6
- thread_variables
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- activemodel (6.0.3.2)
12
- activesupport (= 6.0.3.2)
13
- activerecord (6.0.3.2)
14
- activemodel (= 6.0.3.2)
15
- activesupport (= 6.0.3.2)
16
- activesupport (6.0.3.2)
17
- concurrent-ruby (~> 1.0, >= 1.0.2)
18
- i18n (>= 0.7, < 2)
19
- minitest (~> 5.1)
20
- tzinfo (~> 1.1)
21
- zeitwerk (~> 2.2, >= 2.2.2)
22
- amq-protocol (2.3.1)
23
- amqp (1.8.0)
24
- amq-protocol (>= 2.2.0)
25
- eventmachine
26
- ansi (1.5.0)
27
- appraisal (2.3.0)
28
- bundler
29
- rake
30
- thor (>= 0.14.0)
31
- beetle (3.4.1)
32
- activesupport (>= 2.3.4)
33
- amq-protocol (= 2.3.1)
34
- amqp (= 1.8.0)
35
- bunny (~> 0.7.12)
36
- hiredis (>= 0.4.5)
37
- redis (>= 4.2.1)
38
- bunny (0.7.12)
39
- byebug (11.1.3)
40
- concurrent-ruby (1.1.6)
41
- dalli (2.7.10)
42
- eventmachine (1.2.7)
43
- hiredis (0.6.3)
44
- i18n (1.8.3)
45
- concurrent-ruby (~> 1.0)
46
- memcached (1.8.0)
47
- minitest (5.14.1)
48
- mocha (1.11.2)
49
- mysql2 (0.5.3)
50
- rake (13.0.1)
51
- redis (4.2.1)
52
- sequel (5.33.0)
53
- thor (1.0.1)
54
- thread_safe (0.3.6)
55
- thread_variables (0.2.0)
56
- tzinfo (1.2.7)
57
- thread_safe (~> 0.1)
58
- zeitwerk (2.3.0)
59
-
60
- PLATFORMS
61
- ruby
62
-
63
- DEPENDENCIES
64
- activerecord (= 6.0.3.2)
65
- activesupport (= 6.0.3.2)
66
- ansi
67
- appraisal
68
- beetle (>= 3.4.1)
69
- byebug
70
- dalli
71
- memcached (~> 1.8.0)
72
- minitest (~> 5.5)
73
- mocha
74
- mysql2
75
- rake
76
- redis
77
- sequel
78
- time_bandits!
79
-
80
- BUNDLED WITH
81
- 2.1.4