@Override public boolean CheckTransactionalRule(ProcessPerformanceData req, List<NameValuePair> params, AtomicReference<String> nullableFaultMsg) { if (nullableFaultMsg != null) { nullableFaultMsg = new AtomicReference<String>(); } NameValuePair value = Utility.getNameValuePairByName(params, "value"); int x = 0; if (value.isEncrypted()) { x = Integer.parseInt(Utility.DE(value.getValue())); } else { x = Integer.parseInt(value.getValue()); } if (req.getNumberofActiveThreads() != null && x > req.getNumberofActiveThreads().longValue()) { nullableFaultMsg.set("The number of active threads, " + req.getNumberofActiveThreads() + " is higher than the threshold of " + x + ", " + nullableFaultMsg.get()); return true; } return false; }
public Object produceDataset(Map params) throws DatasetProduceException { TimeSeriesCollection col = new TimeSeriesCollection(); try { //Logger.getAnonymousLogger().log(Level.INFO, "fgsmsWEB debug, size" + params.size()); GetProcessPerformanceLogsByRangeResponseMsg res = (GetProcessPerformanceLogsByRangeResponseMsg) params.get("fgsms.data"); if (res != null && res.getProcessData() != null && !res.getProcessData().isEmpty()) { TimeSeries s = new TimeSeries("Active Threads", org.jfree.data.time.Millisecond.class); for (int i = 0; i < res.getProcessData().size(); i++) { Millisecond m = new Millisecond(res.getProcessData().get(i).getTimestamp().getTime()); // TimeSeriesDataItem t = new TimeSeriesDataItem(m, // recordset.stuff.get(i).data.get(k).ResponseTime); // s.add(t); if (res.getProcessData().get(i).getNumberofActiveThreads() != null) { s.addOrUpdate(m, res.getProcessData().get(i).getNumberofActiveThreads()); } } col.addSeries(s); } } catch (Exception ex) { LogHelper.getLog().log(Level.ERROR, "ProcessPerfLogsOverTimeThreads produce chart data " + ex.getLocalizedMessage()); } return col; }
com.setLong(5, req.getProcessData().get(i).getTimestamp().getTimeInMillis()); if (req.getProcessData().get(i).getNumberofActiveThreads() == null) { com.setNull(6, java.sql.Types.BIGINT); } else { com.setLong(6, req.getProcessData().get(i).getNumberofActiveThreads());