e.printStackTrace();
fail("Metric Data Loader Error.");
}
// Verify Data
DatabaseWriter db = null;
try {
db = new DatabaseWriter(cluster);
Macro mp = new Macro(current,current, "select * from [system_metrics]");
String query = mp.toString();
ResultSet rs = db.query(query);
ResultSetMetaData rmeta = rs.getMetaData();
int size = rmeta.getColumnCount();
while(rs.next()) {
for(int i=1;i<=size;i++) {
int columnType = rmeta.getColumnType(i);
if(columnType==java.sql.Types.BIGINT ||
columnType==java.sql.Types.INTEGER) {
long testValue = rs.getLong(i);
assertTrue(testValue<1000000000L);
} else if(columnType==java.sql.Types.FLOAT ||
columnType==java.sql.Types.DOUBLE) {
double testValue = rs.getDouble(i);
assertTrue(testValue<1000000000L);
}
}
}
} catch(Throwable ex) {
fail("Data verification failed.");
} finally {
if(db!=null) {
db.close();
}
}
}