mirror of
https://github.com/owntone/owntone-server.git
synced 2025-01-14 16:25:03 -05:00
Add DB profiling support
This commit is contained in:
parent
5c81144beb
commit
cd8686be82
14
src/db.c
14
src/db.c
@ -3662,6 +3662,16 @@ db_watch_enum_fetchwd(struct watch_enum *we, uint32_t *wd)
|
||||
}
|
||||
|
||||
|
||||
#ifdef DB_PROFILE
|
||||
static void
|
||||
db_xprofile(void *notused, const char *pquery, sqlite3_uint64 ptime)
|
||||
{
|
||||
DPRINTF(E_DBG, L_DB, "SQL PROFILE query: %s\n", pquery);
|
||||
DPRINTF(E_DBG, L_DB, "SQL PROFILE time: %" PRIu64 "\n", (uint64_t)ptime);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
int
|
||||
db_perthread_init(void)
|
||||
{
|
||||
@ -3711,6 +3721,10 @@ db_perthread_init(void)
|
||||
return -1;
|
||||
}
|
||||
|
||||
#ifdef DB_PROFILE
|
||||
sqlite3_profile(hdl, db_xprofile, NULL);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user