/** * Allows for a deferred conversion to a string. Useful in logging. * * @return String supplier. */ public Supplier<String> stringify() { return () -> { final StringBuilder buffer = new StringBuilder(1024); final LocalTime totalDurationLocal = LocalTime .ofNanoOfDay(totalDuration.toNanos()); buffer.append(String.format("Total time taken for <%s> - %s hours%n", id, totalDurationLocal.format(df))); for (final TaskInfo task: tasks) { buffer.append(String.format("-%5.1f%% - %s%n", calculatePercentage(task.getDuration(), totalDuration), task)); } return buffer.toString(); }; }
/** * Allows for a deferred conversion to a string. Useful in logging. * * @return String supplier. */ public Supplier<String> stringify() { return () -> { final StringBuilder buffer = new StringBuilder(1024); final LocalTime totalDurationLocal = LocalTime .ofNanoOfDay(totalDuration.toNanos()); buffer.append(String.format("Total time taken for <%s> - %s hours%n", id, totalDurationLocal.format(df))); for (final TaskInfo task: tasks) { buffer.append(String.format("-%5.1f%% - %s%n", calculatePercentage(task.getDuration(), totalDuration), task)); } return buffer.toString(); }; }
final StopWatch stopWatch = new StopWatch("crawlSequences"); options); stopWatch.time("retrieveSequenceInformation", () -> { retrieverExtra .retrieveSequenceInformation(options.getSequenceInclusionRule()); }); stopWatch.time("filterAndSortSequences", () -> { catalog.reduce(Sequence.class, getSequenceReducer(options)); return null; }); LOGGER.log(Level.INFO, stopWatch.stringify());
/** * Allows for a deferred conversion to a string. Useful in logging. * * @return String supplier. */ public Supplier<String> stringify() { return () -> { final StringBuilder buffer = new StringBuilder(1024); final LocalTime totalDurationLocal = LocalTime .ofNanoOfDay(totalDuration.toNanos()); buffer.append(String.format("Total time taken for <%s> - %s hours%n", id, totalDurationLocal.format(df))); for (final TaskInfo task: tasks) { buffer.append(String.format("-%5.1f%% - %s%n", calculatePercentage(task.getDuration(), totalDuration), task)); } return buffer.toString(); }; }
final StopWatch stopWatch = new StopWatch("crawlSequences"); options); stopWatch.time("retrieveSequenceInformation", () -> { retrieverExtra .retrieveSequenceInformation(options.getSequenceInclusionRule()); }); stopWatch.time("filterAndSortSequences", () -> { catalog.reduce(Sequence.class, getSequenceReducer(options)); return null; }); LOGGER.log(Level.INFO, stopWatch.stringify());
/** * Allows for a deferred conversion to a string. Useful in logging. * * @return String supplier. */ public Supplier<String> stringify() { return () -> { final StringBuilder buffer = new StringBuilder(1024); final LocalTime totalDurationLocal = LocalTime .ofNanoOfDay(totalDuration.toNanos()); buffer.append(String.format("Total time taken for <%s> - %s hours%n", id, totalDurationLocal.format(df))); for (final TaskInfo task: tasks) { buffer.append(String.format("-%5.1f%% - %s%n", calculatePercentage(task.getDuration(), totalDuration), task)); } return buffer.toString(); }; }
final StopWatch stopWatch = new StopWatch("crawlSynonyms"); catalog, options); stopWatch.time("retrieveSynonymInformation", () -> { retrieverExtra .retrieveSynonymInformation(options.getSynonymInclusionRule()); }); stopWatch.time("filterAndSortSynonms", () -> { catalog.reduce(Synonym.class, getSynonymReducer(options)); return null; }); LOGGER.log(Level.INFO, stopWatch.stringify());
final StopWatch stopWatch = new StopWatch("crawlSynonyms"); catalog, options); stopWatch.time("retrieveSynonymInformation", () -> { retrieverExtra .retrieveSynonymInformation(options.getSynonymInclusionRule()); }); stopWatch.time("filterAndSortSynonms", () -> { catalog.reduce(Synonym.class, getSynonymReducer(options)); return null; }); LOGGER.log(Level.INFO, stopWatch.stringify());
final StopWatch stopWatch = new StopWatch("crawlDatabaseInfo"); stopWatch.time("retrieveDatabaseInfo", () -> { retriever.retrieveDatabaseInfo(); return null; }); stopWatch.time("retrieveAdditionalDatabaseInfo", () -> { if (infoLevel.isRetrieveAdditionalDatabaseInfo()) stopWatch.time("retrieveServerInfo", () -> { if (infoLevel.isRetrieveServerInfo()) stopWatch.time("retrieveJdbcDriverInfo", () -> { retriever.retrieveJdbcDriverInfo(); return null; }); stopWatch.time("retrieveAdditionalJdbcDriverInfo", () -> { if (infoLevel.isRetrieveAdditionalJdbcDriverInfo()) stopWatch.time("retrieveCrawlInfo", () -> { retriever.retrieveCrawlInfo(options.getTitle()); return null; }); LOGGER.log(Level.INFO, stopWatch.stringify());
final StopWatch stopWatch = new StopWatch("crawlDatabaseInfo"); stopWatch.time("retrieveDatabaseInfo", () -> { retriever.retrieveDatabaseInfo(); return null; }); stopWatch.time("retrieveAdditionalDatabaseInfo", () -> { if (infoLevel.isRetrieveAdditionalDatabaseInfo()) stopWatch.time("retrieveServerInfo", () -> { if (infoLevel.isRetrieveServerInfo()) stopWatch.time("retrieveJdbcDriverInfo", () -> { retriever.retrieveJdbcDriverInfo(); return null; }); stopWatch.time("retrieveAdditionalJdbcDriverInfo", () -> { if (infoLevel.isRetrieveAdditionalJdbcDriverInfo()) stopWatch.time("retrieveCrawlInfo", () -> { retriever.retrieveCrawlInfo(options.getTitle()); return null; }); LOGGER.log(Level.INFO, stopWatch.stringify());
final StopWatch stopWatch = new StopWatch("crawlColumnDataTypes"); options); stopWatch.time("retrieveSystemColumnDataTypes", () -> { if (infoLevel.isRetrieveColumnDataTypes()) }); stopWatch.time("retrieveUserDefinedColumnDataTypes", () -> { if (infoLevel.isRetrieveUserDefinedColumnDataTypes()) }); LOGGER.log(Level.INFO, stopWatch.stringify());
throws SchemaCrawlerException final StopWatch stopWatch = new StopWatch("crawlSchemas"); options); stopWatch.time("retrieveSchemas", () -> { retriever.retrieveSchemas(options.getSchemaInclusionRule()); return null; }); stopWatch.time("filterAndSortSchemas", () -> { catalog.reduce(Schema.class, getSchemaReducer(options)); return null; }); LOGGER.log(Level.INFO, stopWatch.stringify());
throws SchemaCrawlerException final StopWatch stopWatch = new StopWatch("crawlSchemas"); options); stopWatch.time("retrieveSchemas", () -> { retriever.retrieveSchemas(options.getSchemaInclusionRule()); return null; }); stopWatch.time("filterAndSortSchemas", () -> { catalog.reduce(Schema.class, getSchemaReducer(options)); return null; }); LOGGER.log(Level.INFO, stopWatch.stringify());
final StopWatch stopWatch = new StopWatch("crawlColumnDataTypes"); options); stopWatch.time("retrieveSystemColumnDataTypes", () -> { if (infoLevel.isRetrieveColumnDataTypes()) }); stopWatch.time("retrieveUserDefinedColumnDataTypes", () -> { if (infoLevel.isRetrieveUserDefinedColumnDataTypes()) }); LOGGER.log(Level.INFO, stopWatch.stringify());