/** * Create an instance of {@link NetworkAdapterPerformanceData } * */ public NetworkAdapterPerformanceData createNetworkAdapterPerformanceData() { return new NetworkAdapterPerformanceData(); }
t2.ResponseTime = res.getMachinePerformanceData().get(i).getNetworkAdapterPerformanceData().get(k).getKilobytespersecondNetworkReceive(); t2.cal = res.getMachinePerformanceData().get(i).getTimestamp(); if (dataRX.Contains(res.getMachinePerformanceData().get(i).getNetworkAdapterPerformanceData().get(k).getAdapterName())) { dataRX.get(res.getMachinePerformanceData().get(i).getNetworkAdapterPerformanceData().get(k).getAdapterName()).add(t2); } else { RateStruct t3 = new RateStruct(); t3.item = res.getMachinePerformanceData().get(i).getNetworkAdapterPerformanceData().get(k).getAdapterName(); t3.data = new ArrayList<TransactionLogTimeStampStruct>(); t3.data.add(t2); t2.ResponseTime = res.getMachinePerformanceData().get(i).getNetworkAdapterPerformanceData().get(k).getKilobytespersecondNetworkTransmit(); t2.cal = res.getMachinePerformanceData().get(i).getTimestamp(); if (dataTX.Contains(res.getMachinePerformanceData().get(i).getNetworkAdapterPerformanceData().get(k).getAdapterName())) { dataTX.get(res.getMachinePerformanceData().get(i).getNetworkAdapterPerformanceData().get(k).getAdapterName()).add(t2); } else { RateStruct t3 = new RateStruct(); t3.item = res.getMachinePerformanceData().get(i).getNetworkAdapterPerformanceData().get(k).getAdapterName(); t3.data = new ArrayList<TransactionLogTimeStampStruct>(); t3.data.add(t2);
private List<NetworkAdapterPerformanceData> getNICLogsByRange(String hostname, String domainname, long timestamp) { Connection con = Utility.getPerformanceDBConnection(); List<NetworkAdapterPerformanceData> ret = new ArrayList<NetworkAdapterPerformanceData>(); NetworkAdapterPerformanceData p = null; PreparedStatement com = null; ResultSet rs = null; try { com = con.prepareStatement("select * from rawdatanic where hostname=? and domainname=? and utcdatetime = ?;"); com.setString(1, hostname); com.setString(2, domainname); com.setLong(3, timestamp); rs = com.executeQuery(); while (rs.next()) { p = new NetworkAdapterPerformanceData(); p.setAdapterName(rs.getString("nicid")); p.setKilobytespersecondNetworkReceive(rs.getLong("receiveKBs")); p.setKilobytespersecondNetworkTransmit(rs.getLong("sendKBs")); GregorianCalendar gcal = new GregorianCalendar(); gcal.setTimeInMillis(rs.getLong("utcdatetime")); ret.add(p); } } catch (Exception ex) { log.log(Level.ERROR, null, ex); } finally { DBUtils.safeClose(rs); DBUtils.safeClose(com); DBUtils.safeClose(con); } return ret; }
+ "(nicid, hostname,domainname, utcdatetime, sendkbs, receivekbs, id, uri) " + "VALUES (?, ?, ?, ?, ?,?, ?, ?);"); com.setString(1, Utility.truncate(req.getMachineData().getNetworkAdapterPerformanceData().get(i).getAdapterName(), MAXTEXT)); com.setString(2, Utility.truncate(req.getHostname(), MAXTEXT)); com.setString(3, Utility.truncate(req.getDomainname(), MAXTEXT)); com.setLong(5, req.getMachineData().getNetworkAdapterPerformanceData().get(i).getKilobytespersecondNetworkTransmit()); com.setLong(6, req.getMachineData().getNetworkAdapterPerformanceData().get(i).getKilobytespersecondNetworkReceive());
for (int i = 0; i < mp.getRecordNetworkUsage().size(); i++) { try { NetworkAdapterPerformanceData d = new NetworkAdapterPerformanceData(); d.setAdapterName(mp.getRecordNetworkUsage().get(i)); rs = com.executeQuery(); if (rs.next()) { d.setKilobytespersecondNetworkTransmit(rs.getLong("sendKBs")); d.setKilobytespersecondNetworkReceive(rs.getLong("receiveKBs"));