cmetrics 0.2.4 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/yum.yml +4 -4
- data/ci/yum-test.sh +10 -0
- data/ext/cmetrics/cmetrics_serde.c +26 -1
- data/ext/cmetrics/extconf.rb +2 -2
- data/lib/cmetrics/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9cb75c4c4235b1607ae66658ec6985ef20dc2338ea06dd38b624fa1265c7d4c8
|
4
|
+
data.tar.gz: 3141eb411cacb661df52cd1d9da91f73d07615cb1a1fa9fea8db346e29bdfabd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3b55f676d133462f592903c479e1e07603cb3b1c1b9fc8443bfd3ac80e791fc10173bcfc164d4ce3f30b0939ff72c0689c3f0dea1a8795a8a2856b6c03f11965
|
7
|
+
data.tar.gz: a8e2310516436a3a2a85cd79bb844501d0e1f37b3203a10f68913326cc4668ec570f4da20b08acf3eafd5b8c8c8df518133ab45117ac3ee18dbec919da056633
|
data/.github/workflows/yum.yml
CHANGED
@@ -10,15 +10,15 @@ jobs:
|
|
10
10
|
matrix:
|
11
11
|
label:
|
12
12
|
- CentOS 7 x86_64
|
13
|
-
-
|
13
|
+
- RockyLinux OS 8 x86_64
|
14
14
|
- Fedora 34 x86_64
|
15
15
|
- AmazonLinux 2 x86_64
|
16
16
|
include:
|
17
17
|
- label: CentOS 7 x86_64
|
18
18
|
test-docker-image: centos:7
|
19
19
|
test-script: ci/yum-test.sh
|
20
|
-
- label:
|
21
|
-
test-docker-image:
|
20
|
+
- label: RockyLinux OS 8 x86_64
|
21
|
+
test-docker-image: rockylinux:8
|
22
22
|
test-script: ci/yum-test.sh
|
23
23
|
- label: Fedora 34 x86_64
|
24
24
|
test-docker-image: fedora:34
|
@@ -36,4 +36,4 @@ jobs:
|
|
36
36
|
--tty \
|
37
37
|
--volume ${PWD}:/cmetrics-ruby \
|
38
38
|
${{ matrix.test-docker-image }} \
|
39
|
-
/cmetrics-ruby/${{ matrix.test-script }}
|
39
|
+
/cmetrics-ruby/${{ matrix.test-script }}
|
data/ci/yum-test.sh
CHANGED
@@ -21,6 +21,7 @@
|
|
21
21
|
#include <cmetrics/cmt_map.h>
|
22
22
|
#include <cmetrics/cmt_metric.h>
|
23
23
|
#include <cmetrics/cmt_cat.h>
|
24
|
+
#include <cmetrics/cmt_encode_prometheus_remote_write.h>
|
24
25
|
|
25
26
|
VALUE rb_cSerde;
|
26
27
|
|
@@ -103,7 +104,7 @@ rb_cmetrics_serde_from_msgpack(int argc, VALUE *argv, VALUE self)
|
|
103
104
|
rb_scan_args(argc, argv, "12", &rb_msgpack_buffer, &rb_msgpack_length, &rb_offset);
|
104
105
|
if (!NIL_P(rb_msgpack_length)) {
|
105
106
|
Check_Type(rb_msgpack_length, T_FIXNUM);
|
106
|
-
msgpack_length =
|
107
|
+
msgpack_length = ULONG2NUM(rb_msgpack_length);
|
107
108
|
} else {
|
108
109
|
msgpack_length = RSTRING_LEN(rb_msgpack_buffer);
|
109
110
|
}
|
@@ -208,6 +209,29 @@ rb_cmetrics_serde_concat_metric(VALUE self, VALUE rb_data)
|
|
208
209
|
return Qnil;
|
209
210
|
}
|
210
211
|
|
212
|
+
static VALUE
|
213
|
+
rb_metrics_serde_prometheus_remote_write(VALUE self)
|
214
|
+
{
|
215
|
+
struct CMetricsSerde* cmetricsSerde;
|
216
|
+
cmt_sds_t prom;
|
217
|
+
VALUE str;
|
218
|
+
|
219
|
+
TypedData_Get_Struct(
|
220
|
+
self, struct CMetricsSerde, &rb_cmetrics_serde_type, cmetricsSerde);
|
221
|
+
|
222
|
+
if (cmetricsSerde->instance == NULL) {
|
223
|
+
rb_raise(rb_eRuntimeError, "Invalid cmt context");
|
224
|
+
}
|
225
|
+
|
226
|
+
prom = cmt_encode_prometheus_remote_write_create(cmetricsSerde->instance);
|
227
|
+
|
228
|
+
str = rb_str_new2(prom);
|
229
|
+
|
230
|
+
cmt_encode_prometheus_remote_write_destroy(prom);
|
231
|
+
|
232
|
+
return str;
|
233
|
+
}
|
234
|
+
|
211
235
|
static VALUE
|
212
236
|
rb_cmetrics_serde_to_prometheus(VALUE self)
|
213
237
|
{
|
@@ -457,6 +481,7 @@ void Init_cmetrics_serde(VALUE rb_mCMetrics)
|
|
457
481
|
rb_define_method(rb_cSerde, "initialize", rb_cmetrics_serde_initialize, 0);
|
458
482
|
rb_define_method(rb_cSerde, "concat", rb_cmetrics_serde_concat_metric, 1);
|
459
483
|
rb_define_method(rb_cSerde, "from_msgpack", rb_cmetrics_serde_from_msgpack, -1);
|
484
|
+
rb_define_method(rb_cSerde, "prometheus_remote_write", rb_metrics_serde_prometheus_remote_write, 0);
|
460
485
|
rb_define_method(rb_cSerde, "to_prometheus", rb_cmetrics_serde_to_prometheus, 0);
|
461
486
|
rb_define_method(rb_cSerde, "to_influx", rb_cmetrics_serde_to_influx, 0);
|
462
487
|
rb_define_method(rb_cSerde, "to_msgpack", rb_cmetrics_serde_to_msgpack, 0);
|
data/ext/cmetrics/extconf.rb
CHANGED
@@ -46,7 +46,7 @@ class BuildCMetrics
|
|
46
46
|
@recipe.target = File.join(ROOT, "ports")
|
47
47
|
@recipe.files << {
|
48
48
|
url: "https://codeload.github.com/calyptia/cmetrics/tar.gz/v#{version}",
|
49
|
-
sha256sum: "
|
49
|
+
sha256sum: "c0b239fad559852c0c088879697c26e00ba243cfb1c4b8bca6246d1f50932842e",
|
50
50
|
}
|
51
51
|
end
|
52
52
|
|
@@ -70,7 +70,7 @@ class BuildCMetrics
|
|
70
70
|
end
|
71
71
|
end
|
72
72
|
|
73
|
-
cmetrics = BuildCMetrics.new("0.
|
73
|
+
cmetrics = BuildCMetrics.new("0.3.0", cmake_command: determine_preferred_command("cmake3", "cmake"))
|
74
74
|
cmetrics.build
|
75
75
|
|
76
76
|
libdir = RbConfig::CONFIG["libdir"]
|
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.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hiroshi Hatake
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-05-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -147,7 +147,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
147
147
|
- !ruby/object:Gem::Version
|
148
148
|
version: '0'
|
149
149
|
requirements: []
|
150
|
-
rubygems_version: 3.2.
|
150
|
+
rubygems_version: 3.2.32
|
151
151
|
signing_key:
|
152
152
|
specification_version: 4
|
153
153
|
summary: C binding for cmetric library.
|