cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DMI report showing the result of the subtraction of two metrics e.g metric1 - metric2 ???

anthony_p2
Inactive

Hi all,

Sorry if this is an obvious question but I can't find any info in the docs etc...

Need to create a DMI showing the result of subtraction of two metrics...

Is this possible in the DMI???

 

regards

 

AP

6 REPLIES 6

Radoslaw_Szulgo
Dynatrace Guru
Dynatrace Guru

You cannot find because you cannot do that with the DMI. 

The only workaround I know is to leverage custom metrics.

However, there's an enhancement request created to support that.

Senior Technical Product Manager,
Dynatrace Managed expert

jacob_crawford
Dynatrace Helper
Dynatrace Helper

Here's an example user-defined metric that I've used. It was built following the documentation Pawel posted above. This custom metric calculates operation count * avg operation time to show total operation time.

Create a new properties file in the [CAS]/config directory called dmi_dataview-my_metrics.properties. Contents of the file:

CVENT.ClientView.calculatedColumn.0.id=transTimeTotal
CVENT.ClientView.calculatedColumn.0.name=Total operation time
CVENT.ClientView.calculatedColumn.0.description=Operations * average operation time = total operation time
CVENT.ClientView.calculatedColumn.0.resultType=float
CVENT.ClientView.calculatedColumn.0.expression=[trans]*[transTime]
CVENT.ClientView.calculatedColumn.0.renderer=PERIOD_MS
CVENT.ClientView.calculatedColumn.0.resolutions=r,1,6,d,w,m
CVENT.ClientView.calculatedColumn.0.group=User-defined metrics

  • See Pawel's link to documentation for description of the above properties
  • For the expression entry, you'll need to know the ID of the metrics in use (click help button on any data view while building DMI report)
  • Example of subtraction-based expression: to see operation time minus server time, the expression would be [transTime]-[svrDelay]
  • Note that user-defined metrics can only be added for certain data views

Save the file and refresh the data mining interface. Restart of CAS service not required. The new metric will appear in the metric list under the group you defined.


dennis_mispelba
Inactive

Thanks for the great example. I was wondering how that works.

However, correct me if I am wrong, but I cannot calculate actual values vs. benchmarking values, is that right?

Like if I have the number of operations for the last monitoring interval and the number of operations for the last monitoring interval same time yesterday, and I would like to divide both numbers of operations (in order to get a percent rate out of this), I cannot do this using this approach, right? From table 1 (here:

https://community.dynatrace.com/community/display/...

I am missing the metric id it actually would be for the benchmarking value.

EDIT: I exported the section containing the benchmarking values and while for the actual values of operations the metric ID is e.g. "trans", for benchmarking values it is "m0_trans". So I tried to build my metrics on this however, that did not work quite well:

E DMI 15-10-16 12:20:18.431 Custom metric failureRateBenchmark cannot be constructed in ViewAsm4MajTraff. Unrecognized metric m0_FA in format [m0_FA]/[m0_trans]. Check definition CVENT.ClientView.calculatedColumn.1.expression
E DMI 15-10-16 12:20:18.431 Custom metric timeIndex cannot be constructed in ViewAsm4MajTraff. Unrecognized metric m0_transTime in format [transTime]/[m0_transTime]. Check definition CVENT.ClientView.calculatedColumn.2.expression
E DMI 15-10-16 12:20:18.431 Custom metric failureIndex cannot be constructed in ViewAsm4MajTraff. Unrecognized metric failureRateBenchmark in format [failureRate]/[failureRateBenchmark]. Check definition CVENT.ClientView.calculatedColumn.3.expression
E DMI 15-10-16 12:20:18.432 Custom metric loadIndex cannot be constructed in ViewAsm4MajTraff. Unrecognized metric m0_trans in format [trans]/[m0_trans]. Check definition CVENT.ClientView.calculatedColumn.4.expression

kalle_lahtinen
Advisor

Hi,

I think I'm having the same issue as Dennis. I've defined a raw level custom metric in "calculatedColumn.0", and when I try to refer to it in "calculatedColumn.1", I get the same error message as Dennis, "Unrecognized metric".

The first custom metric is working fine and I can see it in the DMI. So, can we define a new custom metric based on a previously defined custom metric?

Response from Dynatrace support:

"Confirmed with the development.

It is not possible to build one custom metric basing on another custom metric."

Too bad...