forked from electric-cloud/DSL-Samples
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathUserLaunchedJobsReports.groovy
102 lines (98 loc) · 2.14 KB
/
UserLaunchedJobsReports.groovy
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
/*
TODO: filter out project:, service and admin users
*/
project "User count",{
report 'User jobs', {
reportObjectTypeName = 'job'
reportQuery = '''\
{
"searchCriteria":[],
"groupBy":[
{
"field":"jobStart"
}
],
"aggregationFunctions":[
{
"field":"launchedByUser",
"function":"DISTINCT_COUNT"
}
]
}'''.stripIndent()
}
report 'User list', {
reportObjectTypeName = 'job'
reportQuery = '''\
{
"searchCriteria":[],
"groupBy":[
{
"field":"launchedByUser"
}
],
"aggregationFunctions":[]
}
'''.stripIndent()
}
dashboard 'User jobs', {
layout = 'FLOW'
type = 'STANDARD'
reportingFilter 'DateFilter', {
operator = 'BETWEEN'
parameterName = 'jobStart'
required = '1'
type = 'DATE'
}
reportingFilter 'Projects', {
operator = 'IN'
parameterName = 'pipelineName'
reportObjectTypeName = 'job'
required = '0'
type = 'CUSTOM'
}
widget 'Users', {
attributeDataType = [
'column1': 'STRING',
]
attributePath = [
'column1': 'launchedByUser',
'column1Label': 'User name',
]
reportName = 'User list'
reportProjectName = 'User count'
title = 'Users'
visualization = 'TABLE'
}
widget 'Users total jobs', {
attributeDataType = [
'column1': 'STRING',
'column2': 'NUMBER',
]
attributePath = [
'column1': 'launchedByUser',
'column2Label': 'Total Jobs',
'column2': 'launchedByUser_count',
'column1Label': 'User name',
]
reportName = 'User list'
reportProjectName = projectName
title = 'Users total jobs'
visualization = 'TABLE'
}
widget 'User job count', {
attributeDataType = [
'yAxis': 'NUMBER',
'xAxis': 'DATE',
]
attributePath = [
'yAxis': 'distinct_count_launchedByUser',
'xAxis': 'jobStart_label',
'xAxisLabel': 'jobStart_label',
]
dashboardName = 'User jobs'
reportProjectName = projectName
title = 'User job count'
visualization = 'VERTICAL_BAR_CHART'
}
}
}