use of org.jpos.util.TPS in project jPOS by jpos.
the class TMMonitor method actionPerformed.
public void actionPerformed(ActionEvent e) {
TPS t = txnmgr.getTPS();
tps.setText(Integer.toString(t.intValue()));
tpsAvg.setText(String.format("%.2f", t.getAvg()));
tpsPeak.setText(Integer.toString(t.getPeak()));
}
use of org.jpos.util.TPS in project jPOS by jpos.
the class PackagerTestCase method testPerformance.
@Test
public void testPerformance() throws Exception {
final int COUNT = 100000;
ISOPackager p = new GenericPackager("src/main/resources/packager/iso87binary.xml");
ISOMsg baseMsg = getMsg("ISO87");
System.out.println("\n--- pack/unpack performance test ---\n");
Profiler prof = new Profiler();
TPS tps = new TPS(true);
for (int i = 0; i < COUNT; i++) {
pack(baseMsg, p);
tps.tick();
}
prof.checkPoint("PACK " + tps.toString());
byte[] buf = baseMsg.pack();
tps = new TPS(true);
for (int i = 0; i < COUNT; i++) {
unpack(buf, p);
tps.tick();
}
prof.checkPoint("UNPACK " + tps.toString());
tps = new TPS(true);
for (int i = 0; i < COUNT; i++) {
pack(baseMsg, p);
unpack(buf, p);
tps.tick();
}
prof.checkPoint("PACK/UNPACK " + tps.toString());
tps = new TPS(true);
for (int i = 0; i < COUNT; i++) {
updatePackAndUnpack(baseMsg, p);
tps.tick();
}
prof.checkPoint("UPDATE/PACK/UNPACK " + tps.toString());
prof.dump(System.out, "");
System.out.println("");
}
Aggregations