def main(): # init conf and logging conf = cfg.CONF conf.register_cli_opts(config.OPTS) conf.register_cli_opts(OPTS) conf.register_opts(config.OPTS) conf.register_opts(OPTS) conf() logging.setup('stackalytics') LOG.info('Logging enabled') memcached_inst = _connect_to_memcached(cfg.CONF.runtime_storage_uri) filename = cfg.CONF.file if cfg.CONF.restore: if filename: fd = open(filename, 'r') else: fd = sys.stdin import_data(memcached_inst, fd) else: if filename: fd = open(filename, 'w') else: fd = sys.stdout export_data(memcached_inst, fd)
def main(): # init conf and logging conf = cfg.CONF conf.register_cli_opts(config.OPTS) conf.register_opts(config.OPTS) conf() logging.setup('stackalytics') LOG.info('Logging enabled') runtime_storage_inst = runtime_storage.get_runtime_storage( cfg.CONF.runtime_storage_uri) default_data = utils.read_json_from_uri(cfg.CONF.default_data_uri) if not default_data: LOG.critical('Unable to load default data') return not 0 default_data_processor.process(runtime_storage_inst, default_data, cfg.CONF.sources_root, cfg.CONF.force_update) process_program_list(runtime_storage_inst, cfg.CONF.program_list_uri) update_pids(runtime_storage_inst) record_processor_inst = record_processor.RecordProcessor( runtime_storage_inst) update_records(runtime_storage_inst, record_processor_inst) apply_corrections(cfg.CONF.corrections_uri, runtime_storage_inst) # long operation should be the last update_members(runtime_storage_inst, record_processor_inst)
def main(): # init conf and logging conf = cfg.CONF conf.register_cli_opts(config.OPTS) conf.register_opts(config.OPTS) conf() logging.setup('stackalytics') LOG.info('Logging enabled') runtime_storage_inst = runtime_storage.get_runtime_storage( cfg.CONF.runtime_storage_uri) default_data = utils.read_json_from_uri(cfg.CONF.default_data_uri) if not default_data: LOG.critical('Unable to load default data') return not 0 default_data_processor.process(runtime_storage_inst, default_data, cfg.CONF.sources_root) update_pids(runtime_storage_inst) update_repos(runtime_storage_inst) apply_corrections(cfg.CONF.corrections_uri, runtime_storage_inst)
def main(): # init conf and logging conf = cfg.CONF conf.register_cli_opts(OPTS) conf.register_opts(OPTS) conf() logging.setup('stackalytics') LOG.info('Logging enabled') persistent_storage = PersistentStorageFactory.get_storage( cfg.CONF.persistent_storage_uri) if conf.sync_default_data or conf.force_sync_default_data: LOG.info('Going to synchronize persistent storage with default data ' 'from file %s' % cfg.CONF.default_data) persistent_storage.sync(cfg.CONF.default_data, force=conf.force_sync_default_data) return 0 runtime_storage = RuntimeStorageFactory.get_storage( cfg.CONF.runtime_storage_uri) update_pids(runtime_storage) update_repos(runtime_storage, persistent_storage)
def main(): conf_file = os.getenv('STACKALYTICS_CONF') if conf_file and os.path.isfile(conf_file): conf(default_config_files=[conf_file]) app.config['DEBUG'] = cfg.CONF.debug LOG.info('Stackalytics.dashboard is configured via "%s"', conf_file) else: conf(project='stackalytics') logging.setup('stackalytics.dashboard') app.run(cfg.CONF.listen_host, cfg.CONF.listen_port)
def main(): # init conf and logging conf = cfg.CONF conf.register_cli_opts(config.OPTS) conf.register_opts(config.OPTS) conf(project='stackalytics') logging.setup('stackalytics') LOG.info('Logging enabled') runtime_storage_inst = runtime_storage.get_runtime_storage( cfg.CONF.runtime_storage_uri) default_data = utils.read_json_from_uri(cfg.CONF.default_data_uri) if not default_data: LOG.critical('Unable to load default data') return not 0 gerrit = rcs.get_rcs(None, cfg.CONF.review_uri) gerrit.setup(key_filename=cfg.CONF.ssh_key_filename, username=cfg.CONF.ssh_username) default_data_processor.process(runtime_storage_inst, default_data, cfg.CONF.git_base_uri, gerrit, cfg.CONF.driverlog_data_uri) process_program_list(runtime_storage_inst, cfg.CONF.program_list_uri) update_pids(runtime_storage_inst) record_processor_inst = record_processor.RecordProcessor( runtime_storage_inst) process(runtime_storage_inst, record_processor_inst) apply_corrections(cfg.CONF.corrections_uri, runtime_storage_inst) # 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'))
} DEFAULT_RECORDS_LIMIT = 10 # Application objects --------- app = flask.Flask(__name__) app.config.from_object(__name__) app.config.from_envvar('DASHBOARD_CONF', silent=True) LOG = logging.getLogger(__name__) conf = cfg.CONF conf.register_opts(config.OPTS) logging.setup('dashboard') LOG.info('Logging enabled') conf_file = os.getenv('STACKALYTICS_CONF') if conf_file and os.path.isfile(conf_file): conf(default_config_files=[conf_file]) app.config['DEBUG'] = cfg.CONF.debug else: LOG.warn('Conf file is empty or not exist') def get_vault(): vault = getattr(app, 'stackalytics_vault', None) if not vault: try: vault = {}
'marks': 'Reviews', } DEFAULT_RECORDS_LIMIT = 10 # Application objects --------- app = flask.Flask(__name__) app.config.from_object(__name__) app.config.from_envvar('DASHBOARD_CONF', silent=True) LOG = logging.getLogger(__name__) conf = cfg.CONF conf.register_opts(config.OPTS) logging.setup('dashboard') LOG.info('Logging enabled') conf_file = os.getenv('STACKALYTICS_CONF') if conf_file and os.path.isfile(conf_file): conf(default_config_files=[conf_file]) app.config['DEBUG'] = cfg.CONF.debug else: LOG.warn('Conf file is empty or not exist') def get_vault(): vault = getattr(app, 'stackalytics_vault', None) if not vault: try: vault = {}
METRIC_LABELS = {"loc": "Lines of code", "commits": "Commits", "marks": "Reviews"} DEFAULT_RECORDS_LIMIT = 10 # Application objects --------- app = flask.Flask(__name__) app.config.from_object(__name__) app.config.from_envvar("DASHBOARD_CONF", silent=True) LOG = logging.getLogger(__name__) conf = cfg.CONF conf.register_opts(config.OPTS) logging.setup("dashboard") LOG.info("Logging enabled") conf_file = os.getenv("STACKALYTICS_CONF") if conf_file and os.path.isfile(conf_file): conf(default_config_files=[conf_file]) app.config["DEBUG"] = cfg.CONF.debug else: LOG.warn("Conf file is empty or not exist") def get_vault(): vault = getattr(app, "stackalytics_vault", None) if not vault: try: vault = {}