diff --git a/documentation/docs/steps/durationMeasure.md b/documentation/docs/steps/durationMeasure.md index 3145b114c..87c7e35e1 100644 --- a/documentation/docs/steps/durationMeasure.md +++ b/documentation/docs/steps/durationMeasure.md @@ -1,37 +1,10 @@ -# durationMeasure +# ${docGenStepName} -## Description +## ${docGenDescription} -This step is used to measure the duration of a set of steps, e.g. a certain stage. -The duration is stored in a Map. The measurement data can then be written to an Influx database using step [influxWriteData](influxWriteData.md). +## ${docGenParameters} -!!! tip - Measuring for example the duration of pipeline stages helps to identify potential bottlenecks within the deployment pipeline. - This then helps to counter identified issues with respective optimization measures, e.g parallelization of tests. - -## Prerequisites - -none - -## Pipeline configuration - -none - -## Parameters - -| parameter | mandatory | default | possible values | -| ----------|-----------|---------|-----------------| -| script | yes | | | -| measurementName | no | test_duration | | - -Details: - -* `script` defines the global script environment of the Jenkinsfile run. Typically `this` is passed to this parameter. This allows the function to access the [`commonPipelineEnvironment`](commonPipelineEnvironment.md) for storing the measured duration. -* `measurementName` defines the name of the measurement which is written to the Influx database. - -## Step configuration - -none +## ${docGenConfiguration} ## Example diff --git a/vars/durationMeasure.groovy b/vars/durationMeasure.groovy index 2f254dd2c..7b43848eb 100644 --- a/vars/durationMeasure.groovy +++ b/vars/durationMeasure.groovy @@ -1,8 +1,23 @@ +import com.sap.piper.GenerateDocumentation import static com.sap.piper.Prerequisites.checkScript import groovy.transform.Field @Field STEP_NAME = getClass().getName() +@Field Set PARAMETER_KEYS = [ + /** Defines the name of the measurement which is written to the Influx database.*/ + 'measurementName' +] + +/** + * This step is used to measure the duration of a set of steps, e.g. a certain stage. + * The duration is stored in a Map. The measurement data can then be written to an Influx database using step [influxWriteData](influxWriteData.md). + * + * !!! tip + * Measuring for example the duration of pipeline stages helps to identify potential bottlenecks within the deployment pipeline. + * This then helps to counter identified issues with respective optimization measures, e.g parallelization of tests. + */ +@GenerateDocumentation def call(Map parameters = [:], body) { def script = checkScript(this, parameters)