Hi Frank, On Mon, 2020-11-23 at 20:07 -0500, Frank Ch. Eigler via Elfutils-devel wrote: > From 0b61f4c758a507fcc2243357363e44140bd13d82 Mon Sep 17 00:00:00 > 2001 ?!??!! > From: "Frank Ch. Eigler" <f...@redhat.com> > Date: Mon, 23 Nov 2020 19:58:10 -0500 > Subject: [PATCH] debuginfod: sqlite3 metrics > > Add metrics for tracking sqlite3 error counts and query performance. > > The former looks like a new sibling of the "error_count" family, and > is tested by dd-corrupting a live database file then triggering some > debuginfod activity. > > error_count{sqlite3="file is not a database"} 1 > > The latter looks like _count/_sum pairs for each type of sqlite > prepared-statement used in the code, and is grep smoke-tested. They > should assist a sysadmin in tuning db storage. This example shows a > 6.4 ms/operation cost: > > sqlite3_milliseconds_count{step-done="rpm-file-intern"} 318 > sqlite3_milliseconds_sum{reset="rpm-file-intern"} 2033
Looks good. Just one question about the RAII timing metrics. It is using gettimeofday which I believe might jump around since it tracks "human time". Might it be better to use clock_gettime (CLOCK_MONOTONIC) instead? Note that uses nanoseconds instead of microseconds, so needs adjusting a factor 1000. Cheers, Mark