From ad178727f11b1b15fdd8032fc645e313e139f862 Mon Sep 17 00:00:00 2001 From: Jan Philipp Timme Date: Mon, 5 Dec 2016 21:05:50 +0100 Subject: [PATCH] Add timestamps to relevant log output --- src/main/java/de/hsh/inform/orientdb_project/Main.java | 6 +++--- .../netdata/AbstractNetdataImportService.java | 4 +++- .../orientdb_project/orientdb/NodeBasedImportService.java | 4 ++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/main/java/de/hsh/inform/orientdb_project/Main.java b/src/main/java/de/hsh/inform/orientdb_project/Main.java index bb5857a..25868a6 100644 --- a/src/main/java/de/hsh/inform/orientdb_project/Main.java +++ b/src/main/java/de/hsh/inform/orientdb_project/Main.java @@ -33,14 +33,14 @@ public class Main { // Go go gadget import service! try { System.out.println(System.currentTimeMillis()/1000L + ": Begin import of data ..."); - importService.partialRun(12000); - System.out.println("Import of data done!"); + importService.partialRun(5000); + System.out.println(System.currentTimeMillis()/1000L + ": Import of data done!"); } catch (EOFException | PcapNativeException | TimeoutException | NotOpenException e) { e.printStackTrace(); } // Done odhs.close(); - System.out.println("End of program."); + System.out.println(System.currentTimeMillis()/1000L + ": End of program."); } } diff --git a/src/main/java/de/hsh/inform/orientdb_project/netdata/AbstractNetdataImportService.java b/src/main/java/de/hsh/inform/orientdb_project/netdata/AbstractNetdataImportService.java index 4da4c13..062de7d 100644 --- a/src/main/java/de/hsh/inform/orientdb_project/netdata/AbstractNetdataImportService.java +++ b/src/main/java/de/hsh/inform/orientdb_project/netdata/AbstractNetdataImportService.java @@ -56,11 +56,13 @@ public abstract class AbstractNetdataImportService implements NetdataResultObser } this.packetCounter++; if(this.limitedImportRun && this.packetCounter > this.packetLimit) { - System.out.println("Limited import run done. Breaking."); + System.out.println(System.currentTimeMillis()/1000L + ": Limited import run done. Breaking."); break; } } + System.out.println(System.currentTimeMillis()/1000L + ": Main import done, executing afterImport() ..."); this.afterImport(); + System.out.println(System.currentTimeMillis()/1000L + ": Call of afterImport() returned!"); } public void handleEthernetPacket(EthernetPacket ether, long ts, int ms) { diff --git a/src/main/java/de/hsh/inform/orientdb_project/orientdb/NodeBasedImportService.java b/src/main/java/de/hsh/inform/orientdb_project/orientdb/NodeBasedImportService.java index 7c90dba..2e63274 100644 --- a/src/main/java/de/hsh/inform/orientdb_project/orientdb/NodeBasedImportService.java +++ b/src/main/java/de/hsh/inform/orientdb_project/orientdb/NodeBasedImportService.java @@ -217,7 +217,7 @@ public class NodeBasedImportService extends AbstractNetdataImportService { } public void afterImport() { - System.out.println("All done. Processing collected TcpConnections ..."); + System.out.println(System.currentTimeMillis()/1000L + ": All done. Processing collected TcpConnections ..."); for(LinkedList connList : this.knownTcpConnections.values()) { for(TcpConnectionModel conn : connList) { Vertex currentTcpConnection = this.og.addVertex("class:TcpConnection", conn.getArguments()); @@ -238,7 +238,7 @@ public class NodeBasedImportService extends AbstractNetdataImportService { } } } - System.out.println("Done importing TcpConnections. End of afterImport() routine."); + System.out.println(System.currentTimeMillis()/1000L + ": Done importing TcpConnections. End of afterImport() routine."); }