changeset 425:d0c9e307bae4

reporter protocol changed
author Devel 1
date Wed, 26 Jul 2017 09:38:48 +0200
parents da47cd628783
children e814e2c0a600
files stress-tester-benchmark/src/main/java/com/passus/java/Sleep.java stress-tester-benchmark/src/main/java/com/passus/st/avro/AvroRpcBenchmark.java stress-tester-comparator/src/main/java/com/passus/st/comparator/Main.java stress-tester-reporter/src/main/avro/reporter.avdl stress-tester-reporter/src/main/java/com/passus/st/reporter/protocol/MetricsCollectionRecord.java stress-tester-reporter/src/main/java/com/passus/st/reporter/protocol/Reporter.java stress-tester-reporter/src/main/java/com/passus/st/reporter/server/ReporterImpl.java stress-tester/src/main/java/com/passus/st/Main.java stress-tester/src/main/java/com/passus/st/metric/ScheduledMetricsCollector.java
diffstat 9 files changed, 426 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester-benchmark/src/main/java/com/passus/java/Sleep.java	Mon Jul 24 12:44:06 2017 +0200
+++ b/stress-tester-benchmark/src/main/java/com/passus/java/Sleep.java	Wed Jul 26 09:38:48 2017 +0200
@@ -98,7 +98,7 @@
     }
 
     public static void main(String[] args) throws RunnerException {
-        Options opt = new OptionsBuilder().timeUnit(TimeUnit.MICROSECONDS).include(Sleep.class.getSimpleName() + ".*Park.*").build();
+        Options opt = new OptionsBuilder().timeUnit(TimeUnit.MICROSECONDS).include(Sleep.class.getSimpleName() + ".test0.*").build();
 //        Options opt = new OptionsBuilder().include(Sleep.class.getSimpleName() + ".*").build();
         new Runner(opt).run();
     }
--- a/stress-tester-benchmark/src/main/java/com/passus/st/avro/AvroRpcBenchmark.java	Mon Jul 24 12:44:06 2017 +0200
+++ b/stress-tester-benchmark/src/main/java/com/passus/st/avro/AvroRpcBenchmark.java	Wed Jul 26 09:38:48 2017 +0200
@@ -2,9 +2,8 @@
 
 import static com.passus.commons.collection.FluentBuilder.e;
 import static com.passus.commons.collection.FluentBuilder.map;
-import com.passus.st.reporter.protocol.HttpReq;
-import com.passus.st.reporter.protocol.HttpResp;
 import com.passus.st.reporter.protocol.MetricRecord;
+import com.passus.st.reporter.protocol.MetricsCollectionRecord;
 import com.passus.st.reporter.protocol.Reporter;
 import com.passus.utils.AllocationUtils;
 import java.io.IOException;
@@ -102,12 +101,12 @@
     private static class DummyReporter implements Reporter {
 
         @Override
-        public CharSequence handleHttp(HttpReq request, HttpResp response) throws AvroRemoteException {
+        public CharSequence handleMetric(MetricRecord metric) throws AvroRemoteException {
             return "OK";
         }
 
         @Override
-        public CharSequence handleMetric(MetricRecord metric) throws AvroRemoteException {
+        public CharSequence handleMetricsCollection(MetricsCollectionRecord collection) throws AvroRemoteException {
             return "OK";
         }
 
--- a/stress-tester-comparator/src/main/java/com/passus/st/comparator/Main.java	Mon Jul 24 12:44:06 2017 +0200
+++ b/stress-tester-comparator/src/main/java/com/passus/st/comparator/Main.java	Wed Jul 26 09:38:48 2017 +0200
@@ -47,12 +47,21 @@
     }
 
     public static void compareTwoRuns(String dir1Path, String dir2Path) throws IOException {
-        System.out.println("Compare " + dir1Path + " to " + dir2Path);
         DirectoryScanner scanner = new DirectoryScanner();
         scanner.setScan(true, true, false);
+        long ts;
+
+        System.out.println("Scanning directory " + dir1Path);
+        ts = System.currentTimeMillis();
         ArrayList<HttpEntry> list1 = scanner.scan(new File(dir1Path));
+        System.out.println("\t done in " + (System.currentTimeMillis() - ts) + " ms");
+
+        System.out.println("Scanning directory " + dir1Path);
+        ts = System.currentTimeMillis();
         ArrayList<HttpEntry> list2 = scanner.scan(new File(dir2Path));
+        System.out.println("\t done in " + (System.currentTimeMillis() - ts) + " ms");
 
+        System.out.println("Compare " + dir1Path + " to " + dir2Path);
         List<Reportable> result = Comparator.compare(list1, list2);
         for (Reportable r : result) {
             System.out.println(r.toStringMultiline());
--- a/stress-tester-reporter/src/main/avro/reporter.avdl	Mon Jul 24 12:44:06 2017 +0200
+++ b/stress-tester-reporter/src/main/avro/reporter.avdl	Wed Jul 26 09:38:48 2017 +0200
@@ -11,5 +11,13 @@
   map<union { null, int, long, float, double, string, array<HttpHeader>, map<union {null, int, long, float, double, string}> }> fields;
  }
 
+ record MetricsCollectionRecord {
+  long startTimestamp;
+  long endTimestamp;
+  array<MetricRecord> metrics;
+ }
+
  string handleMetric(MetricRecord metric);
+
+ string handleMetricsCollection(MetricsCollectionRecord collection);
 }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester-reporter/src/main/java/com/passus/st/reporter/protocol/MetricsCollectionRecord.java	Wed Jul 26 09:38:48 2017 +0200
@@ -0,0 +1,376 @@
+/**
+ * Autogenerated by Avro
+ *
+ * DO NOT EDIT DIRECTLY
+ */
+package com.passus.st.reporter.protocol;
+
+import org.apache.avro.specific.SpecificData;
+import org.apache.avro.message.BinaryMessageEncoder;
+import org.apache.avro.message.BinaryMessageDecoder;
+import org.apache.avro.message.SchemaStore;
+
+@SuppressWarnings("all")
+@org.apache.avro.specific.AvroGenerated
+public class MetricsCollectionRecord extends org.apache.avro.specific.SpecificRecordBase implements org.apache.avro.specific.SpecificRecord {
+  private static final long serialVersionUID = 6439905265096882126L;
+  public static final org.apache.avro.Schema SCHEMA$ = new org.apache.avro.Schema.Parser().parse("{\"type\":\"record\",\"name\":\"MetricsCollectionRecord\",\"namespace\":\"com.passus.st.reporter.protocol\",\"fields\":[{\"name\":\"startTimestamp\",\"type\":\"long\"},{\"name\":\"endTimestamp\",\"type\":\"long\"},{\"name\":\"metrics\",\"type\":{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"MetricRecord\",\"fields\":[{\"name\":\"code\",\"type\":\"string\"},{\"name\":\"fields\",\"type\":{\"type\":\"map\",\"values\":[\"null\",\"int\",\"long\",\"float\",\"double\",\"string\",{\"type\":\"array\",\"items\":{\"type\":\"record\",\"name\":\"HttpHeader\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"}]}},{\"type\":\"map\",\"values\":[\"null\",\"int\",\"long\",\"float\",\"double\",\"string\"]}]}}]}}}]}");
+  public static org.apache.avro.Schema getClassSchema() { return SCHEMA$; }
+
+  private static SpecificData MODEL$ = new SpecificData();
+
+  private static final BinaryMessageEncoder<MetricsCollectionRecord> ENCODER =
+      new BinaryMessageEncoder<MetricsCollectionRecord>(MODEL$, SCHEMA$);
+
+  private static final BinaryMessageDecoder<MetricsCollectionRecord> DECODER =
+      new BinaryMessageDecoder<MetricsCollectionRecord>(MODEL$, SCHEMA$);
+
+  /**
+   * Return the BinaryMessageDecoder instance used by this class.
+   */
+  public static BinaryMessageDecoder<MetricsCollectionRecord> getDecoder() {
+    return DECODER;
+  }
+
+  /**
+   * Create a new BinaryMessageDecoder instance for this class that uses the specified {@link SchemaStore}.
+   * @param resolver a {@link SchemaStore} used to find schemas by fingerprint
+   */
+  public static BinaryMessageDecoder<MetricsCollectionRecord> createDecoder(SchemaStore resolver) {
+    return new BinaryMessageDecoder<MetricsCollectionRecord>(MODEL$, SCHEMA$, resolver);
+  }
+
+  /** Serializes this MetricsCollectionRecord to a ByteBuffer. */
+  public java.nio.ByteBuffer toByteBuffer() throws java.io.IOException {
+    return ENCODER.encode(this);
+  }
+
+  /** Deserializes a MetricsCollectionRecord from a ByteBuffer. */
+  public static MetricsCollectionRecord fromByteBuffer(
+      java.nio.ByteBuffer b) throws java.io.IOException {
+    return DECODER.decode(b);
+  }
+
+  @Deprecated public long startTimestamp;
+  @Deprecated public long endTimestamp;
+  @Deprecated public java.util.List<com.passus.st.reporter.protocol.MetricRecord> metrics;
+
+  /**
+   * Default constructor.  Note that this does not initialize fields
+   * to their default values from the schema.  If that is desired then
+   * one should use <code>newBuilder()</code>.
+   */
+  public MetricsCollectionRecord() {}
+
+  /**
+   * All-args constructor.
+   * @param startTimestamp The new value for startTimestamp
+   * @param endTimestamp The new value for endTimestamp
+   * @param metrics The new value for metrics
+   */
+  public MetricsCollectionRecord(java.lang.Long startTimestamp, java.lang.Long endTimestamp, java.util.List<com.passus.st.reporter.protocol.MetricRecord> metrics) {
+    this.startTimestamp = startTimestamp;
+    this.endTimestamp = endTimestamp;
+    this.metrics = metrics;
+  }
+
+  public org.apache.avro.Schema getSchema() { return SCHEMA$; }
+  // Used by DatumWriter.  Applications should not call.
+  public java.lang.Object get(int field$) {
+    switch (field$) {
+    case 0: return startTimestamp;
+    case 1: return endTimestamp;
+    case 2: return metrics;
+    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
+    }
+  }
+
+  // Used by DatumReader.  Applications should not call.
+  @SuppressWarnings(value="unchecked")
+  public void put(int field$, java.lang.Object value$) {
+    switch (field$) {
+    case 0: startTimestamp = (java.lang.Long)value$; break;
+    case 1: endTimestamp = (java.lang.Long)value$; break;
+    case 2: metrics = (java.util.List<com.passus.st.reporter.protocol.MetricRecord>)value$; break;
+    default: throw new org.apache.avro.AvroRuntimeException("Bad index");
+    }
+  }
+
+  /**
+   * Gets the value of the 'startTimestamp' field.
+   * @return The value of the 'startTimestamp' field.
+   */
+  public java.lang.Long getStartTimestamp() {
+    return startTimestamp;
+  }
+
+  /**
+   * Sets the value of the 'startTimestamp' field.
+   * @param value the value to set.
+   */
+  public void setStartTimestamp(java.lang.Long value) {
+    this.startTimestamp = value;
+  }
+
+  /**
+   * Gets the value of the 'endTimestamp' field.
+   * @return The value of the 'endTimestamp' field.
+   */
+  public java.lang.Long getEndTimestamp() {
+    return endTimestamp;
+  }
+
+  /**
+   * Sets the value of the 'endTimestamp' field.
+   * @param value the value to set.
+   */
+  public void setEndTimestamp(java.lang.Long value) {
+    this.endTimestamp = value;
+  }
+
+  /**
+   * Gets the value of the 'metrics' field.
+   * @return The value of the 'metrics' field.
+   */
+  public java.util.List<com.passus.st.reporter.protocol.MetricRecord> getMetrics() {
+    return metrics;
+  }
+
+  /**
+   * Sets the value of the 'metrics' field.
+   * @param value the value to set.
+   */
+  public void setMetrics(java.util.List<com.passus.st.reporter.protocol.MetricRecord> value) {
+    this.metrics = value;
+  }
+
+  /**
+   * Creates a new MetricsCollectionRecord RecordBuilder.
+   * @return A new MetricsCollectionRecord RecordBuilder
+   */
+  public static com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder newBuilder() {
+    return new com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder();
+  }
+
+  /**
+   * Creates a new MetricsCollectionRecord RecordBuilder by copying an existing Builder.
+   * @param other The existing builder to copy.
+   * @return A new MetricsCollectionRecord RecordBuilder
+   */
+  public static com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder newBuilder(com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder other) {
+    return new com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder(other);
+  }
+
+  /**
+   * Creates a new MetricsCollectionRecord RecordBuilder by copying an existing MetricsCollectionRecord instance.
+   * @param other The existing instance to copy.
+   * @return A new MetricsCollectionRecord RecordBuilder
+   */
+  public static com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder newBuilder(com.passus.st.reporter.protocol.MetricsCollectionRecord other) {
+    return new com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder(other);
+  }
+
+  /**
+   * RecordBuilder for MetricsCollectionRecord instances.
+   */
+  public static class Builder extends org.apache.avro.specific.SpecificRecordBuilderBase<MetricsCollectionRecord>
+    implements org.apache.avro.data.RecordBuilder<MetricsCollectionRecord> {
+
+    private long startTimestamp;
+    private long endTimestamp;
+    private java.util.List<com.passus.st.reporter.protocol.MetricRecord> metrics;
+
+    /** Creates a new Builder */
+    private Builder() {
+      super(SCHEMA$);
+    }
+
+    /**
+     * Creates a Builder by copying an existing Builder.
+     * @param other The existing Builder to copy.
+     */
+    private Builder(com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder other) {
+      super(other);
+      if (isValidValue(fields()[0], other.startTimestamp)) {
+        this.startTimestamp = data().deepCopy(fields()[0].schema(), other.startTimestamp);
+        fieldSetFlags()[0] = true;
+      }
+      if (isValidValue(fields()[1], other.endTimestamp)) {
+        this.endTimestamp = data().deepCopy(fields()[1].schema(), other.endTimestamp);
+        fieldSetFlags()[1] = true;
+      }
+      if (isValidValue(fields()[2], other.metrics)) {
+        this.metrics = data().deepCopy(fields()[2].schema(), other.metrics);
+        fieldSetFlags()[2] = true;
+      }
+    }
+
+    /**
+     * Creates a Builder by copying an existing MetricsCollectionRecord instance
+     * @param other The existing instance to copy.
+     */
+    private Builder(com.passus.st.reporter.protocol.MetricsCollectionRecord other) {
+            super(SCHEMA$);
+      if (isValidValue(fields()[0], other.startTimestamp)) {
+        this.startTimestamp = data().deepCopy(fields()[0].schema(), other.startTimestamp);
+        fieldSetFlags()[0] = true;
+      }
+      if (isValidValue(fields()[1], other.endTimestamp)) {
+        this.endTimestamp = data().deepCopy(fields()[1].schema(), other.endTimestamp);
+        fieldSetFlags()[1] = true;
+      }
+      if (isValidValue(fields()[2], other.metrics)) {
+        this.metrics = data().deepCopy(fields()[2].schema(), other.metrics);
+        fieldSetFlags()[2] = true;
+      }
+    }
+
+    /**
+      * Gets the value of the 'startTimestamp' field.
+      * @return The value.
+      */
+    public java.lang.Long getStartTimestamp() {
+      return startTimestamp;
+    }
+
+    /**
+      * Sets the value of the 'startTimestamp' field.
+      * @param value The value of 'startTimestamp'.
+      * @return This builder.
+      */
+    public com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder setStartTimestamp(long value) {
+      validate(fields()[0], value);
+      this.startTimestamp = value;
+      fieldSetFlags()[0] = true;
+      return this;
+    }
+
+    /**
+      * Checks whether the 'startTimestamp' field has been set.
+      * @return True if the 'startTimestamp' field has been set, false otherwise.
+      */
+    public boolean hasStartTimestamp() {
+      return fieldSetFlags()[0];
+    }
+
+
+    /**
+      * Clears the value of the 'startTimestamp' field.
+      * @return This builder.
+      */
+    public com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder clearStartTimestamp() {
+      fieldSetFlags()[0] = false;
+      return this;
+    }
+
+    /**
+      * Gets the value of the 'endTimestamp' field.
+      * @return The value.
+      */
+    public java.lang.Long getEndTimestamp() {
+      return endTimestamp;
+    }
+
+    /**
+      * Sets the value of the 'endTimestamp' field.
+      * @param value The value of 'endTimestamp'.
+      * @return This builder.
+      */
+    public com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder setEndTimestamp(long value) {
+      validate(fields()[1], value);
+      this.endTimestamp = value;
+      fieldSetFlags()[1] = true;
+      return this;
+    }
+
+    /**
+      * Checks whether the 'endTimestamp' field has been set.
+      * @return True if the 'endTimestamp' field has been set, false otherwise.
+      */
+    public boolean hasEndTimestamp() {
+      return fieldSetFlags()[1];
+    }
+
+
+    /**
+      * Clears the value of the 'endTimestamp' field.
+      * @return This builder.
+      */
+    public com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder clearEndTimestamp() {
+      fieldSetFlags()[1] = false;
+      return this;
+    }
+
+    /**
+      * Gets the value of the 'metrics' field.
+      * @return The value.
+      */
+    public java.util.List<com.passus.st.reporter.protocol.MetricRecord> getMetrics() {
+      return metrics;
+    }
+
+    /**
+      * Sets the value of the 'metrics' field.
+      * @param value The value of 'metrics'.
+      * @return This builder.
+      */
+    public com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder setMetrics(java.util.List<com.passus.st.reporter.protocol.MetricRecord> value) {
+      validate(fields()[2], value);
+      this.metrics = value;
+      fieldSetFlags()[2] = true;
+      return this;
+    }
+
+    /**
+      * Checks whether the 'metrics' field has been set.
+      * @return True if the 'metrics' field has been set, false otherwise.
+      */
+    public boolean hasMetrics() {
+      return fieldSetFlags()[2];
+    }
+
+
+    /**
+      * Clears the value of the 'metrics' field.
+      * @return This builder.
+      */
+    public com.passus.st.reporter.protocol.MetricsCollectionRecord.Builder clearMetrics() {
+      metrics = null;
+      fieldSetFlags()[2] = false;
+      return this;
+    }
+
+    @Override
+    @SuppressWarnings("unchecked")
+    public MetricsCollectionRecord build() {
+      try {
+        MetricsCollectionRecord record = new MetricsCollectionRecord();
+        record.startTimestamp = fieldSetFlags()[0] ? this.startTimestamp : (java.lang.Long) defaultValue(fields()[0]);
+        record.endTimestamp = fieldSetFlags()[1] ? this.endTimestamp : (java.lang.Long) defaultValue(fields()[1]);
+        record.metrics = fieldSetFlags()[2] ? this.metrics : (java.util.List<com.passus.st.reporter.protocol.MetricRecord>) defaultValue(fields()[2]);
+        return record;
+      } catch (java.lang.Exception e) {
+        throw new org.apache.avro.AvroRuntimeException(e);
+      }
+    }
+  }
+
+  @SuppressWarnings("unchecked")
+  private static final org.apache.avro.io.DatumWriter<MetricsCollectionRecord>
+    WRITER$ = (org.apache.avro.io.DatumWriter<MetricsCollectionRecord>)MODEL$.createDatumWriter(SCHEMA$);
+
+  @Override public void writeExternal(java.io.ObjectOutput out)
+    throws java.io.IOException {
+    WRITER$.write(this, SpecificData.getEncoder(out));
+  }
+
+  @SuppressWarnings("unchecked")
+  private static final org.apache.avro.io.DatumReader<MetricsCollectionRecord>
+    READER$ = (org.apache.avro.io.DatumReader<MetricsCollectionRecord>)MODEL$.createDatumReader(SCHEMA$);
+
+  @Override public void readExternal(java.io.ObjectInput in)
+    throws java.io.IOException {
+    READER$.read(this, SpecificData.getDecoder(in));
+  }
+
+}
--- a/stress-tester-reporter/src/main/java/com/passus/st/reporter/protocol/Reporter.java	Mon Jul 24 12:44:06 2017 +0200
+++ b/stress-tester-reporter/src/main/java/com/passus/st/reporter/protocol/Reporter.java	Wed Jul 26 09:38:48 2017 +0200
@@ -8,10 +8,13 @@
 @SuppressWarnings("all")
 @org.apache.avro.specific.AvroGenerated
 public interface Reporter {
-  public static final org.apache.avro.Protocol PROTOCOL = org.apache.avro.Protocol.parse("{\"protocol\":\"Reporter\",\"namespace\":\"com.passus.st.reporter.protocol\",\"types\":[{\"type\":\"record\",\"name\":\"HttpHeader\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"MetricRecord\",\"fields\":[{\"name\":\"code\",\"type\":\"string\"},{\"name\":\"fields\",\"type\":{\"type\":\"map\",\"values\":[\"null\",\"int\",\"long\",\"float\",\"double\",\"string\",{\"type\":\"array\",\"items\":\"HttpHeader\"},{\"type\":\"map\",\"values\":[\"null\",\"int\",\"long\",\"float\",\"double\",\"string\"]}]}}]}],\"messages\":{\"handleMetric\":{\"request\":[{\"name\":\"metric\",\"type\":\"MetricRecord\"}],\"response\":\"string\"}}}");
+  public static final org.apache.avro.Protocol PROTOCOL = org.apache.avro.Protocol.parse("{\"protocol\":\"Reporter\",\"namespace\":\"com.passus.st.reporter.protocol\",\"types\":[{\"type\":\"record\",\"name\":\"HttpHeader\",\"fields\":[{\"name\":\"name\",\"type\":\"string\"},{\"name\":\"value\",\"type\":\"string\"}]},{\"type\":\"record\",\"name\":\"MetricRecord\",\"fields\":[{\"name\":\"code\",\"type\":\"string\"},{\"name\":\"fields\",\"type\":{\"type\":\"map\",\"values\":[\"null\",\"int\",\"long\",\"float\",\"double\",\"string\",{\"type\":\"array\",\"items\":\"HttpHeader\"},{\"type\":\"map\",\"values\":[\"null\",\"int\",\"long\",\"float\",\"double\",\"string\"]}]}}]},{\"type\":\"record\",\"name\":\"MetricsCollectionRecord\",\"fields\":[{\"name\":\"startTimestamp\",\"type\":\"long\"},{\"name\":\"endTimestamp\",\"type\":\"long\"},{\"name\":\"metrics\",\"type\":{\"type\":\"array\",\"items\":\"MetricRecord\"}}]}],\"messages\":{\"handleMetric\":{\"request\":[{\"name\":\"metric\",\"type\":\"MetricRecord\"}],\"response\":\"string\"},\"handleMetricsCollection\":{\"request\":[{\"name\":\"collection\",\"type\":\"MetricsCollectionRecord\"}],\"response\":\"string\"}}}");
   /**
    */
   java.lang.CharSequence handleMetric(com.passus.st.reporter.protocol.MetricRecord metric) throws org.apache.avro.AvroRemoteException;
+  /**
+   */
+  java.lang.CharSequence handleMetricsCollection(com.passus.st.reporter.protocol.MetricsCollectionRecord collection) throws org.apache.avro.AvroRemoteException;
 
   @SuppressWarnings("all")
   public interface Callback extends Reporter {
@@ -20,5 +23,9 @@
      * @throws java.io.IOException The async call could not be completed.
      */
     void handleMetric(com.passus.st.reporter.protocol.MetricRecord metric, org.apache.avro.ipc.Callback<java.lang.CharSequence> callback) throws java.io.IOException;
+    /**
+     * @throws java.io.IOException The async call could not be completed.
+     */
+    void handleMetricsCollection(com.passus.st.reporter.protocol.MetricsCollectionRecord collection, org.apache.avro.ipc.Callback<java.lang.CharSequence> callback) throws java.io.IOException;
   }
 }
\ No newline at end of file
--- a/stress-tester-reporter/src/main/java/com/passus/st/reporter/server/ReporterImpl.java	Mon Jul 24 12:44:06 2017 +0200
+++ b/stress-tester-reporter/src/main/java/com/passus/st/reporter/server/ReporterImpl.java	Wed Jul 26 09:38:48 2017 +0200
@@ -1,6 +1,7 @@
 package com.passus.st.reporter.server;
 
 import com.passus.st.reporter.protocol.MetricRecord;
+import com.passus.st.reporter.protocol.MetricsCollectionRecord;
 import com.passus.st.reporter.protocol.Reporter;
 import java.io.IOException;
 import java.io.PrintWriter;
@@ -117,4 +118,9 @@
         return "OK";
     }
 
+    @Override
+    public CharSequence handleMetricsCollection(MetricsCollectionRecord collection) throws AvroRemoteException {
+        return "OK";
+    }
+
 }
--- a/stress-tester/src/main/java/com/passus/st/Main.java	Mon Jul 24 12:44:06 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/Main.java	Wed Jul 26 09:38:48 2017 +0200
@@ -228,15 +228,6 @@
                 }
             }
 
-            ReporterClient reporterClient = null;
-            if (cl.hasOption("ri")) {
-                int port = 11111;
-                InetAddress addr = InetAddress.getByName(cl.getOptionValue("ri"));
-                reporterClient = new ReporterClient(new InetSocketAddress(addr, port));
-                reporterClient.start();
-                client.addListener(new HttpReporterClientListener(reporterClient));
-            }
-
             if (cl.hasOption("wf")) {
                 WriterHttpClientListener writerListener;
                 String value = cl.getOptionValue("wf");
@@ -272,6 +263,19 @@
                 }
             }
 
+            ScheduledMetricsCollector collector = new ScheduledMetricsCollector();
+
+            ReporterClient reporterClient = null;
+            if (cl.hasOption("ri")) {
+                int port = 11111;
+                InetAddress addr = InetAddress.getByName(cl.getOptionValue("ri"));
+                reporterClient = new ReporterClient(new InetSocketAddress(addr, port));
+                reporterClient.start();
+
+                client.addListener(new HttpReporterClientListener(reporterClient));
+//                collector.addHandler(new HttpReporterMetricHandler(reporterClient));
+            }
+
             client.start();
 
             PcapSessionEventSource eventSrc = new PcapSessionEventSource();
@@ -284,7 +288,6 @@
                 throw new Exception("Loop should be greater than zero.");
             }
 
-            ScheduledMetricsCollector collector = new ScheduledMetricsCollector();
             SummrizeMetricsCollectionHandler summMetricsHandler = new SummrizeMetricsCollectionHandler();
             if (cl.hasOption("wm")) {
                 File metricsFile = new File(cl.getOptionValue("wm"));
--- a/stress-tester/src/main/java/com/passus/st/metric/ScheduledMetricsCollector.java	Mon Jul 24 12:44:06 2017 +0200
+++ b/stress-tester/src/main/java/com/passus/st/metric/ScheduledMetricsCollector.java	Wed Jul 26 09:38:48 2017 +0200
@@ -56,10 +56,7 @@
         }
     }
 
-    /**
-     *
-     * @return
-     */
+    @Override
     public List<MetricsCollectionHandler> getHandlers() {
         return Collections.unmodifiableList(handlers);
     }