@@ -549,7 +549,6 @@ public static void main(String argv[]) {
549
549
System .out .println ("History stored in DB and renamed file handling is on - possible performance degradation" );
550
550
}
551
551
552
- long start = System .currentTimeMillis ();
553
552
getInstance ().prepareIndexer (env , searchRepositories , addProjects ,
554
553
defaultProject , configFilename , refreshHistory ,
555
554
listFiles , createDict , subFiles , repositories ,
@@ -562,9 +561,6 @@ public static void main(String argv[]) {
562
561
getInstance ().doIndexerExecution (update , noThreads , subFiles ,
563
562
progress );
564
563
}
565
- long stop = System .currentTimeMillis ();
566
- String time_str = StringUtils .getReadableTime (stop - start );
567
- log .log (Level .INFO , "Total indexing time: {0}" , time_str );
568
564
getInstance ().sendToConfigHost (env , configHost );
569
565
} catch (IndexerException ex ) {
570
566
log .log (Level .SEVERE , "Exception running indexer" , ex );
@@ -763,7 +759,7 @@ public int compare(Project p1, Project p2) {
763
759
public void doIndexerExecution (final boolean update , int noThreads , List <String > subFiles ,
764
760
IndexChangedListener progress )
765
761
throws IOException {
766
- long start = System . currentTimeMillis ();
762
+ Statistics elapsed = new Statistics ();
767
763
RuntimeEnvironment env = RuntimeEnvironment .getInstance ().register ();
768
764
log .info ("Starting indexing" );
769
765
@@ -844,10 +840,7 @@ public void run() {
844
840
log .log (Level .SEVERE ,
845
841
"destroying of renamed thread pool failed" , ex );
846
842
}
847
- long stop = System .currentTimeMillis ();
848
- String time_str = StringUtils .getReadableTime (stop - start );
849
- log .log (Level .INFO , "Done indexing data of all repositories (took {0})" ,
850
- time_str );
843
+ elapsed .report (log , "Done indexing data of all repositories" );
851
844
}
852
845
853
846
public void sendToConfigHost (RuntimeEnvironment env , String configHost ) {
@@ -859,7 +852,8 @@ public void sendToConfigHost(RuntimeEnvironment env, String configHost) {
859
852
InetAddress host = InetAddress .getByName (cfg [0 ]);
860
853
env .writeConfiguration (host , Integer .parseInt (cfg [1 ]));
861
854
} catch (Exception ex ) {
862
- log .log (Level .SEVERE , "Failed to send configuration to " + configHost + " (is web application server running with opengrok deployed?)" , ex );
855
+ log .log (Level .SEVERE , "Failed to send configuration to "
856
+ + configHost + " (is web application server running with opengrok deployed?)" , ex );
863
857
}
864
858
} else {
865
859
log .severe ("Syntax error: " );
0 commit comments