use of org.finos.waltz.service.database_information.DatabaseInformationService in project waltz by khartec.
the class DatabaseHarness method main.
public static void main(String[] args) throws ParseException {
AnnotationConfigApplicationContext ctx = new AnnotationConfigApplicationContext(DIConfiguration.class);
DatabaseInformationService databaseInfoService = ctx.getBean(DatabaseInformationService.class);
DatabaseInformationDao databaseDao = ctx.getBean(DatabaseInformationDao.class);
DSLContext dsl = ctx.getBean(DSLContext.class);
/*
List<DatabaseInformation> dbs = databaseDao.findByApplicationId(801L);
System.out.println(dbs.size());
List<Tally<String>> eolCounts = calculateStringTallies(
dsl,
DATABASE_INFORMATION,
DSL.when(DATABASE_INFORMATION.END_OF_LIFE_DATE.lt(DSL.currentDate()), DSL.inline(EndOfLifeStatus.END_OF_LIFE.name()))
.otherwise(DSL.inline(EndOfLifeStatus.NOT_END_OF_LIFE.name())),
DSL.trueCondition());
System.out.println(eolCounts);
*/
IdSelectionOptions options = IdSelectionOptions.mkOpts(EntityReference.mkRef(EntityKind.ORG_UNIT, 10), HierarchyQueryScope.CHILDREN);
for (int i = 0; i < 5; i++) {
HarnessUtilities.time("stats", () -> databaseInfoService.calculateStatsForAppIdSelector(options));
}
}
Aggregations