<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Metrics does not manage units. Units can be specified as metric tags, but we don’t do any special handling like converting MB —&gt; KB for example.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">On Aug 17, 2016, at 12:48 PM, Thomas Segismont &lt;<a href="mailto:tsegismo@redhat.com" class="">tsegismo@redhat.com</a>&gt; wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">I don't believe Metrics manages units. If it does I would expect user can submit values ignoring case.<br class=""></div><div class="gmail_extra"><br class=""><div class="gmail_quote">2016-08-17 11:32 GMT+02:00 Lukas Krejci <span dir="ltr" class="">&lt;<a href="mailto:lkrejci@redhat.com" target="_blank" class="">lkrejci@redhat.com</a>&gt;</span>:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tuesday, August 16, 2016 6:18:51 PM CEST Thomas Segismont wrote:<br class="">
</span><span class="">&gt; Shouldn't we standardize on what Hawkular Metrics uses? 'gauge', 'counter',<br class="">
&gt; 'availability'<br class="">
&gt;<br class="">
<br class="">
</span>Which brings me to another question... How do you represent units of the<br class="">
metrics, if at all?<br class="">
<br class="">
Inventory right now uses again an uppercase representation of them defined in<br class="">
<a href="https://github.com/hawkular/hawkular-inventory/blob/master/hawkular-inventory-api/src/main/java/org/hawkular/inventory/api/model/MetricUnit.java" rel="noreferrer" target="_blank" class="">https://github.com/hawkular/<wbr class="">hawkular-inventory/blob/<wbr class="">master/hawkular-inventory-api/<wbr class="">src/main/java/org/hawkular/<wbr class="">inventory/api/model/<wbr class="">MetricUnit.java</a><br class="">
<div class="HOEnZb"><div class="h5"><br class="">
&gt; 2016-08-16 17:53 GMT+02:00 Lukas Krejci &lt;<a href="mailto:lkrejci@redhat.com" class="">lkrejci@redhat.com</a>&gt;:<br class="">
&gt; &gt; Hi all,<br class="">
&gt; &gt;<br class="">
&gt; &gt; while working on [1] I came across an incosistency in how the data type of<br class="">
&gt; &gt; a<br class="">
&gt; &gt; metric type (i.e. gauge, availability, counter, ...) are stored and<br class="">
&gt; &gt; presented.<br class="">
&gt; &gt;<br class="">
&gt; &gt; When you read a metric type using the REST API, you get something like<br class="">
&gt; &gt; this<br class="">
&gt; &gt; back (some fields ommitted for brevity):<br class="">
&gt; &gt;<br class="">
&gt; &gt; {<br class="">
&gt; &gt;<br class="">
&gt; &gt;&nbsp; &nbsp;"path" : "/t;tnt/mt;myMetricType",<br class="">
&gt; &gt;&nbsp; &nbsp;"unit" : "NONE",<br class="">
&gt; &gt;&nbsp; &nbsp;"type" : "GAUGE",<br class="">
&gt; &gt;&nbsp; &nbsp;"collectionInterval" : 0,<br class="">
&gt; &gt;&nbsp; &nbsp;"id" : "myMetricType"<br class="">
&gt; &gt;<br class="">
&gt; &gt; }<br class="">
&gt; &gt;<br class="">
&gt; &gt; The metric data type is called "type" here (somewhat confusingly) and<br class="">
&gt; &gt; contains<br class="">
&gt; &gt; the value in upper case.<br class="">
&gt; &gt;<br class="">
&gt; &gt; If you wanted to filter by it, prior to fix to the above mentioned JIRA,<br class="">
&gt; &gt; you<br class="">
&gt; &gt; had to:<br class="">
&gt; &gt;<br class="">
&gt; &gt; /traversal/...;propertyName=__<wbr class="">metric_data_type;<wbr class="">propertyValue=gauge<br class="">
&gt; &gt;<br class="">
&gt; &gt; Notice 2 things:<br class="">
&gt; &gt; * the name of the property is different<br class="">
&gt; &gt; * the value is in lower case<br class="">
&gt; &gt;<br class="">
&gt; &gt; Now the question is how to bring order to this mess. Because the ideal fix<br class="">
&gt; &gt; will break the format of the data, I'd like to discuss this with the rest<br class="">
&gt; &gt; of<br class="">
&gt; &gt; the team so that we come to a compromise that will amount to the least<br class="">
&gt; &gt; amount<br class="">
&gt; &gt; of work for all the inventory clients.<br class="">
&gt; &gt;<br class="">
&gt; &gt; There are 2 obvious problems here:<br class="">
&gt; &gt; 1) the mismatch between the property name in the JSON output and the<br class="">
&gt; &gt; property<br class="">
&gt; &gt; name used when querying<br class="">
&gt; &gt; 2) the mismatch of the letter case in JSON output and queried property<br class="">
&gt; &gt; value<br class="">
&gt; &gt;<br class="">
&gt; &gt; For 1) I'd like rename BOTH the JSON output and queried property name to<br class="">
&gt; &gt; "metricDataType". We can't "type" because its already taken to mean the<br class="">
&gt; &gt; type<br class="">
&gt; &gt; of the entity and we can't use "__metric_data_type" because it's<br class="">
&gt; &gt; inconsistent<br class="">
&gt; &gt; with the rest of the properties.<br class="">
&gt; &gt;<br class="">
&gt; &gt; For 2) I'd like to consolidate on the upper case usage because that's the<br class="">
&gt; &gt; default Jackson serialization of the enum.<br class="">
&gt; &gt;<br class="">
&gt; &gt; Both of these (and especially 1)) can break existing clients.<br class="">
&gt; &gt;<br class="">
&gt; &gt; What would be the path of least resistance for your usecase?<br class="">
&gt; &gt;<br class="">
&gt; &gt; [1] <a href="https://issues.jboss.org/browse/HWKINVENT-192" rel="noreferrer" target="_blank" class="">https://issues.jboss.org/<wbr class="">browse/HWKINVENT-192</a><br class="">
&gt; &gt;<br class="">
&gt; &gt; Thanks,<br class="">
&gt; &gt;<br class="">
&gt; &gt; --<br class="">
&gt; &gt; Lukas Krejci<br class="">
&gt; &gt; ______________________________<wbr class="">_________________<br class="">
&gt; &gt; hawkular-dev mailing list<br class="">
&gt; &gt; <a href="mailto:hawkular-dev@lists.jboss.org" class="">hawkular-dev@lists.jboss.org</a><br class="">
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank" class="">https://lists.jboss.org/<wbr class="">mailman/listinfo/hawkular-dev</a><br class="">
<br class="">
<br class="">
--<br class="">
Lukas Krejci<br class="">
______________________________<wbr class="">_________________<br class="">
hawkular-dev mailing list<br class="">
<a href="mailto:hawkular-dev@lists.jboss.org" class="">hawkular-dev@lists.jboss.org</a><br class="">
<a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank" class="">https://lists.jboss.org/<wbr class="">mailman/listinfo/hawkular-dev</a><br class="">
</div></div></blockquote></div><br class=""></div>
_______________________________________________<br class="">hawkular-dev mailing list<br class=""><a href="mailto:hawkular-dev@lists.jboss.org" class="">hawkular-dev@lists.jboss.org</a><br class="">https://lists.jboss.org/mailman/listinfo/hawkular-dev<br class=""></div></blockquote></div><br class=""></div></body></html>