pcp_easy 0.2.0 → 0.2.1

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: 13fd0a230d5bd9d2d01e2f9502eb1d639574c251
4
- data.tar.gz: 1d992b4b4f5580ed3d8e9ae7e37d53c76c75c4f9
3
+ metadata.gz: c9d7621df6e8b3c38023e15bfaf5ddaadd584939
4
+ data.tar.gz: f7d0872485ad3b1aeb5d6b189de5b939ad6b563e
5
5
  SHA512:
6
- metadata.gz: 9269aa99c2030bec9430858fdc3fbba8e58c07d6d48949a6e1e20cc41054a06e0a79e5f4354f3bbffe815bbf00c564bc9707d19a2a8f3355b598964e746b6526
7
- data.tar.gz: 67ba96db8ad09287dcad63f7987afee03efff3c33abe1259d0b5ed77fb3ff293b1702fa58004d9141669361665033153df2159ecbbded8460059c27f51af37dc
6
+ metadata.gz: c3fa1b4e354c39f3b12ba11ac0f0b1771bc4c11eb9d0d864df697eac017da532d80204a8e304c4395e65dbd562e37bd39cf51ffd32964716175bfdf8a05ca303
7
+ data.tar.gz: 489ab0ff996d026347bdd968d17a3a1e3968ba8a028780c66c2c5b0837f296b49c7346293af9baaeaf1a182cc21fd155573425f5a457b11640c747067f86422e
@@ -20,7 +20,7 @@
20
20
  #define PCPEASY_RUBY_EXCEPTIONS_H 1
21
21
 
22
22
  #include <ruby.h>
23
- VALUE pcpeasy_error;
23
+ extern VALUE pcpeasy_error;
24
24
  void pcpeasy_exceptions_init(VALUE pcpeasy_class);
25
25
  void pcpeasy_raise_from_pmapi_error(int error_number);
26
26
 
@@ -26,24 +26,6 @@
26
26
  #define rb_symbol_new(name) ID2SYM(rb_intern(name))
27
27
 
28
28
  VALUE pcpeasy_metric_class;
29
- VALUE pcpeasy_metric_semantics_counter;
30
- VALUE pcpeasy_metric_semantics_instant;
31
- VALUE pcpeasy_metric_semantics_discrete;
32
- VALUE pcpeasy_metric_semantics_unknown;
33
-
34
- VALUE pcpeasy_metric_type_nosupport;
35
- VALUE pcpeasy_metric_type_32;
36
- VALUE pcpeasy_metric_type_u32;
37
- VALUE pcpeasy_metric_type_64;
38
- VALUE pcpeasy_metric_type_u64;
39
- VALUE pcpeasy_metric_type_float;
40
- VALUE pcpeasy_metric_type_double;
41
- VALUE pcpeasy_metric_type_string;
42
- VALUE pcpeasy_metric_type_aggregate;
43
- VALUE pcpeasy_metric_type_aggregate_static;
44
- VALUE pcpeasy_metric_type_event;
45
- VALUE pcpeasy_metric_type_highres_event;
46
- VALUE pcpeasy_metric_type_unknown;
47
29
 
48
30
  static VALUE initialize(VALUE self, VALUE name, VALUE value, VALUE instance, VALUE semantics, VALUE type, VALUE units) {
49
31
  rb_iv_set(self, "@name", name);
@@ -59,13 +41,13 @@ static VALUE initialize(VALUE self, VALUE name, VALUE value, VALUE instance, VAL
59
41
  static VALUE semantics_symbol(int semantics) {
60
42
  switch(semantics) {
61
43
  case PM_SEM_COUNTER:
62
- return pcpeasy_metric_semantics_counter;
44
+ return rb_symbol_new("counter");
63
45
  case PM_SEM_DISCRETE:
64
- return pcpeasy_metric_semantics_discrete;
46
+ return rb_symbol_new("discrete");
65
47
  case PM_SEM_INSTANT:
66
- return pcpeasy_metric_semantics_instant;
48
+ return rb_symbol_new("instant");
67
49
  default:
68
- return pcpeasy_metric_semantics_unknown;
50
+ return Qnil;
69
51
  }
70
52
  }
71
53
 
@@ -130,32 +112,32 @@ static VALUE equal(VALUE self, VALUE other) {
130
112
  static VALUE type(int type) {
131
113
  switch(type) {
132
114
  case PM_TYPE_32:
133
- return pcpeasy_metric_type_32;
115
+ return rb_symbol_new("int32");
134
116
  case PM_TYPE_U32:
135
- return pcpeasy_metric_type_u32;
117
+ return rb_symbol_new("uint32");
136
118
  case PM_TYPE_64:
137
- return pcpeasy_metric_type_64;
119
+ return rb_symbol_new("int64");
138
120
  case PM_TYPE_U64:
139
- return pcpeasy_metric_type_u64;
121
+ return rb_symbol_new("uint64");
140
122
  case PM_TYPE_FLOAT:
141
- return pcpeasy_metric_type_float;
123
+ return rb_symbol_new("float");
142
124
  case PM_TYPE_DOUBLE:
143
- return pcpeasy_metric_type_double;
125
+ return rb_symbol_new("double");
144
126
  case PM_TYPE_STRING:
145
- return pcpeasy_metric_type_string;
127
+ return rb_symbol_new("string");
146
128
  case PM_TYPE_AGGREGATE:
147
- return pcpeasy_metric_type_aggregate;
129
+ return rb_symbol_new("aggregate");
148
130
  case PM_TYPE_AGGREGATE_STATIC:
149
- return pcpeasy_metric_type_aggregate_static;
131
+ return rb_symbol_new("aggregate_static");
150
132
  case PM_TYPE_EVENT:
151
- return pcpeasy_metric_type_event;
133
+ return rb_symbol_new("event");
152
134
  case PM_TYPE_HIGHRES_EVENT:
153
- return pcpeasy_metric_type_highres_event;
135
+ return rb_symbol_new("highres_event");
154
136
  case PM_TYPE_NOSUPPORT:
155
- return pcpeasy_metric_type_nosupport;
137
+ return rb_symbol_new("nosupport");
156
138
  case PM_TYPE_UNKNOWN:
157
139
  default:
158
- return pcpeasy_metric_type_unknown;
140
+ return rb_symbol_new("unknown");
159
141
  }
160
142
  }
161
143
 
@@ -263,25 +245,6 @@ VALUE pcpeasy_metric_new(char *metric_name, char *instance, pmValue *pm_value, p
263
245
  void pcpeasy_metric_init(VALUE pcpeasy_class) {
264
246
  pcpeasy_metric_class = rb_define_class_under(pcpeasy_class, "Metric", rb_cObject);
265
247
 
266
- pcpeasy_metric_semantics_counter = ID2SYM(rb_intern("counter"));
267
- pcpeasy_metric_semantics_discrete = ID2SYM(rb_intern("discrete"));
268
- pcpeasy_metric_semantics_instant = ID2SYM(rb_intern("instant"));
269
- pcpeasy_metric_semantics_unknown = ID2SYM(rb_intern("unknown"));
270
-
271
- pcpeasy_metric_type_nosupport = ID2SYM(rb_intern("nosupport"));
272
- pcpeasy_metric_type_32 = ID2SYM(rb_intern("int32"));
273
- pcpeasy_metric_type_u32 = ID2SYM(rb_intern("uint32"));
274
- pcpeasy_metric_type_64 = ID2SYM(rb_intern("int64"));
275
- pcpeasy_metric_type_u64 = ID2SYM(rb_intern("uint64"));
276
- pcpeasy_metric_type_float = ID2SYM(rb_intern("float"));
277
- pcpeasy_metric_type_double = ID2SYM(rb_intern("double"));
278
- pcpeasy_metric_type_string = ID2SYM(rb_intern("string"));
279
- pcpeasy_metric_type_aggregate = ID2SYM(rb_intern("aggregate"));
280
- pcpeasy_metric_type_aggregate_static = ID2SYM(rb_intern("aggregate_static"));
281
- pcpeasy_metric_type_event = ID2SYM(rb_intern("event"));
282
- pcpeasy_metric_type_highres_event = ID2SYM(rb_intern("highres_event"));
283
- pcpeasy_metric_type_unknown = ID2SYM(rb_intern("unknown"));
284
-
285
248
  rb_define_method(pcpeasy_metric_class, "initialize", initialize, CONSTRUCTOR_ARGS);
286
249
  rb_define_method(pcpeasy_metric_class, "==", equal, 1);
287
250
  rb_define_attr(pcpeasy_metric_class, "name", READ_ONLY);
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pcp_easy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Doyle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-28 00:00:00.000000000 Z
11
+ date: 2016-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake-compiler
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  version: '0'
73
73
  requirements: []
74
74
  rubyforge_project:
75
- rubygems_version: 2.2.2
75
+ rubygems_version: 2.4.5
76
76
  signing_key:
77
77
  specification_version: 4
78
78
  summary: Simple query interface for Performance Co-Pilot