Skip to content

Make sure the data returned from Flask-MonitoringDashboard is formatted correctly #200

@InputUsername

Description

@InputUsername

In pydash_app.dashboard.services.fetching:

  • Check if result of /get_json_monitor_rules is formatted correctly:
    • The top level structure is an array
    • The array contains objects that adhere to the right structure:
      • endpoint: string
      • last_accessed: date string, formatted as %Y-%m-%d %H:%M:%S.%f (yyyy-mm-dd hh:mm:ss.micro) OR the string 'None'
      • monitor: boolean
      • time_added: date string, formatted as %Y-%m-%d %H:%M:%S.%f (yyyy-mm-dd hh:mm:ss.micro)
      • version_added: string
  • Check if result of /get_json_data is formatted correctly:
    • The top level structure is an array
    • The array contains objects that adhere to the right structure:
      • endpoint: string
      • execution_time: float
      • time: date string, formatted as %Y-%m-%d %H:%M:%S.%f (yyyy-mm-dd hh:mm:ss.micro)
      • version: string
      • group_by: string
      • ip: string

In order to test this, we can try serving the following data from a remote dashboard:

  • Malformed structure from /get_json_monitor_rules:
    • Top level structure not an array
    • Endpoint objects with missing elements
    • Endpoint objects with wrongly formatted elements (for example: int instead of string, wrongly formatted date/time)
  • Malformed structure from /get_json_data:
    • Top level structure not an array
    • Endpoint call objects with missing elements
    • Endpoint call objects with wrongly formatted elements

Metadata

Metadata

Assignees

No one assigned

    Labels

    back-endThis issue is part of the back-end (Python part) of the application.nice to haveLower priority, nice to have features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions