[WIP] Added translation metric

Translation stats are retrieved from Zanata service. List of projects
and versions is taken from Zanata API. List of users is configured
in openstack/i18n repo and referred by URI.

Processor reads stats for every project-version-user-week and yields
records of new type 'tr'. UI is extended to show breakdown by languages.

Zanata module is based on https://review.openstack.org/#/c/275145/

Co-Authored-By: daisy-ycguo <guoyingc@cn.ibm.com>
Co-Authored-By: Akihiro Motoki <amotoki@gmail.com>

Change-Id: Ic1b44f09f7eb592d75d435f66a71d3110a2f49a5
This commit is contained in:
Ilya Shakhat
2016-02-15 17:13:42 +03:00
parent 00912c1941
commit bc434a6d14
16 changed files with 293 additions and 17 deletions

View File

@@ -34,6 +34,7 @@ from stackalytics.processor import record_processor
from stackalytics.processor import runtime_storage
from stackalytics.processor import utils
from stackalytics.processor import vcs
from stackalytics.processor import zanata
LOG = logging.getLogger(__name__)
@@ -180,6 +181,15 @@ def _process_mail_list(uri, runtime_storage_inst, record_processor_inst):
runtime_storage_inst.set_records(processed_mail_iterator)
def _process_translation_stats(runtime_storage_inst, record_processor_inst):
translation_iterator = zanata.log(runtime_storage_inst,
cfg.CONF.translation_team_uri)
translation_iterator_typed = _record_typer(translation_iterator, 'i18n')
processed_translation_iterator = record_processor_inst.process(
translation_iterator_typed)
runtime_storage_inst.set_records(processed_translation_iterator)
def _process_member_list(uri, runtime_storage_inst, record_processor_inst):
member_iterator = mps.log(uri, runtime_storage_inst,
cfg.CONF.days_to_update_members,
@@ -227,6 +237,9 @@ def process(runtime_storage_inst, record_processor_inst):
_process_mail_list(mail_list, runtime_storage_inst,
record_processor_inst)
LOG.info('Processing translations stats')
_process_translation_stats(runtime_storage_inst, record_processor_inst)
_post_process_records(record_processor_inst, repos)