Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds workflow_job_seconds metric (#5)
* server to struct * Intention to support instantiation of server for integration testing. Side effect is improving readability. * Extracts root handler into func. * Error logging handled by main. * extract server and related out of main package * Intention is to test against package interface using server_test package. Couldn't get to work with main_test. * Side effect is improved readability due to less global state. * ghActionsExporter private to package as created in Server setup * adds /metrics integration test * Intention was to improve coverage of http server implementation. * Probably makes more sense to test the handlers directly for most cases. * adds tests for webhook event handler * Backfills tests before behaviour changes. * CheckRun test only checks for 200 due to async behaviour. * upgrade google/go-github/ v33 to v43 * adds test for workflow job queued * observe queued time from in_progress_event Assumes job queue time can be calculated from difference between job start time and start time of first step. Labels: * runner_group to identify queues for specific runners * state queued as durations can also be published for completed jobs * no workflow label as it is not possible to identify workflow without additional API calls * introduces workflowJobObserver to simplify testing * Simplifies testing by moving observation of workflow job metrics under interface. * Leaves other metrics untouched for now, even though inconsistent. * adds test observer to remaining exporter tests * adds integration test for workflow job metrics * Use custom serve mux to allow for creation of multiple servers in integration tests. * updates timeout on test to sensible value * pulls assertion into observation helper struct * observes workflow job duration for in_progress * workflow job queued metric corrected * go mod vendor * go mod tidy * Updates golangci-lint version * corrects hard coded state * adds test for negative queue durations This is possible as it seems step started_at times are rounded to the closest second whereas job started_at time has miliseconds included. * handles skipped jobs without panic * renames workflow_job__seconds to workflow_job_duration_seconds
- Loading branch information