Help documentation

Properties

Introduction

Properties provide a simple way of collecting metrics over time. Cruise sets some standard properties for you. You can also set properties yourself using the cruise REST APIs (see Properties API for more information). Cruise also allows you to download the history of your job in a convenient CSV or JSON format, so that you can analyse the results in spreadsheets or scripts.

Property History

Cruise allows you to download the history of properties that you have defined. This history is available as a Comma Separated Values (CSV) file or as JSON. You can import this file into a spreadsheet program to generate charts and diagnostics of your project.

You can of course access these resources through standard URLs:

  • CSV -- http://[server]/cruise/properties/[pipelineName]/[pipelineLable]/[stageName]/[stageCounter]/[job]/[propertyName]

To open the property history in a spreadsheet application, you can click on the Export property history to spreadsheet (csv) link on the Properties tab of the job.

Standard Properties

The standard properties defined by cruise are:

  • cruise_agent -- the agent that is running the job
  • cruise_job_id -- the id of the job
  • cruise_job_duration -- total time to run the job
  • cruise_job_result -- one of "passed" or "failed"
  • cruise_pipeline_label -- same as the value of the environment variable PIPELINE_LABEL
  • cruise_timestamp_01_scheduled -- time at which the job was scheduled
  • cruise_timestamp_02_assigned -- time at which the job was assigned to the agent
  • cruise_timestamp_03_preparing -- time at which the job entered the "preparing" state
  • cruise_timestamp_04_building -- time at which the job started building
  • cruise_timestamp_05_completing -- time at which the job entered the completing state
  • cruise_timestamp_06_completed -- time at which the job completed

Generating Properties from Artifacts

Cruise allows you to generate properties from XML artifacts that you create during the build. This can be used to harvest statistics produced by coverage tools etc. By storing them as properties it becomes very easy to show the history and trends over time of these values.

Note that the properties are generated on the Agent side, so the src path is relative to the working directory of the pipeline on the agent.

For example, to add support for the coverage tool "Emma", you might do this:

<job>
  <properties>
    <property name="coverage.class" src="target/emma/coverage.xml" xpath="substring-before(//report/data/all/coverage[starts-with(@type,'class')]/@value, '%')" />
    <property name="coverage.method" src="target/emma/coverage.xml" xpath="substring-before(//report/data/all/coverage[starts-with(@type,'method')]/@value, '%')" />
    <property name="coverage.block" src="target/emma/coverage.xml" xpath="substring-before(//report/data/all/coverage[starts-with(@type,'block')]/@value, '%')" />
    <property name="coverage.line" src="target/emma/coverage.xml" xpath="substring-before(//report/data/all/coverage[starts-with(@type,'line')]/@value, '%')" />
  </properties>
</job>

Tests

If you define a tests artifact that contains the test reports, then cruise will add some properties associated with the tests.

  • tests_failed_count -- number of failed tests
  • tests_ignored_count -- number of ignored tests
  • tests_total_duration -- total time taken for the tests
  • tests_total_count -- total number of tests