[Olsr-dev] JSON info dump complete
Hans-Christoph Steiner
(spam-protected)
Fri May 11 15:59:34 CEST 2012
On May 11, 2012, at 1:52 AM, Henning Rogge wrote:
> On 05/11/2012 04:46 AM, Hans-Christoph Steiner wrote:
>> So far, I mostly just remixed the txtinfo and httpinfo code to produce valid
>> JSON. Now its time to see what doesn't make sense anymore. Sounds like you found
>> something :) Also, I'd really like to have this use key names that make sense
>> and are descriptive, and have the data in a format that is standardized and easy
>> to use. I don't know enough about these guts to know exactly how to do that, so
>> I'm hoping for lots of feedback.
>>
>> I updated the "cost" data points to use the int directly, and I named the JSON
>> keys after the variable names: linkCost, rtpMetricCost, tcEdgeCost, tcPathCost.
>> Are these costs directly comparable? If so, then I'd name them all "cost".
>>
>> As for get_tc_edge_entry_text() and get_link_entry_text(), it seems that each
>> lq_plugin implements the guts differently, some using floats, some ints. So I
>> can't see how to handle that in a generic way.
>
> As the name suggests, the output of both functions is a human readable STRING. Its supposed to be displayed to the user (in a webpage for example). That's why it makes sense to deliver both the "raw" integer value and the texts.
The central goal of the jsoninfo is to deliver the data in a parsable format that is good for programs to read. It is the up to the program that is using the data to represent the data to the user. If people want olsrd-generated human-readable data, they can already use httpinfo and txtinfo.
The data should be represented consistently with each unique data point only represented once. Having multiple representations of the same data point just adds confusion for the person trying to figure out what's what.
Also towards the aim of consistency, I have standardized all time data points to be in milliseconds. If there are other common data types, they should also use the same units. Can anyone point out other such data types? Are various "cost" data points in the same unit? Are they directly comparible? If so, they could all just be called "cost", and then the rest of the info would be conveyed on context within a "routes" array entry, "links" array entry, etc.
.hc
More information about the Olsr-dev
mailing list