cmetrics 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/cmetrics/cmetrics_serde.c +26 -1
- data/ext/cmetrics/extconf.rb +2 -2
- 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: 17d74002b1bf99b4f6be2b1b2ce5d79409da9305d7915e2006014f42c8c01429
|
4
|
+
data.tar.gz: 75fc26e6fa974c990f83fae2e16484b185bf00262713ac24d07e607e6d2a7095
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd95645446f591377adfa1b4561a45bb22cc20446e60ebe577c13b4c67325cd9d1c9c87c3c215f786585853da71eb05449a37ace48339f12c2e3c422c69b68f4
|
7
|
+
data.tar.gz: 85ccdb531c1cb45df65b477352e1a9c555b105a6a658b5cea977e987123d92e05b827148b4ddc4e11e1f129413c602bacccd77da32e0ded9bee6e51a68e1e5d1
|
@@ -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: "922965a3ccc5aeb9a423d9b82be06e7aaf37f2bc8736ad6e70ac1c8845155710",
|
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.2.
|
73
|
+
cmetrics = BuildCMetrics.new("0.2.2", 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.2.
|
4
|
+
version: 0.2.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-
|
11
|
+
date: 2021-10-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|