Skip to content

Commit 852f74d

Browse files
authored
Merge pull request #133 from Cinimex-Informatica/feature/issue122_untyped_metrics
Hundredths type replaced with untyped
2 parents 0434a03 + 1a211ed commit 852f74d

File tree

3 files changed

+20
-18
lines changed

3 files changed

+20
-18
lines changed

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,9 @@ All metrics have predefined structure: domain, subdomain, name, units:
210210

211211
- **Domain** - the first single-word prefix that represents a metric type. The examples of domain-level prefixes are: system, mq, mqobject and etc. More information can be found in ["Domains and subdomains" section](#domains-and-subdomains).
212212
- **Subdomain** - second single-word prefix representation of a metric type. It provides more specific information about metric type and helps to differentiate metrics in a single domain. The examples of subdomain-level prefixes are: cpu, ram, put, subscribe, get and etc. More information can be found in ["Domains and subdomains" section](#domains-and-subdomains).
213-
- **Units** - single-word suffix describing the metric's unit, in plural form. Note that an accumulating count has "total" as the first part of a suffix. The examples of unit suffixes are: percentage, hundredths, messages, totalmessages and etc. More information can be found in ["Units" section](#units).
213+
- **Units** - single-word suffix describing the metric's unit, in plural form. Note that an accumulating count has "total" as the first part of a suffix. The examples of unit suffixes are: percentage, messages, totalmessages and etc. More information can be found in ["Units" section](#units).
214214
- **Name** - represents metric meaning. The examples of a metric name are: cpu_time, cpu_load_fifteen_minute_average, failed_mqget_count and etc. Note that the amount of words in a metric name can vary:
215-
215+
216216
<img src="/docs/images/metric_naming_example_2.png" data-canonical-src="/docs/images/metric_naming_example_2.png" width="899" height="120" />
217217

218218
#### Domains and subdomains
@@ -366,10 +366,6 @@ This section provides a description of metric units.<br/>
366366
<td>Shows %</td>
367367
</tr>
368368
<tr>
369-
<td>hundredths</td>
370-
<td>Shows amount of hundredths. For example, "370 hundredths" equals to "3.70". It is used to reflect system's load average and LISTENER\CHANNEL status codes.</td>
371-
</tr>
372-
<tr>
373369
<td>megabytes</td>
374370
<td>Shows amount of megabytes</td>
375371
</tr>
@@ -421,9 +417,15 @@ This section provides a description of metric units.<br/>
421417
<td>messages</td>
422418
<td>Shows amount of messages.</td>
423419
</tr>
420+
<tr>
421+
<td>untyped</td>
422+
<td>If it's not obvious, what the type of metric is, then this type is used (for example, it is used, to reflect system's load average and LISTENER\CHANNEL status codes). </td>
423+
</tr>
424424
</tbody>
425425
</table>
426426

427+
428+
427429
### Metrics list
428430
#### CPU metrics
429431
###### CPU performance metrics - platform wide
@@ -450,19 +452,19 @@ This section provides a description of CPU- and RAM-related metrics.
450452
<td>System CPU time percentage</td>
451453
</tr>
452454
<tr>
453-
<td>system_cpu_cpu_load_one_minute_average_hundredths</td>
455+
<td>system_cpu_cpu_load_one_minute_average_untyped</td>
454456
<td>gauge</td>
455457
<td>Shows the load average over 1 minute.</td>
456458
<td>CPU load - one minute average</td>
457459
</tr>
458460
<tr>
459-
<td>system_cpu_cpu_load_five_minute_average_hundredths</td>
461+
<td>system_cpu_cpu_load_five_minute_average_untyped</td>
460462
<td>gauge</td>
461463
<td>Shows the load average over 5 minutes.</td>
462464
<td>CPU load - five minute average</td>
463465
</tr>
464466
<tr>
465-
<td>system_cpu_cpu_load_fifteen_minute_average_hundredths</td>
467+
<td>system_cpu_cpu_load_fifteen_minute_average_untyped</td>
466468
<td>gauge</td>
467469
<td>Shows the load average over fifteen minutes.&nbsp;</td>
468470
<td>CPU load - fifteen minute average</td>
@@ -1405,12 +1407,12 @@ This section provides a description of metrics of queues, channels and listeners
14051407
<td>Shows queue fill percentage.</td>
14061408
</tr>
14071409
<tr>
1408-
<td>mqobject_channel_channel_status_hundredths</td>
1410+
<td>mqobject_channel_channel_status_untyped</td>
14091411
<td>gauge</td>
14101412
<td>Shows current channel status. Mapping of channel statuses to prometheus metric values can be found <a href="#channel-status-mapping">here</a>.</td>
14111413
</tr>
14121414
<tr>
1413-
<td>mqobject_listener_listener_status_hundredths</td>
1415+
<td>mqobject_listener_listener_status_untyped</td>
14141416
<td>gauge</td>
14151417
<td>Shows current listener status. Mapping of listener statuses to prometheus metric values can be found <a href="#listener-status-mapping">here</a>.</td>
14161418
</tr>

src/main/java/ru/cinimex/exporter/prometheus/metrics/MetricsReference.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ private static HashMap<String, Metric> getQueueManagerMetricsReference() {
2929
HashMap<String, Metric> metrics = new HashMap<>();
3030
metrics.put("User CPU time percentage", new Metric("system_cpu_user_cpu_time_percentage", Metric.Type.SIMPLE_GAUGE));
3131
metrics.put("System CPU time percentage", new Metric("system_cpu_cpu_time_percentage", Metric.Type.SIMPLE_GAUGE));
32-
metrics.put("CPU load - one minute average", new Metric("system_cpu_cpu_load_one_minute_average_hundredths", Metric.Type.SIMPLE_GAUGE));
33-
metrics.put("CPU load - five minute average", new Metric("system_cpu_cpu_load_five_minute_average_hundredths", Metric.Type.SIMPLE_GAUGE));
34-
metrics.put("CPU load - fifteen minute average", new Metric("system_cpu_cpu_load_fifteen_minute_average_hundredths", Metric.Type.SIMPLE_GAUGE));
32+
metrics.put("CPU load - one minute average", new Metric("system_cpu_cpu_load_one_minute_average_untyped", Metric.Type.SIMPLE_GAUGE));
33+
metrics.put("CPU load - five minute average", new Metric("system_cpu_cpu_load_five_minute_average_untyped", Metric.Type.SIMPLE_GAUGE));
34+
metrics.put("CPU load - fifteen minute average", new Metric("system_cpu_cpu_load_fifteen_minute_average_untyped", Metric.Type.SIMPLE_GAUGE));
3535
metrics.put("RAM free percentage", new Metric("system_ram_ram_free_percentage", Metric.Type.SIMPLE_GAUGE));
3636
metrics.put("RAM total bytes", new Metric("system_ram_ram_total_megabytes", Metric.Type.SIMPLE_GAUGE));
3737
metrics.put("User CPU time - percentage estimate for queue manager", new Metric("mq_cpu_user_cpu_time_estimate_percentage", Metric.Type.SIMPLE_GAUGE));
@@ -125,8 +125,8 @@ private static HashMap<String, Metric> getQueueManagerMetricsReference() {
125125
private static EnumMap<MQObject.MQType, AdditionalMetric> getMqObjectAdditionalMetricsReference() {
126126
EnumMap<MQObject.MQType, AdditionalMetric> metrics = new EnumMap<>(MQObject.MQType.class);
127127
metrics.put(MQObject.MQType.QUEUE, new AdditionalMetric("mqobject_queue_queue_max_depth_messages", "The maximum number of messages that are allowed on the queue"));
128-
metrics.put(MQObject.MQType.CHANNEL, new AdditionalMetric("mqobject_channel_channel_status_hundredths", "The status of the channel"));
129-
metrics.put(MQObject.MQType.LISTENER, new AdditionalMetric("mqobject_listener_listener_status_hundredths", "The status of the listener"));
128+
metrics.put(MQObject.MQType.CHANNEL, new AdditionalMetric("mqobject_channel_channel_status_untyped", "The status of the channel"));
129+
metrics.put(MQObject.MQType.LISTENER, new AdditionalMetric("mqobject_listener_listener_status_untyped", "The status of the listener"));
130130
return metrics;
131131
}
132132

src/test/java/ru/cinimex/exporter/prometheus/metrics/MetricsReferenceTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ void getMetricNameByGeneratingTheNewOne() {
2727
void getMetricNameByType() {
2828
Assertions.assertAll(
2929
() -> assertEquals("mqobject_queue_queue_max_depth_messages", MetricsReference.getMetricName(MQObject.MQType.QUEUE)),
30-
() -> assertEquals("mqobject_channel_channel_status_hundredths", MetricsReference.getMetricName(MQObject.MQType.CHANNEL)),
31-
() -> assertEquals("mqobject_listener_listener_status_hundredths", MetricsReference.getMetricName(MQObject.MQType.LISTENER)));
30+
() -> assertEquals("mqobject_channel_channel_status_untyped", MetricsReference.getMetricName(MQObject.MQType.CHANNEL)),
31+
() -> assertEquals("mqobject_listener_listener_status_untyped", MetricsReference.getMetricName(MQObject.MQType.LISTENER)));
3232
}
3333

3434
@Test

0 commit comments

Comments
 (0)