Show banner when processor is loading data for the first time
The cold start on full set of projects is quite slow. Usually it takes about 3 hours to load all commits, reviews, blueprints and emails, and up to 8 hours to load all members data. During this period users need to be notified that the data is incomplete. Closes bug 1322177 Change-Id: I04432e29e3e7bbfad1a61dc463bd9193e27dde9e
This commit is contained in:
@@ -385,6 +385,8 @@ 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'])
|
||||
|
||||
return flask.render_template(template_name, **ctx), return_code
|
||||
|
||||
|
||||
@@ -480,3 +480,10 @@ div.stackamenu li.current-menu-item a span {
|
||||
.ui-widget-overlay {
|
||||
opacity: 0.6;
|
||||
}
|
||||
|
||||
.banner {
|
||||
text-align: center;
|
||||
background-color: #ECEEF3;
|
||||
font-size: 16px;
|
||||
color: #972D24;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
<meta name="keywords" content="openstack, contribution, community, review, commit, {{ company }}"/>
|
||||
<meta name="version" content="{{ stackalytics_version }}"/>
|
||||
<meta name="build" content="{{ stackalytics_release }}"/>
|
||||
<meta name="runtime_storage_update_time" content="{{ runtime_storage_update_time }}"/>
|
||||
|
||||
<link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic&subset=latin,cyrillic' rel='stylesheet' type='text/css' />
|
||||
<link href='http://fonts.googleapis.com/css?family=PT+Sans+Caption&subset=latin,cyrillic' rel='stylesheet' type='text/css' />
|
||||
@@ -63,9 +64,12 @@
|
||||
{% block body %}
|
||||
|
||||
<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>
|
||||
{% endif %}
|
||||
<div class="aheader">
|
||||
<div style="float: right; margin-top: 10px; margin-right: 20px;">
|
||||
<a href="https://wiki.openstack.org/wiki/Stackalytics">About</a>
|
||||
<a href="https://wiki.openstack.org/wiki/Stackalytics" target="_blank">About</a>
|
||||
</div>
|
||||
<div id="analytics_header">
|
||||
<div style="float: left;">
|
||||
|
||||
@@ -73,6 +73,8 @@ def get_vault():
|
||||
memory_storage_inst = vault['memory_storage']
|
||||
have_updates = memory_storage_inst.update(
|
||||
compact_records(vault['runtime_storage'].get_update(os.getpid())))
|
||||
vault['runtime_storage_update_time'] = (
|
||||
vault['runtime_storage'].get_by_key('runtime_storage_update_time'))
|
||||
|
||||
if have_updates:
|
||||
vault['cache'] = {}
|
||||
|
||||
@@ -294,6 +294,9 @@ def main():
|
||||
# long operation should be the last
|
||||
update_members(runtime_storage_inst, record_processor_inst)
|
||||
|
||||
runtime_storage_inst.set_by_key('runtime_storage_update_time',
|
||||
utils.date_to_timestamp('now'))
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user