6666import org .opengrok .indexer .history .Annotation ;
6767import org .opengrok .indexer .history .HistoryGuru ;
6868import org .opengrok .indexer .logger .LoggerFactory ;
69+ import org .opengrok .indexer .util .Statistics ;
6970
7071/**
7172 * Class for useful functions.
@@ -1208,7 +1209,7 @@ public static boolean dumpXref(Writer out, File file, boolean compressed, String
12081209 */
12091210 try (InputStream iss = new BufferedInputStream (new FileInputStream (file ));
12101211 Reader in = compressed ? new InputStreamReader (new GZIPInputStream (iss )) : new InputStreamReader (iss )) {
1211- dumpXref (out , in , contextPath );
1212+ dumpXref (out , in , contextPath , file );
12121213 return true ;
12131214 } catch (IOException e ) {
12141215 LOGGER .log (Level .WARNING , String .format ("An error occurred while piping file '%s'" , file ), e );
@@ -1222,21 +1223,24 @@ public static boolean dumpXref(Writer out, File file, boolean compressed, String
12221223 * @param out dump destination
12231224 * @param in source to read
12241225 * @param contextPath an optional override of "/source/" as the context path
1226+ * @param file file related to the {@code in}, used for logging only
12251227 * @throws IOException as defined by the given reader/writer
12261228 * @throws NullPointerException if a parameter is {@code null}
12271229 */
1228- public static void dumpXref (Writer out , Reader in , String contextPath ) throws IOException {
1230+ public static void dumpXref (Writer out , Reader in , String contextPath , File file ) throws IOException {
12291231
12301232 if (in == null || out == null ) {
12311233 return ;
12321234 }
12331235
1236+ Statistics stat = new Statistics ();
12341237 XrefSourceTransformer xform = new XrefSourceTransformer (in );
12351238 xform .setWriter (out );
12361239 xform .setContextPath (contextPath );
12371240 while (xform .yylex ()) {
12381241 // Nothing else to do.
12391242 }
1243+ stat .report (LOGGER , Level .FINEST , String .format ("dumped xref '%s'" , file ), "xref.dump.latency" );
12401244 }
12411245
12421246 /**
0 commit comments