prometheus_exporter 0.1.15 → 0.1.16
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +5 -0
- data/lib/prometheus_exporter/client.rb +1 -1
- data/lib/prometheus_exporter/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 110ab29cb92edc16e211b229efc5a431448eee7b
|
4
|
+
data.tar.gz: 1475fec1cbf79bb26563c6493efa8adb276650f8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
59
|
+
@json_serializer = json_serializer == :oj ? PrometheusExporter::OjCompat : JSON
|
60
60
|
end
|
61
61
|
|
62
62
|
def register(type, name, help)
|
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.
|
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-
|
11
|
+
date: 2018-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|