px-service-client 2.0.3 → 2.0.4

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
  SHA1:
3
- metadata.gz: 1f005d17d198c8508defaa03b6bf93e3229ea16b
4
- data.tar.gz: c8dbaa4551283603c7361f0fef662b6a41a1cc02
3
+ metadata.gz: 0c0de73dac7cba576f3d0e10fef5cae82a91c2d9
4
+ data.tar.gz: 422cce75ccf3d3232ad8d1594ae99b9d630168a9
5
5
  SHA512:
6
- metadata.gz: e2208726b9ba6e6498945f41991aabd0eb6ab64213b132f0b6d90095973775c1bd5bca3f41b34b1c2be5bf04a71b38eb35feb775ce79d48c47de7359bcbfb44e
7
- data.tar.gz: 2605971ec25cd79f04e0dc261ed718296f00e17352953be33631538ea6da3a7a48742c042c67b91bd93fe9e56da5a7d14af088a96e409596c29c7665efca976d
6
+ metadata.gz: 8b1a9c65ad5721e50911751d6193c1f9f9865db0fddd278ea90421de4c12ec3f73233ec4fddd0f3a243aa9e26d60f5a399e5ae08246cf0af63b73aa11cd2757c
7
+ data.tar.gz: fe270fafd278f2db6a52c7a7134fd946df9e41a38fd305bfc46668d0726327f8dd83ad3ba29818a9a0e20d2044aa355c78b8aba412dc47a01093fcf48194a07f
@@ -40,20 +40,19 @@ module Px::Service::Client
40
40
 
41
41
  ##
42
42
  # Make the request
43
- def make_request(method, uri, query: nil, headers: nil, body: nil, timeout: 0)
44
- stats_tags = [
45
- "method:#{method.downcase}",
46
- ]
47
- if uri.respond_to?(:path)
48
- stats_tags << "remote_host:#{uri.host}"
49
- stats_tags << "path:#{uri.path.gsub(/\d+/,'_')}"
43
+ def make_request(method, uri, query: nil, headers: nil, body: nil, timeout: 0, stats_tags: [])
44
+ _stats_tags = [
45
+ "remote_method:#{method.downcase}",
46
+ ].concat(stats_tags)
47
+
48
+ if uri.respond_to?(:host)
49
+ _stats_tags << "remote_host:#{uri.host.downcase}"
50
50
  else
51
51
  actual_uri = URI(uri)
52
- stats_tags << "remote_host:#{actual_uri.host}"
53
- stats_tags << "path:#{actual_uri.path.gsub(/\d+/,'_')}"
52
+ _stats_tags << "remote_host:#{actual_uri.host.downcase}"
54
53
  end
55
54
 
56
- _make_request(method, uri, query: query, headers: headers, body: body, timeout: timeout, stats_tags: stats_tags)
55
+ _make_request(method, uri, query: query, headers: headers, body: body, timeout: timeout, stats_tags: _stats_tags)
57
56
  end
58
57
 
59
58
  def _make_request(method, uri, query: nil, headers: nil, body: nil, timeout: nil, stats_tags: [])
@@ -49,8 +49,8 @@ module Px::Service::Client
49
49
  # returned and the cache entry is touched to prevent expiry. Otherwise, the original exception is re-raised.
50
50
  def cache_last_resort(url, policy_group: 'general', expires_in: nil, refresh_probability: 1)
51
51
  tags = [
52
- "type:last_resort",
53
- "policy_group:#{policy_group}",
52
+ "cache_type:last_resort",
53
+ "cache_policy_group:#{policy_group}",
54
54
  ]
55
55
 
56
56
  # Note we use a smaller refresh window here (technically, could even use 0)
@@ -93,8 +93,8 @@ module Px::Service::Client
93
93
  # cache_last_resort.
94
94
  def cache_first_resort(url, policy_group: 'general', expires_in: nil)
95
95
  tags = [
96
- "type:last_resort",
97
- "policy_group:#{policy_group}",
96
+ "cache_type:last_resort",
97
+ "cache_policy_group:#{policy_group}",
98
98
  ]
99
99
  entry = CacheEntry.fetch(config.cache_client, url, policy_group)
100
100
 
@@ -1,7 +1,7 @@
1
1
  module Px
2
2
  module Service
3
3
  module Client
4
- VERSION = "2.0.3"
4
+ VERSION = "2.0.4"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: px-service-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.3
4
+ version: 2.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Micacchi