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.
Field  Value 

Target Entity Category  System 
Target Entity Type  Not selected 
Input Metrics from Target Entity 

MEM_ACTIVE statistic  Default 
Additional input metrics  No 
Formula Label  Active Memory Utilization 
Formula Name  F_ACTIVE_MEMORY_UTILIZATION_C 
Formula Result Type  Percentage counter 
Select unit  existing: 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.
Field  Value 

Target Entity Category  System 
Target Entity Type  Virtual Machine  KVM 
Input Metrics from Target Entity  [CPU_UTIL] CPU Utilization % 
CPU_UTIL statistic  Default 
Additional input metrics  From parent system 
Parent Entity Type  Virtual Host  KVM 
Input metrics from Parent Entity  [BYBENCHMARK_VALUE] Benchmark value 
BYBENCHMARK_VALUE subresource  SPECINTRATE2006 
Formula Label  Spec Rating Used 
Formula Name  F_2_C 
Formula Result Type  A count of events, absolute number 
Select unit  existing: Rating 
Formula  Target.CPU_UTIL*Parent.BYBENCHMARK_VALUE 
Note
Calculation:
Target.CPU_UTIL = 25%
Parent.BYBENCHMARK_VALUE = 276
Spec Rating Used = 0.25 * 276.0 = 69
Sample 3  Memory Overcommit 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 Overcommit Ratio.
Field  Value 

Target Entity Category  System 
Target Entity Type  Virtual Cluster  VMware 
Input Metrics from Target Entity  [TOTAL_REAL_MEM] Real memory 
Additional input metrics  From child system 
Child Entity Type  Virtual Machine  VMware 
Input metrics from Child Entity  [TOTAL_REAL_MEM] Real memory 
Formula Label  Memory Overcommit Ratio 
Formula Name  F_MEMORY_OVERCOMMIT_RATIO__C 
Formula Result Type  A count of events, absolute number 
Select unit  existing: Ratio 
Formula  SUM(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 OverCommit 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.
Field  Value 

Target Entity Category  System 
Target Entity Type  Virtual Host  VMware 
Input Metrics from Target Entity 

BYDISK_READ_RATE statistic  Default 
BYDISK_WRITE_RATE statistic  Default 
Additional input metrics  No 
Formula Label  Disk RW Ratio 
Formula Name  F_DISK_RW_RATIO1_C 
Formula Result Type  A count of events, absolute number 
Select unit  existing: 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.
Disk  Metrics  Disk 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.
Field  Value 

Target Entity Category  System 
Target Entity Type  Generic 
Input Metrics from Target Entity 

BYIF_IN_BYTE_RATE statistic  Default 
BYIF_OUT_BYTE_RATE statistic  Default 
Additional input metrics  No 
Formula Label  Maximum Network In/Out Byte Rate 
Formula Name  F_MAXIMUM_NETWORK_INOUT_BYTE_RATE_C 
Formula Result Type  A count of events, absolute number 
Select unit  not 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 Interface  Metrics  Disk 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.
Comments