Change performance stats to be 2 decimal places

We are starting to see lots of 100.0%s in the current table
and we think this looks suspiciously too good so think it is
beneficial to change it to be 2dp such that we get a few more
non 100.0% values.

This will put all the values in to having 2dp, however it will
also require the API to have a change to
https://github.com/alphagov/notifications-api/blob/master/app/performance_dashboard/rest.py#L81
where it is currently losing the granularity down to a single
decimal place (meaning that if we were really at 99.894% then that
would be shown on the page as 99.90% rather than 99.89%). However,
I don't think it is a blocker that we get that sorted before this
can be merged.
This commit is contained in:
David McDonald
2021-11-25 14:49:38 +00:00
parent ded7fa524f
commit 30330d86b1
2 changed files with 17 additions and 17 deletions

View File

@@ -88,7 +88,7 @@
<div class="govuk-grid-row"> <div class="govuk-grid-row">
<div class="govuk-grid-column-one-half"> <div class="govuk-grid-column-one-half">
{{ big_number( {{ big_number(
'{:.1f}%'.format(average_percentage_under_10_seconds), '{:.2f}%'.format(average_percentage_under_10_seconds),
label='on average', label='on average',
) }} ) }}
</div> </div>
@@ -107,7 +107,7 @@
{{ item.date | format_date_normal }} {{ item.date | format_date_normal }}
{% endcall %} {% endcall %}
{% call field() %} {% call field() %}
{{ item.percentage_under_10_seconds }}% {{ '{:.2f}%'.format(item.percentage_under_10_seconds) }}
{% endcall %} {% endcall %}
{% endcall %} {% endcall %}
<p class="table-show-more-link"> <p class="table-show-more-link">

View File

@@ -47,31 +47,31 @@ def _get_example_performance_data():
"processing_time": [ "processing_time": [
{ {
"date": "2021-02-21", "date": "2021-02-21",
"percentage_under_10_seconds": 99.2 "percentage_under_10_seconds": 99.25
}, },
{ {
"date": "2021-02-22", "date": "2021-02-22",
"percentage_under_10_seconds": 95.3 "percentage_under_10_seconds": 95.30
}, },
{ {
"date": "2021-02-23", "date": "2021-02-23",
"percentage_under_10_seconds": 95.6 "percentage_under_10_seconds": 95.0
}, },
{ {
"date": "2021-02-24", "date": "2021-02-24",
"percentage_under_10_seconds": 96.7 "percentage_under_10_seconds": 100.0
}, },
{ {
"date": "2021-02-25", "date": "2021-02-25",
"percentage_under_10_seconds": 95.7 "percentage_under_10_seconds": 99.99
}, },
{ {
"date": "2021-02-26", "date": "2021-02-26",
"percentage_under_10_seconds": 96.5 "percentage_under_10_seconds": 100.0
}, },
{ {
"date": "2021-02-27", "date": "2021-02-27",
"percentage_under_10_seconds": 98.6 "percentage_under_10_seconds": 98.60
}, },
], ],
"services_using_notify": [ "services_using_notify": [
@@ -144,16 +144,16 @@ def test_should_render_performance_page(
'Only showing the last 7 days ' 'Only showing the last 7 days '
'' ''
'Messages sent within 10 seconds ' 'Messages sent within 10 seconds '
'96.8% on average ' '98.31% on average '
'Messages sent within 10 seconds ' 'Messages sent within 10 seconds '
'Date Percentage ' 'Date Percentage '
'27 February 2021 98.6% ' '27 February 2021 98.60% '
'26 February 2021 96.5% ' '26 February 2021 100.00% '
'25 February 2021 95.7% ' '25 February 2021 99.99% '
'24 February 2021 96.7% ' '24 February 2021 100.00% '
'23 February 2021 95.6% ' '23 February 2021 95.00% '
'22 February 2021 95.3% ' '22 February 2021 95.30% '
'21 February 2021 99.2% ' '21 February 2021 99.25% '
'Only showing the last 7 days ' 'Only showing the last 7 days '
'' ''
'Organisations using Notify ' 'Organisations using Notify '