Search in sources :

Example 1 with TPS

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()));
}
Also used : TPS(org.jpos.util.TPS)

Example 2 with TPS

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("");
}
Also used : ISOPackager(org.jpos.iso.ISOPackager) ISOMsg(org.jpos.iso.ISOMsg) Profiler(org.jpos.util.Profiler) TPS(org.jpos.util.TPS) Test(org.junit.jupiter.api.Test)

Aggregations

TPS (org.jpos.util.TPS)2 ISOMsg (org.jpos.iso.ISOMsg)1 ISOPackager (org.jpos.iso.ISOPackager)1 Profiler (org.jpos.util.Profiler)1 Test (org.junit.jupiter.api.Test)1