private void populateGrid(ServiceMonitorVoCollection monitors) { form.grdMonitorList().getRows().clear(); grdMonitorListRow row; ServiceMonitorVo vo = null; for(int i=0;i<monitors.size();i++) { vo = monitors.get(i); row = form.grdMonitorList().getRows().newRow(); row.setServiceName(vo.getServiceName()); row.setHits(vo.getHits()); row.setAvg(vo.getAvg()); row.setTotal(vo.getTotal()); row.setStdDev(vo.getStdDev().toString()); row.setLastValue(vo.getLast().toString()); row.setMin(vo.getMin().toString()); row.setMax(vo.getMax().toString()); row.setActive(vo.getActive().toString()); row.setAvgActive(vo.getAvgActive().toString()); row.setMaxActive(vo.getMaxActive().toString()); row.setFirstAccess(vo.getFirstAccess().toString()); row.setLastAccess(vo.getLastAccess().toString()); } }
/** * Retrieves all the Service Monitor Values */ public ServiceMonitorVoCollection getServiceMonitors(String filter) { MonitorComposite rootMonitor = MonitorFactory.getRootMonitor(); Monitor[] allMonitors = rootMonitor.getMonitors(); ServiceMonitorVoCollection ret = new ServiceMonitorVoCollection(); Monitor currentMonitor = null; String serviceName = null; for (int i = 0; i < allMonitors.length; i++) { currentMonitor = allMonitors[i]; ServiceMonitorVo vo = new ServiceMonitorVo(); List list = new ArrayList(); currentMonitor.getMonKey().getRowData(list); serviceName = list.get(0).toString(); if (filter == null || filter.equals("") || (serviceName.indexOf(filter) != -1)) { vo.setServiceName(serviceName); vo.setHits(new Integer((int) currentMonitor.getHits())); vo.setAvg(new Integer((int) currentMonitor.getAvg())); vo.setTotal(new Integer((int) currentMonitor.getTotal())); vo.setStdDev(new Float((float) currentMonitor.getStdDev())); vo.setLast(new Float((float) currentMonitor.getLastValue())); vo.setMin(new Float((float) currentMonitor.getMin())); vo.setMax(new Float((float) currentMonitor.getMax())); vo.setActive(new Integer((int) currentMonitor.getActive())); vo.setAvgActive(new Float((float) currentMonitor.getAvgActive())); vo.setMaxActive(new Integer((int) currentMonitor.getMaxActive())); vo.setFirstAccess(new DateTime(currentMonitor.getFirstAccess())); vo.setLastAccess(new DateTime(currentMonitor.getLastAccess())); ret.add(vo); } } return ret; }