cmetrics 0.1.4 → 0.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -0
- data/ext/cmetrics/cmetrics_counter.c +1 -1
- data/ext/cmetrics/cmetrics_gauge.c +1 -1
- data/lib/cmetrics/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 361bb2d812b12da260716172fe76c863c219262c499eedbbeba103b0c06f96df
|
4
|
+
data.tar.gz: 037562a3edf92bb19db31b2642bc8907d6e99dd21cd61a812c754508f8dd21cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ac8990af70be9e24984402b5bda5e3ac34a84075fd9051564b5e79d35e24c678c1f413f6064f9df9c5c08df2bf62c8c9d1ab1197abd84d072aaae24d99290c
|
7
|
+
data.tar.gz: 94dd6beaf0ef980bca11ec2b076582f14843560e8f737ee72cdda85de550d8bdf6506dde3d7a11768dac29fbcebc8a2c6a5ade527c03fe12c904a90af8b2b345
|
data/README.md
CHANGED
@@ -6,6 +6,12 @@
|
|
6
6
|
|
7
7
|
A Ruby binding for [cmetrics](https://github.com/calyptia/cmetrics).
|
8
8
|
|
9
|
+
## Prerequisites
|
10
|
+
|
11
|
+
* Ruby 2.4 or later with its headers
|
12
|
+
* CMake 3.13 or later due to different directory TARGETS for bundled cmetrics installation
|
13
|
+
* gcc or clang or some equivalents toolchain
|
14
|
+
|
9
15
|
## Installation
|
10
16
|
|
11
17
|
Add this line to your application's Gemfile:
|
@@ -151,6 +157,7 @@ require 'cmetrics'
|
|
151
157
|
@wired_buffer = @gauge.to_msgpack + @counter.to_msgpack + @counter2.to_msgpack
|
152
158
|
@serde = CMetrics::Serde.new
|
153
159
|
|
160
|
+
puts "-----Decode with procedural style-----"
|
154
161
|
# Decode for the context 1
|
155
162
|
@serde.from_msgpack(@wired_buffer)
|
156
163
|
puts @serde.to_prometheus
|
@@ -160,6 +167,12 @@ puts @serde.to_prometheus
|
|
160
167
|
# Decode for the context 3
|
161
168
|
@serde.from_msgpack(@wired_buffer)
|
162
169
|
puts @serde.to_prometheus
|
170
|
+
|
171
|
+
puts "-----Decode with streaming style-----"
|
172
|
+
# Or, use streaming style API
|
173
|
+
@serde.feed_each(@wired_buffer) do |serde|
|
174
|
+
puts serde.to_prometheus
|
175
|
+
end
|
163
176
|
```
|
164
177
|
|
165
178
|
## Development
|
@@ -548,7 +548,7 @@ rb_cmetrics_counter_add_label(VALUE self, VALUE rb_key, VALUE rb_value)
|
|
548
548
|
value = RSTRING_PTR(rb_sym2str(rb_value));
|
549
549
|
break;
|
550
550
|
default:
|
551
|
-
rb_raise(rb_eArgError, "
|
551
|
+
rb_raise(rb_eArgError, "value should be String or Symbol class instance.");
|
552
552
|
}
|
553
553
|
ret = cmt_label_add(cmetricsCounter->instance, key, value);
|
554
554
|
|
@@ -721,7 +721,7 @@ rb_cmetrics_gauge_add_label(VALUE self, VALUE rb_key, VALUE rb_value)
|
|
721
721
|
value = RSTRING_PTR(rb_sym2str(rb_value));
|
722
722
|
break;
|
723
723
|
default:
|
724
|
-
rb_raise(rb_eArgError, "
|
724
|
+
rb_raise(rb_eArgError, "value should be String or Symbol class instance.");
|
725
725
|
}
|
726
726
|
|
727
727
|
ret = cmt_label_add(cmetricsGauge->instance, key, value);
|
data/lib/cmetrics/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cmetrics
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-07-
|
11
|
+
date: 2021-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|