-
Notifications
You must be signed in to change notification settings - Fork 291
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
Calculate OnCall schedule quality #118
Comments
@Matvey-Kuk you want to calculate schedule's score or per-user score? |
@Konstantinov-Innokentii schedule's score |
@Konstantinov-Innokentii We want to provide overall schedule quality. |
@Matvey-Kuk I propose to use a slightly different formula for balance score calculation:
It should eliminate the issue with hours distributions like |
This PR adds an endpoint returning a schedule quality score, overloaded users and comments on the existing issues (e.g. balance issues or gaps). ## Limitations - Since working hours editor is not implemented yet, there are only two scores taken into account: balance score and a score representing the ratio of time when someone is on-call to the whole time period. - Time period is now set to be constant (90 days from today), so **in some cases the results will be inaccurate** (when rotations don't align with the time period) - It only takes primary rotations into account (overrides are ignored) ## Usage `GET /api/internal/v1/schedules/<pk>/quality?date=<TOMORROW_DATE>` Note that `date` should be tomorrow date, because we can only be sure about changing tomorrow's shifts (some of the shifts for current day could be "deleted" but still show up in the UI). ## Example response ```json { "total_score": 90, "comments": ["Schedule has no gaps", "Schedule is well-balanced, but still can be improved"], "overloaded_users": ["USSZ5WRH2CUA9", "U74XJZSSQGBIH"] } ``` Issue: #118
Frontend is implemented but waiting for a minor backend change to differentiate good remarks from warnings within the api response. Once that is done we can unblock the frontend, because right now on frontend we cannot differentiate info messages (like 'Good schedule') from warnings ('Gaps') as described in the mockups. PR for it #1324 |
# What this PR does Changes the schedule quality API so it also returns types of comments (this is needed to address #118 (comment)). ## Which issue(s) this PR fixes Related to #118 ## Checklist - [x] Tests updated
# What this PR does #118 ## Checklist - [x] Tests updated - [ ] Documentation added - [x] `CHANGELOG.md` updated
# What this PR does #118 ## Checklist - [x] Tests updated - [ ] Documentation added - [x] `CHANGELOG.md` updated
# What this PR does Related to grafana/irm#99 ## Which issue(s) this PR closes Closes #4991
Alice, Bob, Sam are on call. I think it would be nice to show some "schedule quality" to help users keep schedules in a good shape.
We're trying to balance on call hours between engineers on call. Balance = 1 is good. Balance = 0 is bad.
We're trying to avoid people being on call outside of working hours. At least their on call time outside of working hours should be equal.
We want to avoid gaps in on call schedule. Shift with no users is equal to gap:
The text was updated successfully, but these errors were encountered: