* debuginfod-find.c (progressfn): Use clock_gettime to print Progress
at most 5 times a second.
+2020-11-19 Frank Ch. Eigler <fche@redhat.com>
+
+ * debuginfod.cxx (tmp_inc_metric): New class.
+ (handler_cb): Use it to track webapi operations.
+
2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
* debuginfod-client.c (debuginfod_init_cache): Use ACCESSPERMS for
int64_t value);
// static void add_metric(const string& metric, int64_t value);
+class tmp_inc_metric { // a RAII style wrapper for exception-safe scoped increment & decrement
+ string m, n, v;
+public:
+ tmp_inc_metric(const string& mname, const string& lname, const string& lvalue):
+ m(mname), n(lname), v(lvalue)
+ {
+ add_metric (m, n, v, 1);
+ }
+ ~tmp_inc_metric()
+ {
+ add_metric (m, n, v, -1);
+ }
+};
+
+
/* Handle program arguments. */
static error_t
parse_opt (int key, char *arg,
if (slash1 != string::npos && url1 == "/buildid")
{
+ tmp_inc_metric m ("thread_busy", "role", "http-buildid");
size_t slash2 = url_copy.find('/', slash1+1);
if (slash2 == string::npos)
throw reportable_exception("/buildid/ webapi error, need buildid");
}
else if (url1 == "/metrics")
{
+ tmp_inc_metric m ("thread_busy", "role", "http-metrics");
inc_metric("http_requests_total", "type", "metrics");
r = handle_metrics(& http_size);
}
* run-debuginfod-find.sh: Create bogus R/nothing.rpm with cyclic
symlink instead of chmod 000.
+2020-11-19 Frank Ch. Eigler <fche@redhat.com>
+
+ * run-debuginfod-find.sh: Look for http-* metrics.
+
2020-11-01 Érico N. Rolim <erico.erc@gmail.com>
Mark Wielaard <mark@klomp.org>
wait_ready $PORT2 'thread_work_pending{role="scan"}' 0
wait_ready $PORT2 'thread_busy{role="scan"}' 0
+wait_ready $PORT2 'thread_busy{role="http-buildid"}' 0
+wait_ready $PORT2 'thread_busy{role="http-metrics"}' 1
+
# have clients contact the new server
export DEBUGINFOD_URLS=http://127.0.0.1:$PORT2