<div dir="ltr">I don'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"><<a href="mailto:lkrejci@redhat.com" target="_blank">lkrejci@redhat.com</a>></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="">> Shouldn't we standardize on what Hawkular Metrics uses? 'gauge', 'counter',<br>
> 'availability'<br>
><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>
> 2016-08-16 17:53 GMT+02:00 Lukas Krejci <<a href="mailto:lkrejci@redhat.com">lkrejci@redhat.com</a>>:<br>
> > Hi all,<br>
> ><br>
> > while working on [1] I came across an incosistency in how the data type of<br>
> > a<br>
> > metric type (i.e. gauge, availability, counter, ...) are stored and<br>
> > presented.<br>
> ><br>
> > When you read a metric type using the REST API, you get something like<br>
> > this<br>
> > back (some fields ommitted for brevity):<br>
> ><br>
> > {<br>
> ><br>
> > "path" : "/t;tnt/mt;myMetricType",<br>
> > "unit" : "NONE",<br>
> > "type" : "GAUGE",<br>
> > "collectionInterval" : 0,<br>
> > "id" : "myMetricType"<br>
> ><br>
> > }<br>
> ><br>
> > The metric data type is called "type" here (somewhat confusingly) and<br>
> > contains<br>
> > the value in upper case.<br>
> ><br>
> > If you wanted to filter by it, prior to fix to the above mentioned JIRA,<br>
> > you<br>
> > had to:<br>
> ><br>
> > /traversal/...;propertyName=__<wbr>metric_data_type;<wbr>propertyValue=gauge<br>
> ><br>
> > Notice 2 things:<br>
> > * the name of the property is different<br>
> > * the value is in lower case<br>
> ><br>
> > Now the question is how to bring order to this mess. Because the ideal fix<br>
> > will break the format of the data, I'd like to discuss this with the rest<br>
> > of<br>
> > the team so that we come to a compromise that will amount to the least<br>
> > amount<br>
> > of work for all the inventory clients.<br>
> ><br>
> > There are 2 obvious problems here:<br>
> > 1) the mismatch between the property name in the JSON output and the<br>
> > property<br>
> > name used when querying<br>
> > 2) the mismatch of the letter case in JSON output and queried property<br>
> > value<br>
> ><br>
> > For 1) I'd like rename BOTH the JSON output and queried property name to<br>
> > "metricDataType". We can't "type" because its already taken to mean the<br>
> > type<br>
> > of the entity and we can't use "__metric_data_type" because it's<br>
> > inconsistent<br>
> > with the rest of the properties.<br>
> ><br>
> > For 2) I'd like to consolidate on the upper case usage because that's the<br>
> > default Jackson serialization of the enum.<br>
> ><br>
> > Both of these (and especially 1)) can break existing clients.<br>
> ><br>
> > What would be the path of least resistance for your usecase?<br>
> ><br>
> > [1] <a href="https://issues.jboss.org/browse/HWKINVENT-192" rel="noreferrer" target="_blank">https://issues.jboss.org/<wbr>browse/HWKINVENT-192</a><br>
> ><br>
> > Thanks,<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>
<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>