Sample formulas

This topic contains sample formulas for a variety of calculations that can be used in different analyses. These are just examples to illustrate how you can create custom formulas based on your requirement.

Sample 1 - Active Memory Utilization

The following is an example of a simple calculation using metrics from a single entity.

This sample formula is created using MEM_ACTIVE and TOTAL_REAL_MEM  to obtain Active Memory Utilization.

FieldValue
Target Entity CategorySystem
Target Entity TypeNot selected
Input Metrics from Target Entity
  1. MEM_ACTIVE

  2. TOTAL_REAL_MEM

MEM_ACTIVE statisticDefault
Additional input metricsNo
Formula Label

Active Memory Utilization

Formula NameF_ACTIVE_MEMORY_UTILIZATION_C
Formula Result TypePercentage counter
Select unitexisting: BYTES
Formula

Target.MEM_ACTIVE/Target.TOTAL_REAL_MEM

Calculation:

Target.MEM_ACTIVE = 12.5 GB

Target.TOTAL_REAL_MEM = 64 GB

Active_Memory Utilization = (12.5 / 64.0) * 100.0  = 0.1953

Note

When the result type is set to percentage, the result is automatically multiplied by 100.0.  You do not need to add times 100.0.

Sample 2 - Spec Rating Used

The following is an example of a formula that is calculated using metrics from an entity and its parent entity.

This sample formula is created using CPU_UTIL and BYBENCHMARK_VALUE to obtain Spec Rating Used.

FieldValue
Target Entity CategorySystem
Target Entity TypeVirtual Machine - KVM
Input Metrics from Target Entity

[CPU_UTIL] CPU Utilization %

CPU_UTIL statisticDefault
Additional input metricsFrom parent system
Parent Entity TypeVirtual Host - KVM
Input metrics from Parent Entity[BYBENCHMARK_VALUE] Benchmark value
BYBENCHMARK_VALUE subresource
SPECINTRATE2006
Formula Label

Spec Rating Used

Formula NameF_2_C
Formula Result TypeA count of events, absolute number
Select unitexisting: Rating
FormulaTarget.CPU_UTIL*Parent.BYBENCHMARK_VALUE


Note

Percentage metrics are stored internally in BMC TrueSight Capacity Optimization as a value from 0 to 1, so you do not have to divide by 100 to use the metric in calculations.

Calculation:

Target.CPU_UTIL = 25%

Parent.BYBENCHMARK_VALUE = 276

Spec Rating Used = 0.25 * 276.0 = 69

Sample 3 - Memory Over-commit Ratio

The following is an example of a formula that is calculated using metrics from an entity and its child entity. To see how you can use it an analysis, see Using a custom formula in an analysis.

This sample formula is created using TOTAL_REAL_MEM to obtain Memory Over-commit Ratio.

FieldValue
Target Entity CategorySystem
Target Entity TypeVirtual Cluster - VMware
Input Metrics from Target Entity

[TOTAL_REAL_MEM] Real memory

Additional input metricsFrom child system
Child Entity TypeVirtual Machine - VMware
Input metrics from Child Entity[TOTAL_REAL_MEM] Real memory
Formula Label

Memory Over-commit Ratio

Formula NameF_MEMORY_OVERCOMMIT_RATIO__C
Formula Result TypeA count of events, absolute number
Select unitexisting: Ratio
FormulaSUM(Child.TOTAL_REAL_MEM)/Target.TOTAL_REAL_MEM)

Calculation:

Target.TOTAL_REAL_MEM = 64GB

Assume 12 VMs each configured with 8 GB memory

SUM(Child.TOTAL_REAL_MEM) = 96 GB

Memory Over-Commit Ratio = 96/64 = 1.5

Sample 4 - Read/Write Ratio

The following is an example of a formula that is calculated using each of the subresources (BY metrics) from the entity.

This sample formula is created using BYDISK_READ_RATE and BYDISK_WRITE_RATE  to obtain Read/Write Ratio.

FieldValue
Target Entity CategorySystem
Target Entity TypeVirtual Host - VMware
Input Metrics from Target Entity
  1. BYDISK_READ_RATE

  2. BYDISK_WRITE_RATE

BYDISK_READ_RATE statisticDefault
BYDISK_WRITE_RATE statisticDefault
Additional input metricsNo
Formula Label

Disk RW Ratio

Formula NameF_DISK_RW_RATIO1_C
Formula Result TypeA count of events, absolute number
Select unitexisting: C
Formula

Target.BYDISK_READ_RATE/Target.BYDISK_WRITE_RATE

Calculation:

It is assumed that there are three disks connected to the host. The Read/Write ratio will be calculated for each of the three disks and three charts will be plotted in the analysis.

DiskMetricsDisk RW Ratio
d0

Target.BYDISK_READ_RATE = 1.5

Target.BYDISK_WRITE_RATE = 2.2

1.5 / 2.2 = 0.68

d1

Target.BYDISK_READ_RATE = 4.5

Target.BYDISK_WRITE_RATE = 4.45

4.5 / 4.45 = 1.011

d2

Target.BYDISK_READ_RATE = 3.5

Target.BYDISK_WRITE_RATE = 0.78

 3.5 / 0.78 = 4.48

Sample 5 - Maximum Network In/Out Byte Rate

The following is an example of a formula that is calculated using each of the subresources (BY metrics) from the entity.

This sample formula is created using BYIF_IN_BYTE_RATE and BYIF_OUT_BYTE_RATE to obtain Maximum Network In/Out Byte Rate.

FieldValue
Target Entity CategorySystem
Target Entity TypeGeneric
Input Metrics from Target Entity
  1. Target.BYIF_IN_BYTE_RATE

  2. Target.BYIF_OUT_BYTE_RATE

BYIF_IN_BYTE_RATE statisticDefault
BYIF_OUT_BYTE_RATE statisticDefault
Additional input metricsNo
Formula Label

Maximum Network In/Out Byte Rate

Formula NameF_MAXIMUM_NETWORK_INOUT_BYTE_RATE_C
Formula Result TypeA count of events, absolute number
Select unitnot specified
Formula

MAXBY(Target.BYIF_IN_BYTE_RATE + Target.BYIF_OUT_BYTE_RATE)

Calculation:

It is assumed that there are three network interfaces connected to the host. The sum of in and out byte rate will be calculated for each of the three network interfaces, and the maximum value will be plotted in the analysis.

Network InterfaceMetricsDisk RW Ratio
n0

Target. BYIF_IN_BYTE_RATE = 1.5

Target. BYIF_OUT_BYTE_RATE = 2.2

1.5 + 2.2 = 3.7

n1

Target. BYIF_IN_BYTE_RATE = 4.5

Target. BYIF_OUT_BYTE_RATE = 4.45

4.5 + 4.45 = 8.95
n2

Target.BYDISK_READ_RATE = 3.5

Target.BYDISK_WRITE_RATE = 0.78

3.5 + 0.78 = 4.28

For this sample, the value for network interface n1, 8.95, will be plotted.

Was this page helpful? Yes No Submitting... Thank you

Comments