Define measurements

Use the Script, Maven, or Gradle plugins to define custom measurements, capture them to a file, and publish them to PulseUno.

Guidelines for defining measurements

When you run a script with your measurements as part of a Script, Maven, or Gradle chain step, the script can generate a pulse-measurements.properties file, the contents of which PulseUno adds as custom measurements created by the step.

You can then view these measurements in the user interface and pass them to other chain steps. For details, see Publish output variables.

Guidelines:

  • To define custom measurements, your script must create the pulse-measurements.properties file. PulseUno doesn't recognize the file with a different name.

  • Use the following syntax for each line:

    measurement-name=measurement-value

  • Because pulse-measurements.properties is a Java properties file, use the ISO 8859-1 (ISO Latin1) 8-bit character encoding.

    To encode UTF-16 code units that are not in the ISO-Latin1 character set, use Unicode escape sequences such as \uXXXX, where XXXX is a 4-digit hexadecimal code point that represents a single character. For example, to encode the value €100.00 (one hundred euros), use the following escape sequence: \u20AC100.00

  • You can define the string, number, or boolean metric types by adding @string, @number, or @boolean to the relevant variable. For example, count@number=10 creates the count metric with the number value of 10.

  • You can paste your script into a step or use a script file that you checked in to the project's working directory. When the step completes, PulseUno looks for the pulse-measurements.properties file in the top directory of the chain’s build area (normally, the default working directory for the step).

  • Follow the syntax and character guidelines in Publish output variables.

Back to top

Add measurements

To specify your measurements, add a Script, Maven, or Gradle step to a chain.

To define custom measurements in a chain step:

  1. On the top navigation bar, select a space from the spaces list.
  2. On the Products page, select a product or Git repository.

  3. On the sidebar, select Chains.

  4. Open a chain from the chain list and click Edit.

    Or create a new chain, as described in Create chains.

  5. Add a Script, Maven, or Gradle step to the chain.

  6. Click the step to configure it.

  7. In the step's parameters, specify the script to run:

    Script

    Runs a batch file (Windows) or shell script (other systems).

    To add your script:

    1. Select the script language.
    2. Enter your script in the Command line box.

      Alternatively, from the Location list, select File in workspace, and enter a path to the script file, for example, scripts/runstep.bat.

    Maven By default, runs a pom.xml file from the working directory.
    Gradle By default, runs a build.gradle file from the working directory.
  8. Configure other parameters. For details, see the Gradle, Maven, or Script description in Use plugins.

  9. Click Save.

When PulseUno runs the step, it reads any custom measurements from the pulse-measurements.properties file, but only if your script creates the file.

To view the measurements in PulseUno, open a chain run and select the Measurements tab.

Back to top

See also: