JSON API #381
Replies: 5 comments 14 replies
-
I suggest the following:
Here are a couple of examples of the current output, and how it would look like in JSON:
|
Beta Was this translation helpful? Give feedback.
-
I'd think it could be helpful to have some use case descriptions. How would you like to use |
Beta Was this translation helpful? Give feedback.
-
I think we need to discuss how we should build the JSON, do we push each update (ping reply) to the console as its own JSON object and expect the receiving script/program to process that as an independent JSON chunk, or do we write it as a simple JSON object that is streamed to the user. I'll explain the differences as a whole Is not parsable as a JSON object. However, each line is. The alternative is to stream it as a JSON array, for example [{"resp": {"host": "1.1.1.1", "seq": 0, "size": 64, "rtt": 13.5, "rttAvg": 13.5, "loss": 0}}, Which is absolutely parsable, however! Its only parsable as a complete object, so once it finishes. Food for thought. |
Beta Was this translation helpful? Give feedback.
-
By the way another use case is errors. Those could also be surfaced as "error" events. |
Beta Was this translation helpful? Give feedback.
-
Just FYI, here is my JSON implementation working in production :) |
Beta Was this translation helpful? Give feedback.
-
Introduction
The new JSON API for fping will be discussed in this section.
There are currently 3 versions, which are partly based on each other
The best version is #380 on which the discussion should be based.
Topics
@schweikert
More content to follow
Beta Was this translation helpful? Give feedback.
All reactions