Skip to content

Add detailed availability stats - track # of failed HTTP requests and display % - #6

Open
rosemarie-o wants to merge 4 commits into
fuzzfactor:mainfrom
rosemarie-o:availability-stats
Open

rosemarie-o wants to merge 4 commits into
fuzzfactor:mainfrom
rosemarie-o:availability-stats

Conversation

@rosemarie-o

Copy link
Copy Markdown

This is currently live on https://ci.ovn.org/#availability

Track the number of total and failed HTTP requests so we can display how heavily requests are failing on the static page.

The reason for doing this is that the current availability stats only track a service as down when every single request the bot makes fails, across many retries. This makes it so those statistics are inaccurate to the user experience. Obviously those stats are still useful though, because it shows when the bot was actually able to get through and make any successful request. But it's also nice to display just how badly requests are failing over time. So this PR adds that, but only for Patchwork, because it's the service with the most downtime.

Fixes #5

The bot sees the end of a request only: one that worked after two
retries looks like one that worked at once.  How often requests to a
service fail on their way tells how it is doing even while the bot
gets through.

Add Options.OnTry, called after each try of a request with whether it
failed: on a network error, a timeout or a transient status, which are
5xx, 429 and a rate-limited 403.  Other statuses, 404 included, are
answers to the bot's own mistakes and count as working.  Tries ended
by the context or by bot protection say nothing about the service and
are not reported.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
The availability page shows when Patchwork was unavailable to the bot,
but not how often its requests failed and were retried before one
worked, which is how Patchwork felt to use most of the time.

Count the tries of the bot's requests to Patchwork, and those that
failed, by hour in the availability state, so that the pages get them
with the periods.  Hours of the days that ended more than a week ago
are merged into a count for the UTC day, and counts are kept for 31
days, so the state stays small.  This bumps the state schema to 15;
the counts are optional, and state saved before loads without them.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
The share of time a service was available in a window was taken over
the whole window, so a bot that started recording a day ago showed a
month of availability it never saw.

Take it over the part of the window since the bot started recording
availability, and show none for a window without any.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
Next to the time Patchwork was unavailable in each window, show the
share of the bot's requests to it that worked, retries included, from
the counts by hour and by day that overlap the window.  It is rounded
down to whole percent, so that it shows 100% only when none failed,
and goes from yellow to red the more failed.  The title tells how many
tries it is out of.

Fit the columns of the summary to their contents, with the minutes and
the percentages aligned, so that the timeline takes the space left.

Signed-off-by: Rosemarie O'Riorden <rosemarie@redhat.com>
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

Successfully merging this pull request may close these issues.

Availability stats aren't accurate to user experience

1 participant