I'd like to share my knowledge about the User-defined metrics, I believe could be useful to everyone's approaching the custom created metrics.
You can find the official knowledge about the User-defined metrics on the Doc here:
But I'd like to share some tips and provide further examples, in addition to the ones on the page.
- The ID should be less than 20 characters. (But it works anyway, you'll just see a warning on the server.log)
- Don't split the description on more lines
- Always use the case when - then else statement with the zero-check condition to avoid incurring into SQL division by zero errors showed in the report.. (it's not that pretty :-) )
- Create your own group and don't leave it blank, otherwise the metrics will be shown in the Other group
- If you're quite sure that you're metric is correctly written double check the server.log..you'll be amazed of what you can learn from that log. :-)
The following examples are created to be used in a DMI custom report on the Software service, operation, and site data view.
As you can see, I'm showing three common cases: a rate, a percentage and a bytes calculation.
CVENT.ClientView.calculatedColumn.0.id=RAF_CustomMetric1 CVENT.ClientView.calculatedColumn.0.name=MyAwesomeMetricName CVENT.ClientView.calculatedColumn.0.description=My awesome metric description. In this case the rate of incomplete responses on the total of operations CVENT.ClientView.calculatedColumn.0.resultType=DOUBLE CVENT.ClientView.calculatedColumn.0.expression= case when [trans] = 0 then 0 else [RejTrans] / [trans] endCVENT.ClientView.calculatedColumn.0.renderer=DOUBLE CVENT.ClientView.calculatedColumn.0.resolutions=r,1,6,d,w,m CVENT.ClientView.calculatedColumn.0.group=MyAwesomeMetricGroup
CVENT.ClientView.calculatedColumn.1.id=RAF_CustomMetric2 CVENT.ClientView.calculatedColumn.1.description=My awesome metric description. In this case the average of bytes transferred per operation CVENT.ClientView.calculatedColumn.1.resultType=DOUBLE CVENT.ClientView.calculatedColumn.1.expression= case when [trans] = 0 then 0 else [c_sByte] / [trans] end CVENT.ClientView.calculatedColumn.1.renderer=BYTES CVENT.ClientView.calculatedColumn.1.resolutions=r,1,6,d,w,m CVENT.ClientView.calculatedColumn.1.group=MyAwesomeMetricGroup
CVENT.ClientView.calculatedColumn.2.id=RAF_CustomMetric3 CVENT.ClientView.calculatedColumn.2.description=My awesome metric description. In this case the percentage of Zero window size events compared to the number of TCP packets sent by the servers CVENT.ClientView.calculatedColumn.2.resultType=DOUBLE CVENT.ClientView.calculatedColumn.2.expression=case when [SPTCP] = 0 then 0 else [ZWS] / [SPTCP] * 100 end CVENT.ClientView.calculatedColumn.2.renderer=PERC CVENT.ClientView.calculatedColumn.2.resolutions=r,1,6,d,w,m CVENT.ClientView.calculatedColumn.2.group=MyAwesomeMetricGroup
But when it comes to the ISP Mode..everything changes..
Check your CAS Configuration:
CAS->Settings->Central Analysis Server-> Server Configuration
If you're in ISP Mode you can't use any combination of the following dimensions and user-related metrics to create a custom one:
You can check the list and the explanation of the limitation of the ISP Mode here:
Unfortunately you won't be able to know these limitations from the User-defined metrics page..
So, if you're writing any user-defined metric using any of the user-related metrics of the list (in combination with the reported dimensions, obviously) you won't see your created metric and in the server.log you will see something like this:
DMIProperties Property calculatedColumnForbiddenCols=CliCnt,AffUserNet,AffUserNetCPerc,AffUserAvl,NotAffUserNet,NotAffUserAvl,CliCntC,CliIpCnt,GrCnt set to CVENT.ClientView
So before creating any User-defined metrics involving user-related metrics please check your CAS Configuration!
That's all folks!
Hope it will help.
13 People are following this .