mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
11a7b24ce8
Asserts that each step (modulo whitelist) comes with a STEP_NAME field.
24 lines
521 B
Groovy
24 lines
521 B
Groovy
import groovy.transform.Field
|
|
|
|
@Field STEP_NAME = 'durationMeasure'
|
|
|
|
def call(Map parameters = [:], body) {
|
|
|
|
def script = parameters.script
|
|
def measurementName = parameters.get('measurementName', 'test_duration')
|
|
|
|
//start measurement
|
|
def start = System.currentTimeMillis()
|
|
|
|
body()
|
|
|
|
//record measurement
|
|
def duration = System.currentTimeMillis() - start
|
|
|
|
if (script != null)
|
|
script.commonPipelineEnvironment.setPipelineMeasurement(measurementName, duration)
|
|
|
|
return duration
|
|
}
|
|
|