salestation 5.5.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bd7b52225452bf9e306427aac8619e9b4a41a7b2301fd050e5cadef33ce0a609
4
- data.tar.gz: 919ed91a19ac79a75bb09d6b786c885b201b46c719b0bd2bb59b8e132629fca8
3
+ metadata.gz: 7d908387fcdf296252af2446be5dcbc93d6ce903feea96713cd52e65aaf327ec
4
+ data.tar.gz: 0002cadcd4bf656641f938767abd851ca4e8af6ef3ee5048ef48cd508344e7b5
5
5
  SHA512:
6
- metadata.gz: 38c10c460642865693c5941430ac49cfc97b5d17296ac434ab5d1f43ac7f79a7b98f7da39f310b31fd099056d8104f6c3816e73bff727e596e75081c1b1fee40
7
- data.tar.gz: 05046b1499641bb9c889a0d97ef68cb7d8d650089f2f8b317a0e96108819a436e8883768973ed437b736a4c273abadd0e58e5308cc5d31ce7dbdf3da2905c824
6
+ metadata.gz: 76218019309c771963de99a13a76ddec209df0c9567334434a55fb4a1d3ba82748e739c213207bdb72fccfdfbde6bd18cdd8b9171997c26b5734235cb04ab0aa
7
+ data.tar.gz: 07d209dad27df390197c17bc35767896a90559c6129b42274793e49f4bdd83acfe2b0614431ed332f19ef2cf0ad1dffed5c778da402839aed64173cfd5cc9d55
@@ -0,0 +1 @@
1
+ * @salemove/tm-atlas
data/CHANGELOG.md ADDED
@@ -0,0 +1,24 @@
1
+ # Change Log
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](http://keepachangelog.com/)
6
+ and this project adheres to [Semantic Versioning](http://semver.org/).
7
+
8
+ ## 6.1.0
9
+
10
+ ### Fixed
11
+
12
+ - Fix incompatibility with ActiveRecord 7.1+ due to changes in its
13
+ connection clearing API.
14
+
15
+ ## 6.0.0
16
+
17
+ ### Changed
18
+
19
+ - **Breaking change**: Change StatsdMiddleware metric type from timing to
20
+ distribution. Prior to 6.0.0, if you set the metric name to
21
+ `my_service.response.time`, then in Datadog you ended up with metrics
22
+ `my_service.response.time.avg`, `my_service.response.time.95_percentile`,
23
+ `my_service.response.time.count`. Now, only one metric with name
24
+ `my_service.response.time` of type distribution is sent.
data/README.md CHANGED
@@ -179,7 +179,7 @@ You can configure per-request fields by defining `salestation.request_logger.fie
179
179
  ### Using StatsD
180
180
 
181
181
  Salestation provides a StatsD middleware which can be used record request
182
- execution time. A `timing` call with elapsed seconds is made to the provided
182
+ execution time. A `distribution` call with elapsed seconds is made to the provided
183
183
  StatsD instance with `path`, `method`, `status` and `status_class` tags.
184
184
 
185
185
  ```ruby
@@ -12,13 +12,23 @@ module Salestation
12
12
 
13
13
  status, headers, body = @app.call(env)
14
14
  proxy = ::Rack::BodyProxy.new(body) do
15
- ActiveRecord::Base.clear_active_connections! unless testing
15
+ clear_connections unless testing
16
16
  end
17
17
  [status, headers, proxy]
18
18
  rescue Exception
19
- ActiveRecord::Base.clear_active_connections! unless testing
19
+ clear_connections unless testing
20
20
  raise
21
21
  end
22
+
23
+ def clear_connections
24
+ if ActiveRecord::Base.respond_to?(:clear_active_connections!)
25
+ # For ActiveRecord 6.1 to 7.0
26
+ ActiveRecord::Base.clear_active_connections!
27
+ else
28
+ # For ActiveRecord 7.1 and newer
29
+ ActiveRecord::Base.connection_handler.clear_active_connections!
30
+ end
31
+ end
22
32
  end
23
33
  end
24
34
  end
@@ -33,7 +33,7 @@ module Salestation
33
33
  "status_class:#{status / 100}xx"
34
34
  ] + env.fetch(EXTRA_TAGS_ENV_KEY, [])
35
35
 
36
- @statsd.timing(@metric, duration_ms(from: start), tags: tags)
36
+ @statsd.distribution(@metric, duration_ms(from: start), tags: tags)
37
37
 
38
38
  [status, header, body]
39
39
  end
data/salestation.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = "salestation"
7
- spec.version = "5.5.0"
7
+ spec.version = "6.1.0"
8
8
  spec.authors = ["Glia TechMovers"]
9
9
  spec.email = ["open-source@glia.com"]
10
10
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: salestation
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.5.0
4
+ version: 6.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Glia TechMovers
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-02-18 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: bundler
@@ -184,11 +184,13 @@ executables: []
184
184
  extensions: []
185
185
  extra_rdoc_files: []
186
186
  files:
187
+ - ".github/CODEOWNERS"
187
188
  - ".github/workflows/publish.yml"
188
189
  - ".github/workflows/ruby.yml"
189
190
  - ".gitignore"
190
191
  - ".rspec"
191
192
  - ".yardopts"
193
+ - CHANGELOG.md
192
194
  - CONTRIBUTING.md
193
195
  - Gemfile
194
196
  - LICENSE.txt
@@ -233,7 +235,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
233
235
  - !ruby/object:Gem::Version
234
236
  version: '0'
235
237
  requirements: []
236
- rubygems_version: 3.6.2
238
+ rubygems_version: 3.6.9
237
239
  specification_version: 4
238
240
  summary: ''
239
241
  test_files: []