mirror of
https://github.com/SAP/jenkins-library.git
synced 2024-12-12 10:55:20 +02:00
749aa5e7ed
* adding step for writing metrics to InfluxDB including dependencies * added documentation * incorporated PR feedback
20 lines
452 B
Groovy
20 lines
452 B
Groovy
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
|
|
}
|
|
|