Rust: add some performance diagnostics

This outputs some duration counts for various parts of the extraction
process in the database in the form of telemetry diagnostics.

The diagnostics format was preferred to putting things in the relational
database as that will scale better to code scanning and is more flexible
as for the data we can put into it without passing through the dbscheme.
Also, although it's not the case yet, it will be possible to output
diagnostics even if creation of the database fails.
This commit is contained in:
Paolo Tranquilli
2024-11-26 15:57:18 +01:00
parent 9f09454db9
commit 24eb65692f
18 changed files with 656 additions and 43 deletions

6
Cargo.lock generated
View File

@@ -381,6 +381,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"argfile",
"chrono",
"clap",
"codeql-extractor",
"figment",
@@ -404,6 +405,7 @@ dependencies = [
"ra_ap_vfs",
"rust-extractor-macros",
"serde",
"serde_json",
"serde_with",
"stderrlog",
"triomphe",
@@ -2034,9 +2036,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.132"
version = "1.0.133"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d726bfaff4b320266d395898905d0eba0345aae23b54aee3a737e260fd46db03"
checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377"
dependencies = [
"itoa",
"memchr",