HighlanderRobotics / Scouting-Server

1 stars 1 forks source link

Normalize overview an metric responses #12

Closed MangoSwirl closed 1 year ago

MangoSwirl commented 1 year ago

Right now, the names of data in overview an metric responses don't follow a specific convention.

Examples

  1. cargoAccuracy in overview

    "cargoAccuracy": {
     "result": 0.8518518518518519,
     "team": "8033"
    }

    defenseQuantity in overview

    "defenseQuantity": 0

    The value for cargoAccuracy is stored as a key called result in an object, whereas defenseQuantity is stored directly as the value.

    Preferred format: Since the overview page only shows one value for each metric, I would prefer if all of the metrics followed the format of defenseQuantity and defenseQuality.

  2. defenseQuantity result

    {
     "defenseQuantityAverage": 0,
     "defenseQuantityArray": [
       0,
       0,
       0
     ],
     "team": "8033"
    }

    defenseQuality result

    {
     "defenseQualityAverage": 0,
     "defenseQualityArray": [
       0,
       0,
       0
     ],
     "team": "8033"
    }

    The average for defenseQuantity is stored under defenseQuantityAverage whereas the average for defenseQuality is stored under defenseQualityAverage. While this is logical, it is not necessary as the response is linked to the request which already includes it.

    Preferred format:

    {
     "value": 0,
     "valueMatches": [
       0,
       0,
       0
     ],
     // Other data from #9
    }

In these situations, much more code on the dashboard app could be reused if each used the same format.


Edit: updated with preferred formats