本文整理匯總了Python中vizgrimoire.ITS.ITS.set_backend方法的典型用法代碼示例。如果您正苦於以下問題:Python ITS.set_backend方法的具體用法?Python ITS.set_backend怎麽用?Python ITS.set_backend使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類vizgrimoire.ITS.ITS
的用法示例。
在下文中一共展示了ITS.set_backend方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: projects_efficiency
# 需要導入模塊: from vizgrimoire.ITS import ITS [as 別名]
# 或者: from vizgrimoire.ITS.ITS import set_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: create_json
# 需要導入模塊: from vizgrimoire.ITS import ITS [as 別名]
# 或者: from vizgrimoire.ITS.ITS import set_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")
示例3: its_report
# 需要導入模塊: from vizgrimoire.ITS import ITS [as 別名]
# 或者: from vizgrimoire.ITS.ITS import set_backend [as 別名]
def its_report(dbcon, filters):
# basic metrics for ticketing systems
dataset = {}
from vizgrimoire.ITS import ITS
ITS.set_backend("launchpad")
opened = its.Opened(dbcon, filters)
dataset["its_opened"] = opened.get_agg()["opened"]
closed = its.Closed(dbcon, filters)
dataset["its_closed"] = closed.get_agg()["closed"]
return dataset
示例4: data_source_increment_activity
# 需要導入模塊: from vizgrimoire.ITS import ITS [as 別名]
# 或者: from vizgrimoire.ITS.ITS import set_backend [as 別名]
def data_source_increment_activity(opts, people_out, affs_out):
# Per data source, the increment or decrement of the activity is displayed
dataset = {}
data_sources = ["Gits", "Tickets", "Mailing Lists", "Gerrit", "Askbot", "IRC"]
action = ["commits", "closed tickets", "sent emails", "submitted reviews", "posted questions", "messages"]
net_values = []
rel_values = [] #percentage wrt the previous 365 days
scm_dbcon = SCMQuery(opts.dbuser, opts.dbpassword, opts.dbcvsanaly, opts.dbidentities)
its_dbcon = ITSQuery(opts.dbuser, opts.dbpassword, opts.dbbicho, opts.dbidentities)
mls_dbcon = MLSQuery(opts.dbuser, opts.dbpassword, opts.dbmlstats, opts.dbidentities)
scr_dbcon = SCRQuery(opts.dbuser, opts.dbpassword, opts.dbreview, opts.dbidentities)
qaforums_dbcon = QAForumsQuery(opts.dbuser, opts.dbpassword, opts.dbqaforums, opts.dbidentities)
irc_dbcon = IRCQuery(opts.dbuser, opts.dbpassword, opts.dbirc, opts.dbidentities)
period = "month"
type_analysis = None
releases = opts.releases.split(",")[-2:]
startdate = "'"+releases[0]+"'"
enddate = "'"+releases[1]+"'"
filters = MetricFilters(period, startdate, enddate, None, 10, people_out, affs_out)
commits = scm.Commits(scm_dbcon, filters)
closed = its.Closed(its_dbcon, filters)
emails = mls.EmailsSent(mls_dbcon, filters)
submitted = scr.Submitted(scr_dbcon, filters)
questions = qa.Questions(qaforums_dbcon, filters)
messages = irc.Sent(irc_dbcon, filters)
from vizgrimoire.ITS import ITS
ITS.set_backend("launchpad")
net_values.append(commits.get_trends(releases[1], 365)["commits_365"])
rel_values.append(commits.get_trends(releases[1], 365)["percentage_commits_365"])
net_values.append(closed.get_trends(releases[1], 365)["closed_365"])
rel_values.append(closed.get_trends(releases[1], 365)["percentage_closed_365"])
net_values.append(emails.get_trends(releases[1], 365)["sent_365"])
rel_values.append(emails.get_trends(releases[1], 365)["percentage_sent_365"])
net_values.append(submitted.get_trends(releases[1], 365)["submitted_365"])
rel_values.append(submitted.get_trends(releases[1], 365)["percentage_submitted_365"])
net_values.append(questions.get_trends(releases[1], 365)["qsent_365"])
rel_values.append(questions.get_trends(releases[1], 365)["percentage_qsent_365"])
net_values.append(messages.get_trends(releases[1], 365)["sent_365"])
rel_values.append(messages.get_trends(releases[1], 365)["percentage_sent_365"])
createCSV({"datasource":data_sources, "metricsnames":action, "relativevalues":rel_values, "netvalues":net_values}, "./release/data_source_evolution.csv")
示例5: projects_efficiency
# 需要導入模塊: from vizgrimoire.ITS import ITS [as 別名]
# 或者: from vizgrimoire.ITS.ITS import set_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, opts.dbprojects)
scm_dbcon = SCMQuery(opts.dbuser, opts.dbpassword, opts.dbcvsanaly, opts.dbidentities, opts.dbprojects)
its_dbcon = ITSQuery(opts.dbuser, opts.dbpassword, opts.dbbicho, opts.dbidentities, opts.dbprojects)
bmi_list = []
time2review_list = []
bmi_its = []
period = "month"
releases = opts.releases.split(",")[-2:]
startdate = "'"+releases[0]+"'"
enddate = "'"+releases[1]+"'"
type_analysis = None
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("jira")
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)
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":"general", "bmi":bmi_list, "timereview":time2review_list, "bmiits":bmi_its}, "./release/integrated_projects_efficiency.csv")
示例6: its_report
# 需要導入模塊: from vizgrimoire.ITS import ITS [as 別名]
# 或者: from vizgrimoire.ITS.ITS import set_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
示例7: MetricFilters
# 需要導入模塊: from vizgrimoire.ITS import ITS [as 別名]
# 或者: from vizgrimoire.ITS.ITS import set_backend [as 別名]
for project in projects["id"]:
print project
if project not in projects_sloc["id"]:
#ignoring some projects not found in the list of sloc
continue
pr_index = projects_sloc["id"].index(project)
project_sloc = projects_sloc["total_sloc"][pr_index]
filters = MetricFilters("month", startdate, enddate, ["project", "'"+project+"'"], opts.npeople,
people_out, affs_out)
#ITS report
ITS.set_backend("bg")
its_dbcon = ITSQuery(opts.dbuser, opts.dbpassword, opts.dbbicho, opts.dbidentities)
data = update(data, its_report(its_dbcon, filters, project_sloc))
#SCR Report
#scr_dbcon = SCRQuery(opts.dbuser, opts.dbpassword, opts.dbreview, opts.dbidentities)
#data["scr"] = scr_report(scr_dbcon, filters)
#MLS Report
mls_dbcon = MLSQuery(opts.dbuser, opts.dbpassword, opts.dbmlstats, opts.dbidentities)
data = update(data, mls_report(mls_dbcon, filters, project_sloc))
thresholds(data)
示例8: createJSON
# 需要導入模塊: from vizgrimoire.ITS import ITS [as 別名]
# 或者: from vizgrimoire.ITS.ITS import set_backend [as 別名]
else:
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)