13#include "nsm2/belle2nsm.h"
15#include "daq/rfarm/manager/RFConf.h"
16#include "daq/rfarm/manager/RfNodeInfo.h"
18#define MONITOR_NODE "rf_mon"
26 char* conffile = getenv(
"RFARM_CONFFILE");
29 char* format = conf.getconf(
"system",
"nsmdata");
32 if (!b2nsm_init(MONITOR_NODE)) {
33 printf(
"Error in initializing NSM : %s\n", b2nsm_strerror());
37 printf(
"----- Control Nodes\n");
40 char* node = conf.getconf(
"distributor",
"nodename");
42 printf(
" RFIN : %8d %4d %5.2f %5.2f ; %6.2f; %5.2f\n",
43 nshm->nevent_in, nshm->nqueue_in, nshm->avesize_in,
44 nshm->flowrate_in, nshm->evtrate_in, nshm->loadave);
46 node = conf.getconf(
"collector",
"nodename");
47 nshm = (
struct RfNodeInfo*) b2nsm_openmem(node, format, 1);
48 printf(
" RFOUT : %8d %4d %5.2f %5.2f ; %6.2f; %5.2f\n",
49 nshm->nevent_out, nshm->nqueue_out, nshm->avesize_out,
50 nshm->flowrate_out, nshm->evtrate_out, nshm->loadave);
52 printf(
"----- Processing Nodes\n");
55 int maxnodes = conf.getconfi(
"processor",
"nnodes");
56 int idbase = conf.getconfi(
"processor",
"idbase");
57 char* hostbase = conf.getconf(
"processor",
"nodebase");
58 char* badlist = conf.getconf(
"processor",
"badlist");
60 char hostnode[512], idname[3];
62 for (
int i = 0; i < maxnodes; i++) {
63 sprintf(idname,
"%2.2d", idbase + i);
64 if (badlist == NULL ||
65 strstr(badlist, idname) == 0) {
66 sprintf(hostnode,
"evp_%s%2.2d", hostbase, idbase + i);
67 nshm = (
struct RfNodeInfo*) b2nsm_openmem(hostnode, format, 1);
68 printf(
" %s(in) : %8d %4d %5.2f %5.2f ; %6.2f; %5.2f\n",
70 nshm->nevent_in, nshm->nqueue_in, nshm->avesize_in,
71 nshm->flowrate_in, nshm->evtrate_in, nshm->loadave);
72 printf(
" %s(out): %8d %4d %5.2f %5.2f ; %6.2f; %5.2f\n",
74 nshm->nevent_out, nshm->nqueue_out, nshm->avesize_out,
75 nshm->flowrate_out, nshm->evtrate_out, nshm->loadave);
Abstract base class for different kinds of events.