Skip to content

profiling support #46

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

Open
jdx opened this issue Mar 30, 2025 · 0 comments
Open

profiling support #46

jdx opened this issue Mar 30, 2025 · 0 comments

Comments

@jdx
Copy link
Owner

jdx commented Mar 30, 2025

there should be a way to get information about execution times with hk, something like this json (wall vs cpu for parallelization time):

{
  "wall_ms": 10000,
  "cpu_ms": 20000,
  "job_count": 2,
  "steps": {
    "prettier": {
      "wall_ms": 10000,
      "cpu_ms": 20000,
      "job_count": 2
    }
  }
}

this could be output via the CLI with hk run pre-commit --profile or hk run pre-commit --report. We'd also need to be able to use it inside of a config with events:

events {
  ["report"] = "echo $HK_PROFILE # contains json"
}

or maybe just as a separate step using a tera template:

hooks {
  ["pre-commit"] {
    ["fix"] = new Fix {}
    ["report"] {
      exclusive = true
      env {
        ["HK_REPORT"] = "{{hk_report}}"
      }
      run = "echo $HK_REPORT # contains json"
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant