cloud-bulldozer / orion

The constellation of a hunter
Apache License 2.0
4 stars 8 forks source link

Json output #21

Closed shashank-boyapally closed 1 month ago

shashank-boyapally commented 5 months ago

Type of change

Description

Some of the changes are from metadata change PR please ignore them. We output the change point detection in a tabular form which was inherently provided by hunter. Now we provide it as a json output in stdout with the use of the flag --output or -o, this flag defaults to text and can be set to json. Below is a concise version of the json output. This does not change the csv file output. This PR aims to just provide the logic for json output, this will be separated in daemon mode.

[{
        "uuid": "5b06c830-be55-4c84-b4da-92720b55c304",
        "timestamp": 1701866097,
        "metrics": {
            "etcdDisk_duration_avg": {
                "value": 0.0134358362,
                "percentage_change": 0
            },
            "P99": {
                "value": 13000,
                "percentage_change": 0
            },
            "etcdCPU_cpu_avg": {
                "value": 8.6963812859,
                "percentage_change": 0
            },
            "ovnCPU_cpu_avg": {
                "value": 2.8599566281,
                "percentage_change": 0
            },
            "apiserverCPU_cpu_avg": {
                "value": 11.0500421666,
                "percentage_change": 0
            }
        },
        "is_changepoint": false
    },
    {
        "uuid": "c5f95336-27d4-4615-94c1-d618e975a36b",
        "timestamp": 1703075837,
        "metrics": {
            "etcdDisk_duration_avg": {
                "value": 0.0137848279,
                "percentage_change": 42.39053258714572
            },
            "P99": {
                "value": 13000,
                "percentage_change": 0
            },
            "etcdCPU_cpu_avg": {
                "value": 8.2014834841,
                "percentage_change": 0
            },
            "ovnCPU_cpu_avg": {
                "value": 2.7795422015,
                "percentage_change": 0
            },
            "apiserverCPU_cpu_avg": {
                "value": 10.9252901816,
                "percentage_change": 0
            }
        },
        "is_changepoint": true
    },]

Related Tickets & Documents

Checklist before requesting a review

Testing

jtaleric commented 4 months ago

Can we add some additional data to the JSON like the build, platform, cni, etc?

shashank-boyapally commented 4 months ago

Thank you for the suggestion @jtaleric, will be adding and pushing the changes.