Merge "Show the time of last data update"

This commit is contained in:
Jenkins
2014-12-25 14:00:55 +00:00
committed by Gerrit Code Review
3 changed files with 9 additions and 4 deletions

View File

@@ -443,8 +443,10 @@ def templated(template=None, return_code=200):
stackalytics_version.version_info.version_string())
ctx['stackalytics_release'] = (
stackalytics_version.version_info.release_string())
ctx['runtime_storage_update_time'] = (
vault_inst['runtime_storage_update_time'])
update_time = vault_inst['runtime_storage_update_time']
ctx['runtime_storage_update_time'] = update_time
ctx['runtime_storage_update_time_str'] = helpers.format_datetime(
update_time) if update_time else None
# deprecated -- top mentor report
ctx['review_nth'] = parameters.get_single_parameter(

View File

@@ -221,7 +221,7 @@ def get_contribution_summary(records):
def format_datetime(timestamp):
return datetime.datetime.utcfromtimestamp(
timestamp).strftime('%d %b %Y %H:%M:%S')
timestamp).strftime('%d %b %Y %H:%M:%S') + ' UTC'
def format_date(timestamp):

View File

@@ -25,10 +25,13 @@ Stackalytics {% if page_title %}| {{ page_title }} {% endif %}
<div class="page">
{% if not runtime_storage_update_time %}
<div class="banner">Please note! The data is being loaded now and may be not complete.</div>
{% set update_time_title = '' %}
{% else %}
{% set update_time_title = 'Last updated on ' + runtime_storage_update_time_str %}
{% endif %}
<div class="aheader">
<div style="float: right; margin-top: 10px; margin-right: 20px;">
<a href="https://wiki.openstack.org/wiki/Stackalytics" target="_blank">About</a>
<a href="https://wiki.openstack.org/wiki/Stackalytics" target="_blank" title="{{ update_time_title }}">About</a>
</div>
<div id="analytics_header">
<div style="float: left;">