<div dir="ltr">I don&#39;t believe Metrics manages units. If it does I would expect user can submit values ignoring case.<br></div><div class="gmail_extra"><br><div class="gmail_quote">2016-08-17 11:32 GMT+02:00 Lukas Krejci <span dir="ltr">&lt;<a href="mailto:lkrejci@redhat.com" target="_blank">lkrejci@redhat.com</a>&gt;</span>:<br><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>
</span><span class="">&gt; Shouldn&#39;t we standardize on what Hawkular Metrics uses? &#39;gauge&#39;, &#39;counter&#39;,<br>
&gt; &#39;availability&#39;<br>
&gt;<br>
<br>
</span>Which brings me to another question... How do you represent units of the<br>
metrics, if at all?<br>
<br>
Inventory right now uses again an uppercase representation of them defined in<br>
<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">https://github.com/hawkular/<wbr>hawkular-inventory/blob/<wbr>master/hawkular-inventory-api/<wbr>src/main/java/org/hawkular/<wbr>inventory/api/model/<wbr>MetricUnit.java</a><br>
<div class="HOEnZb"><div class="h5"><br>
&gt; 2016-08-16 17:53 GMT+02:00 Lukas Krejci &lt;<a href="mailto:lkrejci@redhat.com">lkrejci@redhat.com</a>&gt;:<br>
&gt; &gt; Hi all,<br>
&gt; &gt;<br>
&gt; &gt; while working on [1] I came across an incosistency in how the data type of<br>
&gt; &gt; a<br>
&gt; &gt; metric type (i.e. gauge, availability, counter, ...) are stored and<br>
&gt; &gt; presented.<br>
&gt; &gt;<br>
&gt; &gt; When you read a metric type using the REST API, you get something like<br>
&gt; &gt; this<br>
&gt; &gt; back (some fields ommitted for brevity):<br>
&gt; &gt;<br>
&gt; &gt; {<br>
&gt; &gt;<br>
&gt; &gt;   &quot;path&quot; : &quot;/t;tnt/mt;myMetricType&quot;,<br>
&gt; &gt;   &quot;unit&quot; : &quot;NONE&quot;,<br>
&gt; &gt;   &quot;type&quot; : &quot;GAUGE&quot;,<br>
&gt; &gt;   &quot;collectionInterval&quot; : 0,<br>
&gt; &gt;   &quot;id&quot; : &quot;myMetricType&quot;<br>
&gt; &gt;<br>
&gt; &gt; }<br>
&gt; &gt;<br>
&gt; &gt; The metric data type is called &quot;type&quot; here (somewhat confusingly) and<br>
&gt; &gt; contains<br>
&gt; &gt; the value in upper case.<br>
&gt; &gt;<br>
&gt; &gt; If you wanted to filter by it, prior to fix to the above mentioned JIRA,<br>
&gt; &gt; you<br>
&gt; &gt; had to:<br>
&gt; &gt;<br>
&gt; &gt; /traversal/...;propertyName=__<wbr>metric_data_type;<wbr>propertyValue=gauge<br>
&gt; &gt;<br>
&gt; &gt; Notice 2 things:<br>
&gt; &gt; * the name of the property is different<br>
&gt; &gt; * the value is in lower case<br>
&gt; &gt;<br>
&gt; &gt; Now the question is how to bring order to this mess. Because the ideal fix<br>
&gt; &gt; will break the format of the data, I&#39;d like to discuss this with the rest<br>
&gt; &gt; of<br>
&gt; &gt; the team so that we come to a compromise that will amount to the least<br>
&gt; &gt; amount<br>
&gt; &gt; of work for all the inventory clients.<br>
&gt; &gt;<br>
&gt; &gt; There are 2 obvious problems here:<br>
&gt; &gt; 1) the mismatch between the property name in the JSON output and the<br>
&gt; &gt; property<br>
&gt; &gt; name used when querying<br>
&gt; &gt; 2) the mismatch of the letter case in JSON output and queried property<br>
&gt; &gt; value<br>
&gt; &gt;<br>
&gt; &gt; For 1) I&#39;d like rename BOTH the JSON output and queried property name to<br>
&gt; &gt; &quot;metricDataType&quot;. We can&#39;t &quot;type&quot; because its already taken to mean the<br>
&gt; &gt; type<br>
&gt; &gt; of the entity and we can&#39;t use &quot;__metric_data_type&quot; because it&#39;s<br>
&gt; &gt; inconsistent<br>
&gt; &gt; with the rest of the properties.<br>
&gt; &gt;<br>
&gt; &gt; For 2) I&#39;d like to consolidate on the upper case usage because that&#39;s the<br>
&gt; &gt; default Jackson serialization of the enum.<br>
&gt; &gt;<br>
&gt; &gt; Both of these (and especially 1)) can break existing clients.<br>
&gt; &gt;<br>
&gt; &gt; What would be the path of least resistance for your usecase?<br>
&gt; &gt;<br>
&gt; &gt; [1] <a href="https://issues.jboss.org/browse/HWKINVENT-192" rel="noreferrer" target="_blank">https://issues.jboss.org/<wbr>browse/HWKINVENT-192</a><br>
&gt; &gt;<br>
&gt; &gt; Thanks,<br>
&gt; &gt;<br>
&gt; &gt; --<br>
&gt; &gt; Lukas Krejci<br>
&gt; &gt; ______________________________<wbr>_________________<br>
&gt; &gt; hawkular-dev mailing list<br>
&gt; &gt; <a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a><br>
&gt; &gt; <a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/hawkular-dev</a><br>
<br>
<br>
--<br>
Lukas Krejci<br>
______________________________<wbr>_________________<br>
hawkular-dev mailing list<br>
<a href="mailto:hawkular-dev@lists.jboss.org">hawkular-dev@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/hawkular-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/hawkular-dev</a><br>
</div></div></blockquote></div><br></div>