Closed g-k closed 3 years ago
:tada: looks liked that worked:
query out of the top 20 queries by DB load
calls down and avg exec time is down to 1.38 ms (from 374.4 ms in https://gist.github.com/g-k/7d2e8835399018a51a0407fb4337d75a)
Avg execution time
1.38 ms
Times called
543
Avg rows returned
2.904
batch cert
last_seen
updates to reduce DB lock contentionrefs: https://gist.github.com/g-k/7d2e8835399018a51a0407fb4337d75a and prior poking with @Micheletto
Checklist
[x] Run
make
,gofmt
andgolint
your code, and run a test scan on your local machine before submitting for review.[x]
make
[x]
gofmt -d database/certificate.go tlsobs-scanner/analyser.go
[x]
golint
NB:
gofmt
andgolint
have a pile of changes and warningslast_seen
column is just used for statistics (e.g. certs and new certs seen in the past 24h)db.GetCertIDBySHA256Fingerprint
just uses thesha256_fingerprint
column,
db.GetCurrentTrustIDand
db.UpdateTrustjust use the
is_currentcolumn in the
trust` tabledb.InsertCertificate
adds a row to thecertificates
table without looking at existinglast_seen
valuesI haven't run perf tests, but should be able to verify the changes in stage.
r? @ajvb