本文整理汇总了Python中vizgrimoire.ITS.ITS._get_backend方法的典型用法代码示例。如果您正苦于以下问题:Python ITS._get_backend方法的具体用法?Python ITS._get_backend怎么用?Python ITS._get_backend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vizgrimoire.ITS.ITS
的用法示例。
在下文中一共展示了ITS._get_backend方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: projects_efficiency
# 需要导入模块: from vizgrimoire.ITS import ITS [as 别名]
# 或者: from vizgrimoire.ITS.ITS import _get_backend [as 别名]
def projects_efficiency(opts, people_out, affs_out):
# BMI and time to review in mean per general project
scr_dbcon = SCRQuery(opts.dbuser, opts.dbpassword, opts.dbreview, opts.dbidentities)
scm_dbcon = SCMQuery(opts.dbuser, opts.dbpassword, opts.dbcvsanaly, opts.dbidentities)
its_dbcon = ITSQuery(opts.dbuser, opts.dbpassword, opts.dbbicho, opts.dbidentities)
projects = integrated_projects(scm_dbcon)
projects_ids = projects["subproject_id"]
projects_list = []
bmi_list = []
time2review_list = []
bmi_its = []
period = "month"
releases = opts.releases.split(",")[-2:]
startdate = "'"+releases[0]+"'"
enddate = "'"+releases[1]+"'"
for project_id in projects_ids:
project_title = "'" + project_id + "'"
type_analysis = ["project", project_id]
project_filters = MetricFilters(period, startdate, enddate, type_analysis, 10,
people_out, affs_out)
scr_bmi = scr.BMISCR(scr_dbcon, project_filters)
time2review = scr.TimeToReview(scr_dbcon, project_filters)
# ITS BMI index
from vizgrimoire.ITS import ITS
ITS.set_backend("launchpad")
if project_id == 'Documentation':
ITS._get_backend().closed_condition = "(new_value='Fix Committed' or new_value='Fix Released')"
else:
ITS.closed_condition = "(new_value='Fix Committed')"
opened = its.Opened(its_dbcon, project_filters)
closed = its.Closed(its_dbcon, project_filters)
tickets_opened = opened.get_agg()["opened"]
tickets_closed = closed.get_agg()["closed"]
its_bmi = 0
if tickets_closed > 0:
its_bmi = round(float(tickets_closed)/float(tickets_opened), 2)
projects_list.append(project_id)
bmi_list.append(round(scr_bmi.get_agg()["bmiscr"], 2))
time2review_list.append(round(time2review.get_agg()["review_time_days_median"], 2))
bmi_its.append(its_bmi)
createCSV({"projects":projects_list, "bmi":bmi_list, "timereview":time2review_list, "bmiits":bmi_its}, "./release/integrated_projects_efficiency.csv")
示例2: result
# 需要导入模块: from vizgrimoire.ITS import ITS [as 别名]
# 或者: from vizgrimoire.ITS.ITS import _get_backend [as 别名]
def result(self, data_source = None):
from vizgrimoire.ITS import ITS
if data_source is not None and data_source != ITS: return None
period = self.filters.period
startdate = self.filters.startdate
enddate = self.filters.enddate
idb = self.db.identities_db
from vizgrimoire.ITS import ITS
backend = ITS._get_backend()
self.CreateViews()
time_to_response = self.ticketsTimeToResponse(period, startdate, enddate, idb, backend)
time_from_opened = self.ticketsTimeOpened(period, startdate, enddate, idb, backend)
return dict(time_to_response.items() + time_from_opened.items())
示例3: create_json
# 需要导入模块: from vizgrimoire.ITS import ITS [as 别名]
# 或者: from vizgrimoire.ITS.ITS import _get_backend [as 别名]
def create_json(dbcon, filters):
ITS.set_backend("jira")
ITS._get_backend().closed_condition = " i.status = 'Closed' "
pullrequests = PullRequests(dbcon, filters)
submitters = Submitters(dbcon, filters)
abandoned = Abandoned(dbcon, filters)
merged = Merged(dbcon, filters)
trackers = Trackers(dbcon, filters)
#timeseries data
data = dict(pullrequests.get_ts().items() +
submitters.get_ts().items() +
abandoned.get_ts().items() +
merged.get_ts().items() +
trackers.get_ts().items())
if filters.type_analysis == []:
createJSON(data, "scr-evolutionary.json")
else:
tracker = filters.type_analysis[1]
tracker = tracker.replace("'", "")
name = tracker.split("/")[-1:][0]
createJSON(data, name + "-scr-evolutionary.json")
#aggregated data
data = dict(pullrequests.get_agg().items() +
submitters.get_agg().items() +
abandoned.get_agg().items() +
merged.get_agg().items() +
trackers.get_agg().items())
enddate = filters.enddate
for i in [7, 365, 0]:
data = dict(data.items() +
pullrequests.get_trends(enddate, i).items() +
submitters.get_trends(enddate, i).items() +
abandoned.get_trends(enddate, i).items() +
merged.get_trends(enddate, i).items() +
trackers.get_trends(enddate, i).items())
if filters.type_analysis == []:
createJSON(data, "scr-static.json")
else:
tracker = filters.type_analysis[1]
tracker = tracker.replace("'", "")
name = tracker.split("/")[-1:][0]
createJSON(data, name + "-scr-static.json")
示例4: result
# 需要导入模块: from vizgrimoire.ITS import ITS [as 别名]
# 或者: from vizgrimoire.ITS.ITS import _get_backend [as 别名]
def result(self, data_source = None):
# FIXME: this import is needed to get the list of
# states available on the tracker. This should be moved
# to configuration file to let the user choose among states.
from vizgrimoire.ITS import ITS
if data_source is not None and data_source != ITS: return None
backend = ITS._get_backend()
if backend.its_type == 'bg':
backend_type = 'bugzilla'
else:
backend_type = backend.its_type
states = self.get_state_types(backend_type)
backlog = self.get_backlog(states, backend_type)
current_states = self.get_current_states(states)
return dict(backlog.items() + current_states.items())
示例5: its_report
# 需要导入模块: from vizgrimoire.ITS import ITS [as 别名]
# 或者: from vizgrimoire.ITS.ITS import _get_backend [as 别名]
def its_report(dbcon, filters):
# Per release its information
from vizgrimoire.ITS import ITS
ITS.set_backend("launchpad")
project_name = filters.type_analysis[1]
project_name = project_name.replace(" ", "")
if project_name == 'Documentation':
ITS._get_backend().closed_condition = "(new_value='Fix Committed' or new_value='Fix Released')"
else:
ITS.closed_condition = "(new_value='Fix Committed')"
opened = its.Opened(dbcon, filters)
createJSON(opened.get_agg(), "./release/its_opened_"+project_name+".json")
closed = its.Closed(dbcon, filters)
createJSON(closed.get_agg(), "./release/its_closed_"+project_name+".json")
dataset = {}
dataset["opened"] = opened.get_agg()["opened"]
dataset["closed"] = closed.get_agg()["closed"]
return dataset
示例6: createJSON
# 需要导入模块: from vizgrimoire.ITS import ITS [as 别名]
# 或者: from vizgrimoire.ITS.ITS import _get_backend [as 别名]
tracker = filters.type_analysis[1]
tracker = tracker.replace("'", "")
name = tracker.split("/")[-1:][0]
createJSON(data, name + "-scr-static.json")
if __name__ == '__main__':
# PYTHONPATH=./:../../:../analysis/:../ python scr_jira_metrics.py
filters = MetricFilters("month", "'2008-10-20'", "'2014-10-01'", [])
dbcon = ITSQuery("root", "", "lcanas_bicho_gerrit_liferay_4444", "lcanas_cvsanaly_liferay_4444")
create_json(dbcon, filters)
ITS.set_backend("jira")
ITS._get_backend().closed_condition = " i.status = 'Closed' "
#per tracker data
trackers = Trackers(dbcon, filters)
trackers_list = trackers.get_list()
trackers_names = []
for tracker in trackers_list["name"]:
tracker_name = tracker.split("/")[-1:][0]
trackers_names.append(tracker_name)
tracker_str = "'" + tracker + "'"
filters = MetricFilters("month", "'2008-10-20'", "'2014-10-01'", ['repository', tracker_str])
create_json(dbcon, filters)
createJSON({"name":trackers_names}, "scr-repos.json")
organizations = Companies(dbcon, filters)
organizations_list = organizations.get_list()