Skip to content

Commit 1db0944

Browse files
committed
Improve logging for terminology ingestion
1 parent ed953d8 commit 1db0944

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/term/TermDeferredStorageSvcImpl.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
import java.util.Collections;
5656
import java.util.List;
5757
import java.util.UUID;
58+
import java.util.concurrent.TimeUnit;
5859

5960
public class TermDeferredStorageSvcImpl implements ITermDeferredStorageSvc {
6061

@@ -157,7 +158,7 @@ private void processDeferredConcepts() {
157158
StopWatch stopwatch = new StopWatch();
158159

159160
int count = Math.min(1000, myDeferredConcepts.size());
160-
ourLog.info("Saving {} deferred concepts...", count);
161+
ourLog.debug("Saving {} deferred concepts...", count);
161162
while (codeCount < count && myDeferredConcepts.size() > 0) {
162163
TermConcept next = myDeferredConcepts.remove(0);
163164
if(myCodeSystemVersionDao.findById(next.getCodeSystemVersion().getPid()).isPresent()) {
@@ -174,8 +175,8 @@ private void processDeferredConcepts() {
174175
}
175176

176177
if (codeCount > 0) {
177-
ourLog.info("Saved {} deferred concepts ({} codes remain and {} relationships remain) in {}ms ({}ms / code)",
178-
codeCount, myDeferredConcepts.size(), myConceptLinksToSaveLater.size(), stopwatch.getMillis(), stopwatch.getMillisPerOperation(codeCount));
178+
ourLog.info("Saved {} deferred concepts ({} codes remain and {} relationships remain) in {}ms ({} codes/sec)",
179+
codeCount, myDeferredConcepts.size(), myConceptLinksToSaveLater.size(), stopwatch.getMillis(), stopwatch.formatThroughput(codeCount, TimeUnit.SECONDS));
179180
}
180181

181182
if (codeCount == 0) {
@@ -198,8 +199,8 @@ private void processDeferredConcepts() {
198199
}
199200

200201
if (relCount > 0) {
201-
ourLog.info("Saved {} deferred relationships ({} remain) in {}ms ({}ms / entry)",
202-
relCount, myConceptLinksToSaveLater.size(), stopwatch.getMillis(), stopwatch.getMillisPerOperation(relCount));
202+
ourLog.info("Saved {} deferred relationships ({} remain) in {}ms ({} entries/sec)",
203+
relCount, myConceptLinksToSaveLater.size(), stopwatch.getMillis(), stopwatch.formatThroughput(relCount, TimeUnit.SECONDS));
203204
}
204205

205206
if ((myDeferredConcepts.size() + myConceptLinksToSaveLater.size()) == 0) {

0 commit comments

Comments
 (0)