The Profiler
We can set up the profiler to track the MAD statistical state required to compute MAD.
For the purposes of this demonstration, we will configure the profiler to capture statistics on
the minute mark. We will capture a global statistical state for the value field
and we will look back for a 5 minute window when computing the median.
Create the following file at
$METRON_HOME/config/zookeeper/profiler.json:
{
"profiles": [
{
"profile": "sketchy_mad",
"foreach": "'global'",
"onlyif": "true",
"init" : {
"s": "OUTLIER_MAD_STATE_MERGE(PROFILE_GET('sketchy_mad',
'global', PROFILE_FIXED(5, 'MINUTES')))"
},
"update": {
"s": "OUTLIER_MAD_ADD(s, value)"
},
"result": "s"
}
]
}
Adjust $METRON_HOME/config/zookeeper/global.json to adjust the capture
duration:
"profiler.client.period.duration" : "1", "profiler.client.period.duration.units" : "MINUTES"
Adjust $METRON_HOME/config/profiler.properties to adjust the capture
duration by changing profiler.period.duration=15to
profiler.period.duration=1

