Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] add elapsed time in the json schema for all types #631

Open
gabrielcsapo opened this issue Aug 11, 2020 · 2 comments
Open

[feature] add elapsed time in the json schema for all types #631

gabrielcsapo opened this issue Aug 11, 2020 · 2 comments
Assignees
Labels
question Further information is requested

Comments

@gabrielcsapo
Copy link
Contributor

Now that we have standardized the output schema it would be great to include timing information to track how long certain tasks are taking. Then the reporter provider can use that data to either present it or not.

Currently a task has the current schema looks like the following:

https://github.com/checkupjs/checkup/blob/master/packages/core/src/schemas/task-result-schema.json#L63

"properties": {
  "info": {
    "type": "object",
    "properties": {
      "taskName": {
        "type": "string"
      },
      "friendlyTaskName": {
        "type": "string"
      },
      "taskClassification": {
        "type": "object",
        "properties": {
          "category": {
            "type": "string"
          },
          "group": {
            "type": "string"
          }
        },
        "required": ["category"]
      }
    },
    "required": ["taskName", "friendlyTaskName", "taskClassification"]
  }
}

I propose adding a time object to info property:

"time": {
  "type": "object",
  "properties": {
    "elapsed": {
      "type": "number"
    },
  },
}
@scalvert
Copy link
Contributor

I don't believe this makes sense for the JSON schema to contain this information. We do provide a way for task authors to determine how long a task runs,

DEBUG="checkup:task" checkup --task <yourTask>

and I believe this is the right way to think about this. Task authors should be responsible for determining the optimal execution of their tasks, and can do so via debug.

Hope this makes sense.

@scalvert scalvert added the question Further information is requested label Aug 12, 2020
@scalvert scalvert self-assigned this Aug 12, 2020
@scalvert
Copy link
Contributor

@rwjblue any thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants