Monitoring & Analytics - Siebel Task
Customer
True Telecom
Description
Germain’s rule that monitors Siebel Tasks (among other things) have been updated mostly to reduce the number of siebel server manager call.
Configure
Log on to germain>Left Menu> Analytics > Rules > siebel-app-monitor-drl > Component Task Metrics
CODE
rule "Component Task Metrics"
when
$r : ListComponentsOutputRecord( cpDispRunState in ( "Online", "Running" ), cpMaxTasks > 0 )
$tasks : List( ) from collect ( ListTasksOutputRecord( ccAlias == $r.ccAlias ) )
then
StringBuilder sb = new StringBuilder();
for (ListTasksOutputRecord t : $tasks) {
sb.append(t.svName);
sb.append("\t");
sb.append(t.ccAlias);
sb.append("\t");
sb.append(t.cgAlias);
sb.append("\t");
sb.append(t.tkTaskId);
sb.append("\t");
sb.append(t.tkPid);
sb.append("\t");
sb.append(t.tkDispRunstate);
sb.append("\t");
sb.append(t.ccRunmode);
sb.append("\t");
sb.append(t.tkStartTime);
sb.append("\t");
sb.append(t.tkEndTime);
sb.append("\t");
sb.append(t.tkStatus);
sb.append("\t");
sb.append(t.tkParentTaskId);
sb.append("\t");
sb.append(t.ccIncarnationNum);
sb.append("\t");
sb.append(t.tkLabel);
sb.append("\t");
sb.append(t.tkTasktype);
sb.append("\t");
sb.append(t.tkPingTime);
sb.append("\n");
}
// Number of running tasks per component
GenericMetric m = new GenericMetric();
m.timestamp = OffsetDateTime.now();
m.type = "Siebel:Task";
m.name = $r.ccRunmode;
m.value = (double)$r.cpNumRunTasks;
m.details = sb.toString();
m.application.component = $r.ccAlias;
datamart.insert(m, context);
// Pct of max tasks running per component
m = new GenericMetric();
m.timestamp = OffsetDateTime.now();
m.type = "Siebel:TaskPct";
m.name = $r.ccRunmode;
m.value = Math.round(((double)$r.cpNumRunTasks / (double)$r.cpMaxTasks) * 100.0 * 1000.0) / 1000.0;
m.details = sb.toString();
m.application.component = $r.ccAlias;
datamart.insert(m, context);
// Number of running tasks per process for this component
int numProcs = $r.cpActvMtsProcs == 0 ? 1 : $r.cpActvMtsProcs;
m = new GenericMetric();
m.timestamp = OffsetDateTime.now();
m.type = "Siebel:Running Tasks Process";
m.name = $r.ccRunmode;
double numTasksPerProc = (double)$r.cpNumRunTasks / (double)numProcs;
m.value = numTasksPerProc;
m.details = sb.toString();
m.application.component = $r.ccAlias;
datamart.insert(m, context);
// Max number of running tasks per process for this component
int maxProcs = $r.cpMaxMtsProcs == 0 ? 1 : $r.cpMaxMtsProcs;
m = new GenericMetric();
m.timestamp = OffsetDateTime.now();
m.type = "Siebel:Max Tasks Process";
m.name = $r.ccRunmode;
double maxTasksPerProc = (double)$r.cpMaxTasks / (double)numProcs;
m.value = maxTasksPerProc;
m.details = sb.toString();
m.application.component = $r.ccAlias;
datamart.insert(m, context);
// Pct of max tasks per process for this component
m = new GenericMetric();
m.timestamp = OffsetDateTime.now();
m.type = "Siebel:TaskPct Process";
m.name = $r.ccRunmode;
m.value = Math.round((numTasksPerProc / maxTasksPerProc) * 100.0 * 1000.0) / 1000.0;
m.details = sb.toString();
m.application.component = $r.ccAlias;
datamart.insert(m, context);
end
rule "Component Mts Metrics"
when
$r : ListComponentsOutputRecord( cpDispRunState in ( "Online", "Running" ), cpMaxMtsProcs > 0 )
then
// Number of running processes
GenericMetric m = new GenericMetric();
m.timestamp = OffsetDateTime.now();
m.type = "Siebel:MtsProcs";
m.name = $r.ccAlias;
m.value = (double)$r.cpActvMtsProcs;
m.application.component = $r.ccAlias;
datamart.insert(m, context);
// Percent running of max processes
m = new GenericMetric();
m.timestamp = OffsetDateTime.now();
m.type = "Siebel:MtsProcsPct";
m.name = $r.ccAlias;
m.value = ((double)$r.cpActvMtsProcs/(double)$r.cpMaxMtsProcs) * 100.0;
m.application.component = $r.ccAlias;
datamart.insert(m, context);
end