aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Holmes <mike.holmes@linaro.org>2017-06-14 12:48:08 -0400
committerMike Holmes <mike.holmes@linaro.org>2017-06-14 16:25:21 -0400
commit2ce3daa0629382e203a4f9067fd24f06608d6ef9 (patch)
tree192e287ae2b63fa2549c224d2e2464eb2aa36fb9
parent3765d1ec62b722d8d1f209b3de4ec78c68426c2b (diff)
plot raw percentage
-rw-r--r--Signed_off_heatmaps.R89
1 files changed, 75 insertions, 14 deletions
diff --git a/Signed_off_heatmaps.R b/Signed_off_heatmaps.R
index c8c635d..523ae7f 100644
--- a/Signed_off_heatmaps.R
+++ b/Signed_off_heatmaps.R
@@ -78,6 +78,22 @@ get_team <- function (df){
return (unique_people)
}
+get_team_sum <- function (df){
+ sum <- length(df$contribution$tag)
+ return (sum)
+}
+
+get_patch_percentage <- function (row, sum_allteam){
+ percentage = (row$sum / sum_allteam) * 100
+ return (percentage)
+}
+
+get_people_percentage <- function (row, sum_all_people){
+ num.unique.people <- length(unique(row$contributions$person))
+ percentage = (num.unique.people / sum_all_people) * 100
+ return (percentage)
+}
+
get_team_size <- function (df){
unique_people <- unique(df$contributions$person)
number_of_people <- length(unique_people)
@@ -103,7 +119,6 @@ if (id[2] == '') {
stop()
}
-
home <- getwd()
print(paste("Outputdir = ", home))
user_password <- paste(id[1], id[2], sep=":")
@@ -154,6 +169,16 @@ df$tested <- apply(df,1, get_tested)
df$reported<- apply(df,1, get_reported)
df$team_size<- apply(df,1, get_team_size)
+df$sum_patches<- apply(df,1, get_team_sum)
+
+#percentage of patches
+sum_allteam <- sum(df$sum_patches)
+df$percentage_patches<- apply(df,1, get_patch_percentage, sum_allteam=sum_allteam)
+
+#percentage of people
+sum_all_people <- length(unique.persons)
+df$percentage_people<- apply(df,1, get_people_percentage, sum_all_people=sum_all_people)
+
#normalise by the number of contributors
df$signed <- df$signed / df$team_size
df$acked <- df$acked / df$team_size
@@ -161,10 +186,10 @@ df$reviewed <- df$reviewed / df$team_size
df$tested <- df$tested / df$team_size
df$reported<- df$reported/ df$team_size
-#cut out what we want to plot
+#cut out what we want to plot whick is Mainter type sign offs
m <- as.matrix(df[,c("signed","acked","reviewed")])
-png(file=paste(Sys.Date(),"Linaro_team_maintainer_roll.png", sep = "_"), title = paste(Sys.Date(),"team vs maintainer",sep = " "))
+png(file=paste(Sys.Date(),"Linaro_maintainer_overview.png", sep = "_"), title = paste(Sys.Date(),"team vs maintainer",sep = " "))
op <- par(mar=c(15,4,4,2))
inverse.m <- t(m)
@@ -178,10 +203,11 @@ barplot(inverse.m, las=2,
)
dev.off()
-#cut out what we want to plot
+#cut out what we want to plot which is the non maintainer type work
m <- as.matrix(df[,c("tested", "reported")])
-png(file=paste(Sys.Date(),"Linaro_team_support_roll.png", sep = "_"), title = paste(Sys.Date(),"team vs. git stats",sep = " "))
+
+png(file=paste(Sys.Date(),"Linaro_support_overview.png", sep = "_"), title = paste(Sys.Date(),"team vs. git stats",sep = " "))
op <- par(mar=c(15,4,4,2))
inverse.m <- t(m)
@@ -194,6 +220,44 @@ barplot(inverse.m, las=2,
)
dev.off()
+
+#cut out what we want to plot
+percentage_patches <- as.matrix(df[,"percentage_patches"])
+row.names(percentage_patches) <- row.names(df)
+
+png(file=paste(Sys.Date(),"Linaro_percentage_signoffs.png", sep = "_"), title = paste(Sys.Date(),"team vs. git stats",sep = " "))
+op <- par(mar=c(15,4,4,2))
+inverse.percentage_patches <- t(percentage_patches)
+percentage_patches
+barplot(inverse.percentage_patches, las=2,
+ main="Team conribution as % of Linaro",
+ ylab = "%",
+ col =colours,
+ legend.text=TRUE,
+ args.legend=list(x='topleft')
+)
+
+dev.off()
+
+#cut out what we want to plot
+percentage_people <- as.matrix(df[,"percentage_people"])
+row.names(percentage_people) <- row.names(df)
+
+png(file=paste(Sys.Date(),"Linaro_percentage_of_authors.png", sep = "_"), title = paste(Sys.Date(),"team vs. git stats",sep = " "))
+op <- par(mar=c(15,4,4,2))
+inverse.percentage_people <- t(percentage_people)
+percentage_people
+barplot(inverse.percentage_people, las=2,
+ main="Team size as % of Linaro",
+ ylab = "%",
+ col =colours,
+ legend.text=TRUE,
+ args.legend=list(x='topleft')
+)
+
+dev.off()
+
+
#a bar plot showing each teams contribution to a tag type
for (title in unique.tags) {
png(file=paste(Sys.Date(),"Linaro_team",title,"git.png", sep = "_"), title = paste(Sys.Date(),"team vs. ",title,"git stats",sep = " "))
@@ -203,9 +267,6 @@ for (title in unique.tags) {
dev.off()
}
-
-
-
#Stats by team
setwd(home)
dir.create("teams")
@@ -224,8 +285,6 @@ for (team in row.names(df)) {
colnames(all_people) <- lunique.tags
all_people[] <- 0L
- print(team)
-
tab <- as.data.frame( table(contributions))
for (r in 1:nrow(tab)) {
@@ -234,7 +293,7 @@ for (team in row.names(df)) {
Freq <- (tab[r,"Freq"])
all_people[person,tag] <- all_people[person,tag] + Freq
}
-
+
barplot(
main = paste("Non author contributions", team, sep = " "),
t(all_people),
@@ -276,12 +335,11 @@ for (team in row.names(df)) {
}
}
-#sort by
-all_people[order(all_people[,1]),]
+inverse.all_people <- t(all_people)
barplot(
main = "Maintainers",
- t(all_people),
+ inverse.all_people,
las = 2,
bty='L',
col = colours,
@@ -345,3 +403,6 @@ for (r in 1:nrow(all_people)) {
#all_patch_data <- sapply(df$id,get_patches)
#str(all_patch_data)
+
+#always return to the home
+setwd(home)