Re: [Automated-testing] KCIDB: Support non-binary test outputs V3

Nikolai Kondrashov <[email protected]>
Newsgroups dev.linux.lists.kernelci
Message-ID <[email protected]>
On 8/16/24 1:03 PM, Nikolai Kondrashov wrote:
> On 8/5/24 2:28 PM, Nikolai Kondrashov wrote:
>>> I'll follow up with a separate message for each of the changes, going over the
>>> details and the rationale.
>>
>> The support for non-binary test outputs introduces a new field to the "test"
>> objects called "value", being an "object" itself. It (and its abstract
>> meaning) are supposed to work together with the "status" field. That is, it
>> should only be considered when the test has actually executed. I.e. with a
>> "FAIL", "ERROR", "PASS", or "DONE" status only. Normally "DONE" should be
>> used, when the value is the test's output, and not an auxiliary value.
> 
> Alright, I redid support for non-binary test outputs:
> 
> https://github.com/kernelci/kcidb-io/pull/85/commits/040a20db407f2592c28c3797cec9e4118221af9c

Aaand, redone again:

https://github.com/kernelci/kcidb-io/pull/85/commits/86b75f6bf6e4f74e594a301382f2b77cfe4cbbd9

I switched the value from integer to floating-point, as that allows us to get
rid of the exponent field, at the cost of a small accuracy loss. The storage
requirements are still 64 bits.

These values are intended for analysis and tracking first of all, and small
inaccuracy would have little effect on them. If you want to store the exact
measured value, you can put it into the "misc" field.

OTOH, this makes it much easier and faster to run queries on the values.

Here's the new (abbreviated schema):

    "number": {
        "type": "object",
        "properties": {
            "value": {"type": "number"},
            "unit": {"type": "string"},
            "prefix": {
                "type": "string",
                "enum": ["metric", "binary"],
            },
        },
        "required": ["value"],
        "additionalProperties": False,
    }

And the rewritten examples:

    "value": 42,
    # Display: 42

    "value": 3.14159,
    # Display: 3.14159

    "value": 720,
    "unit": "KB",
    # Display: 720 KB

    "value": 145000,
    "prefix": "metric"
    # Display: 145 K

    "value": 1.6e-7,
    "unit": "s",
    "prefix": "metric",
    # Display: 160 ns

    "value": 5.12e5,
    "unit": "B",
    "prefix": "binary",
    # Display: 500 KiB

Send comments!
Thank you.
Nick
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.