Exemplo n.º 1
0
  public void start() {
    try {
      String perfFramework = System.getProperty("perf-framework");
      if (perfFramework == null) {
        return;
      }

      // Connection Success
      this.createConnectionBusListener = new CreateConnectionBusListener();
      this.createConnectionBusListener.start();
      Bus.startBus("connection-success");
      Bus.addBusListener("connection-success", this.createConnectionBusListener);

      // Failed Connection
      File failedConnectionFile = new File("connection-failed.xml");
      failedConnectionFile.delete();
      this.failedConnection = new FileOutputStream("connection-failed.xml", true);
      this.failedConnectionCtr = 0;

      // Request Sent Successfully
      this.requestSentBusListener = new RequestSentBusListener();
      this.requestSentBusListener.start();
      Bus.startBus("request-success");
      Bus.addBusListener("request-success", this.requestSentBusListener);

      // Request Failed
      File requestFailedFile = new File("request-failed.xml");
      requestFailedFile.delete();
      this.requestFailed = new FileOutputStream("request-failed.xml", true);
      this.requestFailedCtr = 0;

      // Response Received
      File responseReceivedFile = new File("response-success.xml");
      responseReceivedFile.delete();
      this.responseReceived = new FileOutputStream("response-success.xml", true);
      this.responseReceivedCtr = 0;

      // Response Failed
      File responseFailedFile = new File("response-failed.xml");
      responseFailedFile.delete();
      this.responseFailed = new FileOutputStream("response-failed.xml", true);
      this.responseFailedCtr = 0;

      // Push Failed
      File pushFailedFile = new File("push-failed.xml");
      pushFailedFile.delete();
      this.pushFailed = new FileOutputStream("push-failed.xml", true);
      this.pushFailedCtr = 0;

      // Bytes Transferred
      File bytes = new File("bytes.xml");
      bytes.delete();
      this.bytesFile = new FileOutputStream("bytes.xml", true);
      this.bytesTransferred = new ArrayList<Long>();
    } catch (Throwable t) {
      throw new RuntimeException(t);
    }
  }
Exemplo n.º 2
0
 public void logRequestSent() {
   String perfFramework = System.getProperty("perf-framework");
   if (perfFramework == null) {
     return;
   }
   BusMessage busMessage = new BusMessage();
   busMessage.setBusUri("request-success");
   busMessage.setSenderUri("request-success");
   Bus.sendMessage(busMessage);
 }
Exemplo n.º 3
0
 public void logCreateConnection() {
   String perfFramework = System.getProperty("perf-framework");
   if (perfFramework == null) {
     return;
   }
   BusMessage busMessage = new BusMessage();
   busMessage.setBusUri("connection-success");
   busMessage.setSenderUri("connection-success");
   Bus.sendMessage(busMessage);
 }