Merge "storaged: Avoid divide-by-zero in performance measurement" am: 91d24d5bad

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2096820

Change-Id: I9f3255750b1203c08f6d1a90a0014e63ed4733db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Matthew Duggan 2022-05-19 01:07:12 +00:00 committed by Automerger Merge Worker
commit 58d33900f2

View file

@ -333,7 +333,7 @@ void storaged_t::flush_proto_data(userid_t user_id,
first_write = false;
}
if (benchmark_size) {
if (benchmark_size && benchmark_time_ns) {
int perf = benchmark_size * 1000000LLU / benchmark_time_ns;
storage_info->update_perf_history(perf, system_clock::now());
}