-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScatterplot.R
More file actions
37 lines (25 loc) · 1.43 KB
/
Scatterplot.R
File metadata and controls
37 lines (25 loc) · 1.43 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
library(dplyr)
library(ggplot2)
library(tidyr)
source("JiraAPIWrapper/JiraAPI.R")
filter <- "project=MS and created > startOfMonth(-3) and issuetype in (Bug,Story)"
get_issues_dataframe <- get_stories_by_filter(filter)
jira_data <- get_issues_dataframe %>%
mutate(created = as.Date(issues.fields.created, "%Y-%m-%dT%H:%M:%OS"),
closed = as.Date(issues.fields.resolutiondate, "%Y-%m-%dT%H:%M:%OS"),
cycletime = as.numeric(difftime(closed, created), units="days"),
issuetype = issues.fields.issuetype.name) %>%
filter(!is.na(closed))
jira_selected <- jira_data %>%
select(issues.key,created, closed, cycletime)
p95 <- quantile(jira_data$cycletime, 0.95)
p80 <- quantile(jira_data$cycletime, 0.80)
p50 <- quantile(jira_data$cycletime, 0.50)
ggplot(jira_data, aes(x=closed, y=cycletime)) +
geom_point(aes(col=issuetype))+
geom_hline(yintercept=p95, linetype="dashed", color = "red")+
annotate("text", x = min (jira_data$closed), y = p95, color = "red" , label = "95th Percentile", vjust = -0.5, hjust = "inward") +
geom_hline(yintercept=p80, linetype="dashed", color = "blue")+
annotate("text", x = min (jira_data$closed), y = p80 , color = "blue", label = "80th Percentile", vjust = -0.5, hjust = "inward") +
geom_hline(yintercept=p50, linetype="dashed", color = "green") +
annotate("text", x = min (jira_data$closed), y = p50 , color = "green", label = "50th Percentile", vjust = -0.5, hjust = "inward")