aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Holmes <mike.holmes@linaro.org>2017-06-01 08:08:08 -0400
committerMike Holmes <mike.holmes@linaro.org>2017-06-01 08:23:51 -0400
commit74a6e878680b8f36aa2e56210bb60392eb4fa840 (patch)
treea5be651e3eba0e09d95a4feb7cca74b8aa3f0e54
parent086f0d13d25aeb4bb4477c6d6f455926a63e5036 (diff)
very ugly experiments
Signed-off-by: Mike Holmes <mike.holmes@linaro.org>
-rw-r--r--Signed_off_heatmaps.R74
-rw-r--r--company_interest.R17
2 files changed, 65 insertions, 26 deletions
diff --git a/Signed_off_heatmaps.R b/Signed_off_heatmaps.R
index 9e8750b..b960769 100644
--- a/Signed_off_heatmaps.R
+++ b/Signed_off_heatmaps.R
@@ -48,9 +48,16 @@ get_reported <- function (df){
return (length(grep("Reported", df$contribution$tag)))
}
+get_team_size <- function (df){
+ str(df)
+ unique_people <- unique(df$contributions$person)
+ number_of_people <- length(unique_people)
+ print (number_of_people)
+ return (number_of_people)
+}
get_projects <- function (df){
- return (df$contribution$project)
+ return (df$contributions)
}
@@ -82,7 +89,7 @@ baseurl <- "http://patches.linaro.org/api/1.0/"
type <- "teams/?format=json&per_page=5000"
url <- paste(baseurl, type, sep = "")
-cat (url,"\n")
+#cat (url,"\n")
webpage <- curl (url, handle = h)
@@ -92,14 +99,11 @@ jira_raw <- fromJSON(webpage,simplifyMatrix = TRUE, simplifyVector =TRUE, simpl
df <- data.frame(id=jira_raw$id, url=jira_raw$url, active=jira_raw$active)
-
-
-
row.names(df) <- jira_raw$display_name
-str(df)
+#str(df)
n <- sapply(df$id,get_tags)
-str(n)
+#str(n)
df$contributions <- n
@@ -108,42 +112,68 @@ df <- df[df$active == TRUE,]
#table(n[[]]$project)
-#I am gere getting bits out
+#I am here getting bits out
#print (df)
list.contributions <- do.call("rbind",df$contributions)
unique.tags <- (unique(list.contributions$tag))
unique.persons <- (unique(list.contributions$person))
-unique.projects <- (unique(list.contributions$project))
-
-print(unique.tags)
-print(unique.persons)
-print(unique.projects)
+unique.projects <- (unique(list.contributions))
df$signed <- apply(df,1, get_signed)
df$acked <- apply(df,1, get_acked)
df$reviewed <- apply(df,1, get_reviewed)
df$tested <- apply(df,1, get_tested)
df$reported<- apply(df,1, get_reported)
+df$team_size<- apply(df,1, get_team_size)
+print (df$team_size)
+#normalise by the number of contributors
+df$signed <- df$signed / df$team_size
+df$acked <- df$acked / df$team_size
+df$reviewed <- df$reviewed / df$team_size
+df$tested <- df$tested / df$team_size
+df$reported<- df$reported/ df$team_size
-m <- as.matrix(df[,5:9])
+#cut out what we want to plot
+m <- as.matrix(df[,c("signed","acked","reviewed")])
-pdf(file="Linaro_team_vs_git_signoff.pdf", title = "team vs. git stats")
+png(file="Linaro_team_vs_git_signoff.png", title = "team vs. git stats")
op <- par(mar=c(15,4,4,2))
colours <- c("lightblue", "mistyrose", "lightcyan","lavender", "cornsilk")
inverse.m <- t(m)
barplot(inverse.m, las=2,
- main="non author contribution",
- ylab = "number of patches",
+ main="Maintainer contributions",
+ ylab = "patches / contributors per team",
col =colours,
legend.text=TRUE,
args.legend=list(x='topleft')
)
+dev.off()
+#cut out what we want to plot
+m <- as.matrix(df[,c("tested", "reported")])
+png(file="Linaro_team_vs_git_tested.png", title = "team vs. git stats")
+op <- par(mar=c(15,4,4,2))
+colours <- c("lightblue", "mistyrose", "lightcyan","lavender", "cornsilk")
+inverse.m <- t(m)
+
+barplot(inverse.m, las=2,
+ main="Team contributions",
+ ylab = "patches / contributors per team",
+ col =colours,
+ legend.text=TRUE,
+ args.legend=list(x='topleft')
+)
+dev.off()
+
+
+pdf(file="Linaro_team_vs_git.pdf", title = "team vs. git stats")
+op <- par(mar=c(15,4,4,2))
+colours <- c("lightblue", "mistyrose", "lightcyan","lavender", "cornsilk")
barplot(df$signed, main="signed off", las=2, ylab = "number of patches",
names.arg = row.names(df), col = colours[1])
barplot(df$acked, las=2, main="acked", ylab = "number of patches",
@@ -161,10 +191,12 @@ cat ("-----------------------\n")
pdf(file="Linaro_team_vs_project.pdf", title = "team vs. git stats")
#str(n)
-nm <- matrix(ncol=length(unique.projects), nrow=length(rownames(df)))
-colnames(nm) <- unique.projects
-print(nm)
-
+nm <- data.frame(ncol=length(unique.projects), nrow=length(rownames(df)))
+#colnames(nm) <- list.contributions
+#rownames(nm) <- rownames(df)
+cat ("-------nm----------------\n")
+str(nm)
+cat ("-----------------------\n")
str(list.contributions)
for ( p in rownames(nm))
diff --git a/company_interest.R b/company_interest.R
index 0dc4cfb..02034fc 100644
--- a/company_interest.R
+++ b/company_interest.R
@@ -22,7 +22,7 @@ companies <- function (names)
display_hetmap <- function(report, m, suffix) {
report_name <- paste(report["name"], suffix, ".pdf",sep = "")
- pdf(file=report_name, title = report["name"],paper="us")
+ # pdf(file=report_name, title = report["name"],paper="us")
#display raw data
print(m)
@@ -50,12 +50,13 @@ display_hetmap <- function(report, m, suffix) {
ylab = "company",
xlab = "project"
)
+ #ls
dev.off()
}
display_barplot <- function(report, m, suffix) {
report_name <- paste(report["name"], suffix, ".pdf",sep = "")
- pdf(file=report_name, title = report["name"],paper="us")
+# pdf(file=report_name, title = report["name"],paper="us")
#display raw data
cat("Generating", report_name, "\n")
@@ -73,7 +74,7 @@ display_barplot <- function(report, m, suffix) {
watcher_barplot <-
barplot2(m, ylab = "interest",
xlab = "project",col = color.palette)
- dev.off()
+ # dev.off()
}
watcher_heatmap <- function(report) {
@@ -266,7 +267,13 @@ reports <-
data.frame(name = report_name ,
team = team_list,
stringsAsFactors = FALSE)
-apply(reports, 1, sponsor_heatmap)
-apply(reports, 1, watcher_heatmap)
+report_name <- paste("sponsor_company", ".pdf",sep = "")
+pdf(file=report_name, title = "sponsor_heatmap")
+apply(reports, 1, sponsor_heatmap)
+dev.off()
+report_name <- paste("watcher_company", ".pdf",sep = "")
+pdf(file=report_name, title = "sponsor_heatmap")
+apply(reports, 1, watcher_heatmap)
+dev.off()