Skip to content

Commit 20b4250

Browse files
committed
Reduced the size of stats data transferred from the server by an order of magnitude for author stats pages by not sending complete lists of item names per table item (we're only displaying them when there are few to display, anyway). Added caching of the resulting stats data for 24 hours. The caching was not possible in all cases before the data reduction, due to an item size limit of 1 MByte in memcached.
- Legacy-Id: 13534
1 parent 91b4063 commit 20b4250

17 files changed

Lines changed: 626 additions & 608 deletions

ietf/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,8 @@ def skip_unreadable_post(record):
883883
"fields.W342", # Setting unique=True on a ForeignKey has the same effect as using a OneToOneField.
884884
]
885885

886+
STATS_NAMES_LIMIT = 25
887+
886888
# Put the production SECRET_KEY in settings_local.py, and also any other
887889
# sensitive or site-specific changes. DO NOT commit settings_local.py to svn.
888890
from settings_local import * # pyflakes:ignore pylint: disable=wildcard-import

ietf/stats/views.py

Lines changed: 607 additions & 591 deletions
Large diffs are not rendered by default.

ietf/templates/stats/document_stats_author_affiliation.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h3>Data</h3>
5353
</tr>
5454
</thead>
5555
<tbody>
56-
{% for affiliation, percentage, names in table_data %}
56+
{% for affiliation, percentage, count, names in table_data %}
5757
<tr>
5858
<td>{{ affiliation|default:"(unknown)" }}</td>
5959
<td>{{ percentage|floatformat:2 }}%</td>

ietf/templates/stats/document_stats_author_citations.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h3>Data</h3>
5858
</tr>
5959
</thead>
6060
<tbody>
61-
{% for citations, percentage, names in table_data %}
61+
{% for citations, percentage, count, names in table_data %}
6262
<tr>
6363
<td>{{ citations }}</td>
6464
<td>{{ percentage|floatformat:2 }}%</td>

ietf/templates/stats/document_stats_author_continent.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h3>Data</h3>
5353
</tr>
5454
</thead>
5555
<tbody>
56-
{% for continent, percentage, names in table_data %}
56+
{% for continent, percentage, count, names in table_data %}
5757
<tr>
5858
<td>{{ continent|default:"(unknown)" }}</td>
5959
<td>{{ percentage|floatformat:2 }}%</td>

ietf/templates/stats/document_stats_author_country.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ <h3>Data</h3>
5353
</tr>
5454
</thead>
5555
<tbody>
56-
{% for country, percentage, names in table_data %}
56+
{% for country, percentage, count, names in table_data %}
5757
<tr>
5858
<td>{{ country|default:"(unknown)" }}</td>
5959
<td>{{ percentage|floatformat:2 }}%</td>

ietf/templates/stats/document_stats_author_documents.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ <h3>Data</h3>
5959
</tr>
6060
</thead>
6161
<tbody>
62-
{% for document_count, percentage, names in table_data %}
62+
{% for document_count, percentage, count, names in table_data %}
6363
<tr>
6464
<td>{{ document_count }}</td>
6565
<td>{{ percentage|floatformat:2 }}%</td>

ietf/templates/stats/document_stats_author_hindex.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h3>Data</h3>
5858
</tr>
5959
</thead>
6060
<tbody>
61-
{% for h_index, percentage, names in table_data %}
61+
{% for h_index, percentage, count, names in table_data %}
6262
<tr>
6363
<td>{{ h_index }}</td>
6464
<td>{{ percentage|floatformat:2 }}%</td>

ietf/templates/stats/document_stats_authors.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ <h3>Data</h3>
5858
</tr>
5959
</thead>
6060
<tbody>
61-
{% for author_count, percentage, names in table_data %}
61+
{% for author_count, percentage, count, names in table_data %}
6262
<tr>
6363
<td>{{ author_count }}</td>
6464
<td>{{ percentage|floatformat:2 }}%</td>

ietf/templates/stats/document_stats_format.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ <h3>Data</h3>
5454
</tr>
5555
</thead>
5656
<tbody>
57-
{% for pages, percentage, names in table_data %}
57+
{% for pages, percentage, count, names in table_data %}
5858
<tr>
5959
<td>{{ pages }}</td>
6060
<td>{{ percentage|floatformat:2 }}%</td>

0 commit comments

Comments
 (0)