prometheus_exporter 0.1.15 → 0.1.16

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: d2f98b4a43ff42569d5b63f603fca9dbc011aba6
4
- data.tar.gz: 80f468ac5abf12049e4d58bd981186b7134b5059
3
+ metadata.gz: 110ab29cb92edc16e211b229efc5a431448eee7b
4
+ data.tar.gz: 1475fec1cbf79bb26563c6493efa8adb276650f8
5
5
  SHA512:
6
- metadata.gz: 1d77695ef60e34eafd2dcbec8d7247eba6610568305a6d0a5a146300ff59f2f7c5776756bcd20562d14743d5354d493dc50e95a9e8f72d4bcdfaac55283bb100
7
- data.tar.gz: e8e4c0b5a0ea42b97c2fdd9dd75ba6894a9063a22764c8817488eaa31c6cc0fd627194a3664af067e9de0a5019bfabfe73a9031f81b16742fdceb7ba40f8df27
6
+ metadata.gz: 9b2eccbb5ac11181ed6dbed96a0817a86b0198584926adf26832c5d090afb2f67269aee153cc0b19bbbd1a3142bc81f79d42ec1fb9e77ebec052581cc1459286
7
+ data.tar.gz: 3ffa69f888f98481e78f78b69293acbebbe35b6538c239b96a8fca6cd417e35a50f735362a77a91773f6b332e7087dcfe460a7365604a18a104656eb97557d55
data/README.md CHANGED
@@ -305,6 +305,11 @@ Prometheus Exporter handles transport using a simple HTTP protocol. In multi pro
305
305
 
306
306
  The `/bench` directory has simple benchmark it is able to send through 10k messages in 500ms.
307
307
 
308
+ ## JSON generation and parsing
309
+
310
+ The `PrometheusExporter::Client` class has the method `#send-json`. This method, by default, will call `JSON.dump` on the Object it recieves. You may opt in for `oj` mode where it can use the faster `Oj.dump(obj, mode: :compat)` for JSON serialization. But be warned that if you have custom objects that implement own `to_json` methods this may not work as expected. You can opt for oj serialization with `json_serializer: :oj`
311
+
312
+ The `PrometheusExporter::Server::Collector` parses your JSON, by default it will use the faster Oj deserializer if availabe. This happens cause it only expects a simple Hash out of the box. You can opt in for the default JSON deserializer with `json_serializer: :json`
308
313
 
309
314
  ## Contributing
310
315
 
@@ -56,7 +56,7 @@ class PrometheusExporter::Client
56
56
  @mutex = Mutex.new
57
57
  @thread_sleep = thread_sleep
58
58
 
59
- @json_serializer = PrometheusExporter.detect_json_serializer(@json_serializer)
59
+ @json_serializer = json_serializer == :oj ? PrometheusExporter::OjCompat : JSON
60
60
  end
61
61
 
62
62
  def register(type, name, help)
@@ -1,3 +1,3 @@
1
1
  module PrometheusExporter
2
- VERSION = "0.1.15"
2
+ VERSION = "0.1.16"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: prometheus_exporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Saffron
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-02-18 00:00:00.000000000 Z
11
+ date: 2018-02-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler