changeset 1139:04d179a5e2bf

HttpUrlSequencePayloadAnalyzer in progress
author Devel 2
date Tue, 09 Jun 2020 13:42:44 +0200
parents 730898c04e80
children 3f1884efeb15
files stress-tester/src/main/java/com/passus/st/scanner/HttpUrlSequencePayloadAnalyzer.java stress-tester/src/main/java/com/passus/st/scanner/HttpUrlSequences.java
diffstat 2 files changed, 104 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/java/com/passus/st/scanner/HttpUrlSequencePayloadAnalyzer.java	Tue Jun 09 13:42:44 2020 +0200
@@ -0,0 +1,77 @@
+package com.passus.st.scanner;
+
+import com.passus.commons.annotations.Plugin;
+import com.passus.net.http.HttpRequest;
+import com.passus.st.client.DataEvents;
+import com.passus.st.client.Event;
+import com.passus.st.client.SessionPayloadEvent;
+import com.passus.st.metric.MetricSource;
+import com.passus.st.metric.MetricsContainer;
+import com.passus.st.plugin.PluginConstants;
+
+import static com.passus.st.Protocols.HTTP;
+
+@Plugin(name = HttpUrlSequencePayloadAnalyzer.TYPE, category = PluginConstants.CATEGORY_SCANNER_ANALYZER)
+public class HttpUrlSequencePayloadAnalyzer implements ScannerAnalyzer, MetricSource {
+
+    public static final String TYPE = "httpUrlSequence";
+
+    private HttpUrlSequences metric;
+
+    public String getType() {
+        return TYPE;
+    }
+
+    @Override
+    public void activate() {
+        metric = new HttpUrlSequences();
+        metric.activate();
+    }
+
+    @Override
+    public void deactivate() {
+        metric.deactivate();
+        metric = null;
+    }
+
+    @Override
+    public boolean isCollectMetrics() {
+        return false;
+    }
+
+    @Override
+    public void setCollectMetrics(boolean collectMetrics) {
+
+    }
+
+    @Override
+    public void writeMetrics(MetricsContainer container) {
+        container.update(metric);
+    }
+
+    @Override
+    public void analyze(Event event) {
+        if (event.getType() == SessionPayloadEvent.TYPE) {
+            write((SessionPayloadEvent) event);
+        } else if (event.getType() == DataEvents.DataEnd.TYPE) {
+
+        }
+    }
+
+    private void populateMetric() {
+
+    }
+
+    private void write(SessionPayloadEvent event) {
+        if (event.getProtocolId() != HTTP) {
+            return;
+        }
+
+        HttpRequest req = (HttpRequest) event.getRequest();
+        if (req != null) {
+
+        }
+    }
+
+
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stress-tester/src/main/java/com/passus/st/scanner/HttpUrlSequences.java	Tue Jun 09 13:42:44 2020 +0200
@@ -0,0 +1,27 @@
+package com.passus.st.scanner;
+
+import com.passus.commons.metric.Metric;
+import com.passus.st.client.GenericMetric;
+
+public class HttpUrlSequences extends GenericMetric {
+
+    public static final String DEFAULT_NAME = "HTTP URL sequences";
+
+    public HttpUrlSequences() {
+        this(DEFAULT_NAME);
+    }
+
+    public HttpUrlSequences(String name) {
+        super(name);
+    }
+
+    @Override
+    public void update(Metric metric) {
+
+    }
+
+    @Override
+    public void reset() {
+
+    }
+}