Skip to content

Commit

Permalink
Add timing logs for chart rendering.
Browse files Browse the repository at this point in the history
  • Loading branch information
zestyping committed Jun 27, 2019
1 parent 73f8dc7 commit 35caaed
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,10 @@ public void setChartIndex(int chartIndex) {
public synchronized void updatePatientObsUi() {
// Get the observations and orders
// TODO: Background thread this, or make this call async-like.
long start = System.currentTimeMillis();
String patientId = mPatient != null ? mPatient.id : "(unknown)";
Utils.logEvent("Start rendering chart for " + patientId + ", uuid = " + mPatientUuid);

mObservations = mChartHelper.getObservations(mPatientUuid);
Map<String, Obs> latestObservations =
new HashMap<>(mChartHelper.getLatestObservations(mPatientUuid));
Expand All @@ -571,7 +575,7 @@ public synchronized void updatePatientObsUi() {
for (Order order : orders) {
mOrdersByUuid.put(order.uuid, order);
}
LOG.d("Showing " + mObservations.size() + " observations and "
LOG.i("Showing " + mObservations.size() + " observations and "
+ orders.size() + " orders");

LocalDate admissionDate = getObservedDate(
Expand All @@ -587,6 +591,10 @@ public synchronized void updatePatientObsUi() {
latestObservations, mObservations, orders,
admissionDate, firstSymptomsDate);
}

long finish = System.currentTimeMillis();
LOG.i("Rendered chart in %d ms", finish - start);
Utils.logEvent("Finished rendering chart for " + patientId + ", uuid = " + mPatientUuid);
}

public List<Chart> getCharts(){
Expand Down

0 comments on commit 35caaed

Please sign in to comment.