本文整理汇总了Python中vizgrimoire.report.Report.get_default_filter方法的典型用法代码示例。如果您正苦于以下问题:Python Report.get_default_filter方法的具体用法?Python Report.get_default_filter怎么用?Python Report.get_default_filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vizgrimoire.report.Report
的用法示例。
在下文中一共展示了Report.get_default_filter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: get_studies_data
# 需要导入模块: from vizgrimoire.report import Report [as 别名]
# 或者: from vizgrimoire.report.Report import get_default_filter [as 别名]
def get_studies_data(ds, period, startdate, enddate, evol):
""" Get data from studies to be included in agg and evol global JSONs """
from vizgrimoire.report import Report
data = {}
db_identities = Report.get_config()['generic']['db_identities']
dbuser = Report.get_config()['generic']['db_user']
dbpass = Report.get_config()['generic']['db_password']
studies = Report.get_studies()
metric_filters = Report.get_default_filter()
ds_dbname = ds.get_db_name()
dbname = Report.get_config()['generic'][ds_dbname]
dsquery = ds.get_query_builder()
dbcon = dsquery(dbuser, dbpass, dbname, db_identities)
evol_txt = "evol"
if not evol: evol_txt = "agg"
logging.info("Creating studies for " + ds.get_name() + " " + evol_txt)
for study in studies:
try:
obj = study(dbcon, metric_filters)
if evol:
res = obj.get_ts(ds)
else:
res = obj.get_agg(ds)
if res is not None:
data = dict(res.items() + data.items())
except TypeError:
# logging.info(study.id + " does no support standard API. Not used.")
pass
return data