summaryrefslogtreecommitdiffstats
path: root/Monitoring/MonitoringTool/PacketTracking/pt-api
diff options
context:
space:
mode:
Diffstat (limited to 'Monitoring/MonitoringTool/PacketTracking/pt-api')
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/pt-api/.gitignore1
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/pt-api/pom.xml34
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/BaseRecord.java48
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PacketTrackRecord.java141
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/ProbeRecord.java54
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtInterfaceStats.java199
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtProbeLocation.java179
-rw-r--r--Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtProbeStats.java196
8 files changed, 852 insertions, 0 deletions
diff --git a/Monitoring/MonitoringTool/PacketTracking/pt-api/.gitignore b/Monitoring/MonitoringTool/PacketTracking/pt-api/.gitignore
new file mode 100644
index 0000000..83837ba
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/pt-api/.gitignore
@@ -0,0 +1 @@
+target/
diff --git a/Monitoring/MonitoringTool/PacketTracking/pt-api/pom.xml b/Monitoring/MonitoringTool/PacketTracking/pt-api/pom.xml
new file mode 100644
index 0000000..08d6065
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/pt-api/pom.xml
@@ -0,0 +1,34 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>de.fhg.fokus.net</groupId>
+ <artifactId>pt-api</artifactId>
+ <name>Packet Tracking API</name>
+ <version>1.1.2</version>
+ <distributionManagement>
+ <repository>
+ <id>pt</id>
+ <url>${pt.releases.repo.url}</url>
+ </repository>
+ <snapshotRepository>
+ <id>pt</id>
+ <url>${pt.snapshots.repo.url}</url>
+ </snapshotRepository>
+ <site>
+ <id>pt-site</id>
+ <url>${pt.site.deploy.url}</url>
+ </site>
+ </distributionManagement>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+</project>
diff --git a/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/BaseRecord.java b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/BaseRecord.java
new file mode 100644
index 0000000..6516e80
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/BaseRecord.java
@@ -0,0 +1,48 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.ptapi;
+
+import java.io.Serializable;
+
+/**
+ *
+ * Base record. Every class defined in pt-api should implement this interface.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+
+public interface BaseRecord extends Serializable {
+ /**
+ * @return comma separated representation
+ */
+ public String csvData();
+
+ /**
+ * @return description of csv fields
+ */
+ public String csvFields();
+
+ /**
+ * Milliseconds since 0000 UTC Jan 1st 1970 data was observation.
+ *
+ * @return observation time in milliseconds
+ */
+ public long getObservationTimeMilliseconds();
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PacketTrackRecord.java b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PacketTrackRecord.java
new file mode 100644
index 0000000..bdd2af8
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PacketTrackRecord.java
@@ -0,0 +1,141 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.ptapi;
+
+import java.io.Serializable;
+
+import java.net.Inet4Address;
+
+/**
+ * Represents a packet track. This type is used in export.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public class PacketTrackRecord implements Serializable, BaseRecord {
+ /**
+ *
+ */
+ private static final long serialVersionUID = 1L;
+ /**
+ * Probe ids where the packet has been seen (oids)
+ */
+ public long [] oids;
+ /**
+ * Time stamp in milliseconds since Unix epoch
+ *
+ */
+ public long[] ts;
+
+ /**
+ * Time-to-live
+ */
+ public int[] ttl;
+ /**
+ * Packet Id (gotten from probe via hash-based packet selection)
+ */
+ public int pktid;
+ /**
+ * Track Id (computed by the packet matcher)
+ */
+ public int trackid;
+
+ /**
+ * Packet size.
+ */
+ public int size;
+
+ /**
+ * IP version.
+ */
+ public byte ipVersion;
+
+ /**
+ * Protocol number;
+ */
+ public byte protocol;
+
+ /**
+ * Source address
+ */
+ public Inet4Address sourceAddress;
+
+ /**
+ * Source port
+ */
+ public int sourcePort;
+
+ /**
+ * Destination address
+ */
+ public Inet4Address destinationAddress;
+
+ /**
+ * Destination port
+ */
+ public int destinationPort;
+
+ public PacketTrackRecord(int size) {
+ oids = new long[size];
+ ts = new long[size];
+ ttl = new int[size];
+ }
+
+ @Override
+ public String csvData() {
+ StringBuffer line = new StringBuffer();
+ line.append(pktid)
+ .append(", ")
+ .append(trackid)
+ .append(", ")
+ .append(size)
+ .append(", ")
+ .append(ipVersion)
+ .append(", ")
+ .append(protocol);
+
+ for (int i = 0; i < oids.length; i++) {
+ line.append(", (")
+ .append(oids[i])
+ .append(", ")
+ .append(ts[i])
+ .append(", ")
+ .append(ttl[i])
+ .append(")");
+ }
+ return line.toString();
+ }
+ private static final String CSV_FIELDS = "pktId, trackid, size, ipVersion, protocol, (oid1, ts1, ttl1), (oid2, ts2, ttl2), ..";
+ @Override
+ public String csvFields() {
+ return CSV_FIELDS;
+ }
+ @Override
+ public String toString() {
+ return csvData();
+ }
+ /**
+ * Returs the first timestamp of track
+ *
+ */
+ @Override
+ public long getObservationTimeMilliseconds() {
+ return ts[0];
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/ProbeRecord.java b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/ProbeRecord.java
new file mode 100644
index 0000000..6b11766
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/ProbeRecord.java
@@ -0,0 +1,54 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.ptapi;
+
+
+/**
+ * Data exported from probes must implement this interface.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public interface ProbeRecord extends BaseRecord {
+ /**
+ * @return observation domain id.
+ */
+ public long getOid();
+ /**
+ * @param oid
+ */
+ public void setOid( long oid);
+ /**
+ * Time in seconds since 0000 UTC Jan 1st 1970, at which the
+ * IPFIX Message Header leaves the Exporter.
+ *
+ * @return export time
+ */
+ public long getExportTime();
+ /**
+ *
+ * @param exportTime
+ */
+ public void setExportTime( long exportTime );
+ /**
+ * Milliseconds since 0000 UTC Jan 1st 1970 data was observation.
+ *
+ * @return observation time in milliseconds
+ */
+ public void setObservationTimeMilliseconds( long observationTimeMilliseconds );
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtInterfaceStats.java b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtInterfaceStats.java
new file mode 100644
index 0000000..d0cba5a
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtInterfaceStats.java
@@ -0,0 +1,199 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.ptapi;
+
+import java.math.BigInteger;
+
+/**
+ * Sampling
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public class PtInterfaceStats implements ProbeRecord {
+ private static final long serialVersionUID = 1L;
+ /**
+ * Observation Domain Id. Note that if you are using ipfix4java as transport
+ * you'll currently need to get this value from the ipfix message;
+ */
+ public long oid;
+
+ public long exportTime;
+
+ /**
+ * The time the record was created. Its encoded according to
+ * dateTimeMilliseconds(RFC5101). The data type dateTimeMilliseconds
+ * represents a time value in units of milliseconds normalized to the GMT
+ * timezone. It contains the number of milliseconds since 0000 UTC Jan 1,
+ * 1970.
+ */
+ public long observationTimeMilliseconds;
+
+ /**
+ * Sampling Size (n)
+ */
+ public long samplingSize;
+ /**
+ * Packet Delta Count (N)
+ */
+ public BigInteger packetDeltaCount;
+
+ /**
+ * number of packets received by pcap
+ */
+ public long pcapStatRecv;
+ /**
+ * number of packets dropped by pcap
+ */
+ public long pcapStatDrop;
+
+ /**
+ * A short name uniquely describing an interface, e.g. "eth0". May be the
+ * string "not available" on decoding failures.
+ */
+ public String interfaceName;
+ /**
+ * A generic description of the interface, e.g. "Ethernet (10.0.0.1/24)" May
+ * be the string "not available" on decoding failures.
+ */
+ public String interfaceDescription;
+
+ public PtInterfaceStats() {
+ }
+
+ public PtInterfaceStats(long oid, long observationTimeMilliseconds,
+ long samplingSize, BigInteger packetDeltaCount, long pcapStatRecv,
+ long pcapStatDrop, String interfaceName, String interfaceDescription) {
+ super();
+ this.oid = oid;
+ this.observationTimeMilliseconds = observationTimeMilliseconds;
+ this.samplingSize = samplingSize;
+ this.packetDeltaCount = packetDeltaCount;
+ this.pcapStatRecv = pcapStatRecv;
+ this.pcapStatDrop = pcapStatDrop;
+ this.interfaceName = interfaceName;
+ this.interfaceDescription = interfaceDescription;
+ }
+
+ @Override
+ public long getOid() {
+ return oid;
+ }
+
+ @Override
+ public void setOid(long oid) {
+ this.oid = oid;
+ }
+
+ @Override
+ public long getExportTime() {
+ return exportTime;
+ }
+ @Override
+ public void setExportTime(long exportTime) {
+ this.exportTime = exportTime;
+ }
+
+ public long getSamplingSize() {
+ return samplingSize;
+ }
+
+ public void setSamplingSize(long samplingSize) {
+ this.samplingSize = samplingSize;
+ }
+
+ public BigInteger getPacketDeltaCount() {
+ return packetDeltaCount;
+ }
+
+ public void setPacketDeltaCount(BigInteger packetDeltaCount) {
+ this.packetDeltaCount = packetDeltaCount;
+ }
+
+ @Override
+ public long getObservationTimeMilliseconds() {
+ return observationTimeMilliseconds;
+ }
+
+ @Override
+ public void setObservationTimeMilliseconds(long observationTimeMilliseconds) {
+ this.observationTimeMilliseconds = observationTimeMilliseconds;
+ }
+
+ public long getPcapStatRecv() {
+ return pcapStatRecv;
+ }
+
+ public void setPcapStatRecv(long pcapStatRecv) {
+ this.pcapStatRecv = pcapStatRecv;
+ }
+
+ public long getPcapStatDrop() {
+ return pcapStatDrop;
+ }
+
+ public void setPcapStatDrop(long pcapStatDrop) {
+ this.pcapStatDrop = pcapStatDrop;
+ }
+
+ public String getInterfaceName() {
+ return interfaceName;
+ }
+
+ public void setInterfaceName(String interfaceName) {
+ this.interfaceName = interfaceName;
+ }
+
+ public String getInterfaceDescription() {
+ return interfaceDescription;
+ }
+
+ public void setInterfaceDescription(String interfaceDescription) {
+ this.interfaceDescription = interfaceDescription;
+ }
+
+ @Override
+ public String toString() {
+ return String
+ .format("{oid: %d, observationTimeMilliseconds: %d, "
+ + "samplingSize: %d, packetDeltaCount: %s, interfaceName: \"%s\", interfaceDescription: \"%s\" }",
+ oid, observationTimeMilliseconds, samplingSize,
+ packetDeltaCount.toString(), interfaceName,
+ interfaceDescription);
+ }
+
+ private static final String CSV_FIELDS = "oid, exportTime, observationTimeMilliseconds, "
+ + "samplingSize, packetDeltaCount, interfaceName, interfaceDescription";
+
+ @Override
+ public String csvFields() {
+ return CSV_FIELDS;
+ }
+
+ @Override
+ public String csvData() {
+ String ifname = interfaceName == null ? "" : interfaceName.replaceAll(
+ ",", "_");
+ String ifdesc = interfaceDescription == null ? ""
+ : interfaceDescription.replaceAll(",", "_");
+ return String.format("%d, %d, %d, %d, %s, %s, %s", oid, exportTime,
+ observationTimeMilliseconds, samplingSize,
+ packetDeltaCount.toString(), ifname, ifdesc);
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtProbeLocation.java b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtProbeLocation.java
new file mode 100644
index 0000000..f547eb4
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtProbeLocation.java
@@ -0,0 +1,179 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.ptapi;
+
+import java.net.Inet4Address;
+
+/**
+ *
+ * @author FhG-FOKUS NETwork Research
+ */
+public final class PtProbeLocation implements ProbeRecord{
+ private static final long serialVersionUID = 1L;
+ /**
+ * Observation Domain Id. Note that if you are using ipfix4java as transport
+ * you'll currently need to get this value from the ipfix message;
+ */
+ public long oid;
+
+ public long exportTime;
+
+ /**
+ * The time the record was created. Its encoded according to
+ * dateTimeMilliseconds(RFC5101). The data type dateTimeMilliseconds
+ * represents a time value in units of milliseconds normalized to the GMT
+ * timezone. It contains the number of milliseconds since 0000 UTC Jan 1,
+ * 1970.
+ */
+ public long observationTimeMilliseconds;
+
+ /**
+ * The Ipv4 source address received from the probe
+ */
+ public Inet4Address sourceIpv4Address;
+
+ /**
+ * The latitude received from the probe
+ */
+ public String latitude;
+
+ /**
+ * The longitude received from the probe
+ */
+ public String longitude;
+
+ /**
+ * The name received from the probe
+ */
+ public String probeName;
+ /**
+ * The location name received from the probe
+ */
+ public String probeLocationName;
+
+ public PtProbeLocation() {
+ }
+
+ public PtProbeLocation(long oid, long observationTimeMilliseconds,
+ Inet4Address sourceIpv4Address,String latitude, String longitude,
+ String probeName, String probeLocationName) {
+ super();
+ this.oid = oid;
+ this.observationTimeMilliseconds = observationTimeMilliseconds;
+ this.sourceIpv4Address = sourceIpv4Address;
+ this.latitude = latitude;
+ this.longitude = longitude;
+ this.probeName = probeName;
+ this.probeLocationName = probeLocationName;
+ }
+
+ @Override
+ public long getOid() {
+ return oid;
+ }
+
+ @Override
+ public void setOid(long oid) {
+ this.oid = oid;
+ }
+
+ public Inet4Address getSourceIpv4Address(){
+ return sourceIpv4Address;
+ }
+
+ public void setSourceIpv4Address(Inet4Address sourceIpv4Address){
+ this.sourceIpv4Address = sourceIpv4Address;
+ }
+
+ public String getLatitude() {
+ return latitude;
+ }
+
+ public void setLatitude(String latitude) {
+ this.latitude = latitude;
+ }
+
+ public String getLongitude() {
+ return longitude;
+ }
+
+ public void setLongitude(String longitude) {
+ this.longitude = longitude;
+ }
+
+ public String getProbeName() {
+ return probeName;
+ }
+
+ public void setProbeName(String probeName) {
+ this.probeName = probeName;
+ }
+
+ public String getProbeLocationName() {
+ return probeLocationName;
+ }
+
+ public void setProbeLocationName(String probeLocationName) {
+ this.probeLocationName = probeLocationName;
+ }
+
+ @Override
+ public long getObservationTimeMilliseconds() {
+ return observationTimeMilliseconds;
+ }
+
+ @Override
+ public void setObservationTimeMilliseconds(
+ long observationTimeMilliseconds) {
+ this.observationTimeMilliseconds = observationTimeMilliseconds;
+ }
+
+ @Override
+ public String toString() {
+ return String.format("{oid: %d, observationTimeMilliseconds: %d, "
+ + "latitude: %s, longitude: %s }", oid,
+ observationTimeMilliseconds,
+ latitude,longitude
+ );
+ }
+
+ @Override
+ public long getExportTime() {
+ return exportTime;
+ }
+
+ @Override
+ public void setExportTime(long exportTime) {
+ this.exportTime = exportTime;
+ }
+
+ private static final String CSV_FIELDS = "oid, exportTime, observationTimeMilliseconds, "
+ + "latitude, longitude";
+
+ @Override
+ public String csvFields() {
+ return CSV_FIELDS;
+ }
+
+ @Override
+ public String csvData() {
+ return String.format("%d, %d, %d, %s, %s", oid, exportTime,
+ observationTimeMilliseconds, latitude, longitude);
+ }
+
+}
diff --git a/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtProbeStats.java b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtProbeStats.java
new file mode 100644
index 0000000..3ab8cd4
--- /dev/null
+++ b/Monitoring/MonitoringTool/PacketTracking/pt-api/src/main/java/de/fhg/fokus/net/ptapi/PtProbeStats.java
@@ -0,0 +1,196 @@
+/**
+*
+* Copyright (c) 2012, NOVI Consortium, European FP7 NOVI Project
+* Copyright according to BSD License
+* For full text of the license see: ./novi/Software/Monitoring/MonitoringTool/PacketTracking/license.txt
+*
+* @author <a href="mailto:ramon.masek@fokus.fraunhofer.de">Ramon Masek</a>, Fraunhofer FOKUS
+* @author <a href="mailto:c.henke@tu-berlin.de">Christian Henke</a>, Technical University Berlin
+* @author <a href="mailto:carsten.schmoll@fokus.fraunhofer.de">Carsten Schmoll</a>, Fraunhofer FOKUS
+* @author <a href="mailto:Julian.Vetter@campus.tu-berlin.de">Julian Vetter</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Jens Krenzin</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Michael Gehring</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Tacio Grespan Santos</a>, Fraunhofer FOKUS
+* @author <a href="mailto:">Fabian Wolff</a>, Fraunhofer FOKUS
+*
+*/
+
+package de.fhg.fokus.net.ptapi;
+
+import java.math.BigInteger;
+import java.util.Locale;
+
+/**
+ * Probe statistics.
+ *
+ * @author FhG-FOKUS NETwork Research
+ *
+ */
+public class PtProbeStats implements ProbeRecord {
+ private static final long serialVersionUID = 1L;
+ /**
+ * Observation Domain Id.
+ */
+ public long oid;
+ public long exportTime;
+
+ /**
+ * Observation time in milliseconds. Its encoded according to
+ * dateTimeMilliseconds(RFC5101). The data type dateTimeMilliseconds
+ * represents a time value in units of milliseconds normalized to the GMT
+ * timezone. It contains the number of milliseconds since 0000 UTC Jan 1,
+ * 1970.
+ */
+ public long observationTimeMilliseconds;
+ /**
+ * System idle CPU, see "man mpstat" for more information.
+ */
+ public float systemCpuIdle;
+ /**
+ * System free memory in kilobytes, see "man pidstat" for more information.
+ */
+ public BigInteger systemMemFree;
+ /**
+ * percentage of CPU used in user level (application), see "man pidstat" for
+ * more information"
+ */
+ public float processCpuUser;
+ /**
+ * percentage of CPU used in system level (kernel), see "man pidstat" for
+ * more information"
+ */
+ public float processCpuSys;
+ /**
+ * the process virtual memory used in kilobytes, see "man pidstat" for more
+ * information"
+ */
+ public BigInteger processMemVzs;
+ /**
+ * the process resident set size in kilobytes, see "man pidstat" for more
+ * information"
+ */
+ public BigInteger processMemRss;
+
+ public PtProbeStats() {
+ }
+
+ public PtProbeStats(long oid, long observationTimeMilliseconds,
+ float systemCpuIdle, BigInteger systemMemFree,
+ float processCpuUser, float processCpuSys,
+ BigInteger processMemVzs, BigInteger processMemRss) {
+ super();
+ this.oid = oid;
+ this.observationTimeMilliseconds = observationTimeMilliseconds;
+ this.systemCpuIdle = systemCpuIdle;
+ this.systemMemFree = systemMemFree;
+ this.processCpuUser = processCpuUser;
+ this.processCpuSys = processCpuSys;
+ this.processMemVzs = processMemVzs;
+ this.processMemRss = processMemRss;
+ }
+
+ @Override
+ public long getOid() {
+ return oid;
+ }
+
+ @Override
+ public long getExportTime() {
+ return exportTime;
+ }
+
+ public void setExportTime(long exportTime) {
+ this.exportTime = exportTime;
+ }
+
+ public void setOid(long oid) {
+ this.oid = oid;
+ }
+
+ public float getSystemCpuIdle() {
+ return systemCpuIdle;
+ }
+
+ public void setSystemCpuIdle(float systemCpuIdle) {
+ this.systemCpuIdle = systemCpuIdle;
+ }
+
+ public BigInteger getSystemMemFree() {
+ return systemMemFree;
+ }
+
+ public void setSystemMemFree(BigInteger systemMemFree) {
+ this.systemMemFree = systemMemFree;
+ }
+
+ public float getProcessCpuUser() {
+ return processCpuUser;
+ }
+
+ public void setProcessCpuUser(float processCpuUser) {
+ this.processCpuUser = processCpuUser;
+ }
+
+ public float getProcessCpuSys() {
+ return processCpuSys;
+ }
+
+ public void setProcessCpuSys(float processCpuSys) {
+ this.processCpuSys = processCpuSys;
+ }
+
+ public BigInteger getProcessMemVzs() {
+ return processMemVzs;
+ }
+
+ public void setProcessMemVzs(BigInteger processMemVzs) {
+ this.processMemVzs = processMemVzs;
+ }
+
+ public BigInteger getProcessMemRss() {
+ return processMemRss;
+ }
+
+ public void setProcessMemRss(BigInteger processMemRss) {
+ this.processMemRss = processMemRss;
+ }
+
+ @Override
+ public long getObservationTimeMilliseconds() {
+ return observationTimeMilliseconds;
+ }
+
+ public void setObservationTimeMilliseconds(long observationTimeMilliseconds) {
+ this.observationTimeMilliseconds = observationTimeMilliseconds;
+ }
+
+ @Override
+ public String toString() {
+ return String
+ .format("{oid: %d, exportTime: %d, observationTimeMilliseconds: %d, "
+ + "systemCpuIdle: \"%f\", systemMemFree: %d, "
+ + "processCpuUser: \"%f\", processCpuSys: \"%f\", processMemVzs: %d, "
+ + "processMemRss: %d}", oid, exportTime,
+ observationTimeMilliseconds, systemCpuIdle,
+ systemMemFree, processCpuUser, processCpuSys,
+ processMemVzs, processMemRss);
+ }
+
+ private static final String CSV_FIELDS = "oid, exportTime, observationTimeMilliseconds, systemCpuIdle, "
+ + "systemMemFree, processCpuUser, processCpuSys, processMemVzs, processMemRss";
+
+ @Override
+ public String csvData() {
+ return String.format(Locale.ENGLISH,
+ "%d, %d, %d, %f, %d, %f, %f, %d, %d", oid, exportTime,
+ observationTimeMilliseconds, systemCpuIdle, systemMemFree,
+ processCpuUser, processCpuSys, processMemVzs, processMemRss);
+
+ }
+
+ @Override
+ public String csvFields() {
+ return CSV_FIELDS;
+ }
+
+}