Home > Cloud Cruiser 4 > Collecting, transforming, and publishing > Steps for all collectors > Using transform processors > Rounding resource values

Rounding resource values

Table of contents
No headers

There are two ways to round one or more resource values from processed records: using the RoundResourceValues transform processor, or using the rounding functionality in the CalculateResource transform processor’s expression property.

Values specified when using RoundResourceValues is based on the configured roundingMode and scale, as shown in the following XML example:

<bean class="com.cloudcruiser.batch.transform.RoundResourceValues">
  <property name="active" value="true" />
  <property name="roundingMode" value="HALF_EVEN" />
  <property name="scale" value="2" />
  <property name="resourcePattern" value="temp.*" />
  <property name="resources" value="Resource,AnotherResource" />
</bean>

For values specified with CalculateResource , the rounding function expect two arguments: the decimal expression and the scale (integer), as shown in the following XML example:

<bean class="com.cloudcruiser.batch.transform.CalculateResource">
  <property name="active" value="true" />
  ...
  <property name="expression" value="ROUND(memUsed/1024, 2)" />
</bean>

where memUsed is a resource ID.

Last modified

Tags

This page has no custom tags.

Classifications

This page has no classifications.
© Copyright 2018 Hewlett Packard Enterprise Development LP