@@ -127,25 +127,6 @@ ${status} after ${currentBuild.durationString - ' and counting'}"""
127
127
// message: "${message}"
128
128
}
129
129
130
- def submitCIMetrics (buildType ) {
131
- long durationMs = currentBuild. duration
132
- long durationSec = durationMs / 1000
133
- long nowSec = (currentBuild. startTimeInMillis + durationMs) / 1000
134
- def branchNameNoPeriods = env. BRANCH_NAME . replaceAll(' \\ .' , ' _' )
135
- def durationMetric = " okr.ci.nodejs.${ env.DRIVER_METRIC_TYPE} .${ buildType} .${ branchNameNoPeriods} ${ durationSec} ${ nowSec} "
136
-
137
- timeout(time : 1 , unit : ' MINUTES' ) {
138
- withCredentials([string(credentialsId : ' lab-grafana-address' , variable : ' LAB_GRAFANA_ADDRESS' ),
139
- string(credentialsId : ' lab-grafana-port' , variable : ' LAB_GRAFANA_PORT' )]) {
140
- withEnv([" DURATION_METRIC=${ durationMetric} " ]) {
141
- sh label : ' Send runtime metrics to labgrafana' , script : ''' #!/bin/bash -lex
142
- echo "${DURATION_METRIC}" | nc -q 5 ${LAB_GRAFANA_ADDRESS} ${LAB_GRAFANA_PORT}
143
- '''
144
- }
145
- }
146
- }
147
- }
148
-
149
130
def describePerCommitStage () {
150
131
script {
151
132
currentBuild. displayName = " Per-Commit"
@@ -199,7 +180,9 @@ def describeAdhocTestingStage() {
199
180
}
200
181
201
182
// branch pattern for cron
202
- def branchPatternCron = ~" (master)"
183
+ def branchPatternCron () {
184
+ ~" (master)"
185
+ }
203
186
204
187
pipeline {
205
188
agent none
@@ -303,7 +286,7 @@ pipeline {
303
286
}
304
287
305
288
triggers {
306
- parameterizedCron(branchPatternCron. matcher(env. BRANCH_NAME ). matches() ? """
289
+ parameterizedCron(branchPatternCron() . matcher(env. BRANCH_NAME ). matches() ? """
307
290
# Every weeknight (Monday - Friday) around 7 PM
308
291
H 19 * * 1-5 %CI_SCHEDULE=WEEKNIGHTS
309
292
""" : " " )
@@ -434,11 +417,6 @@ pipeline {
434
417
}
435
418
}
436
419
post {
437
- always {
438
- node(' master' ) {
439
- submitCIMetrics(' commit' )
440
- }
441
- }
442
420
aborted {
443
421
notifySlack(' aborted' )
444
422
}
0 commit comments