Skip to content

Reduce CPU utilization of row count query

Stan Hu requested to merge sh-optimize-db-probe into master

Previously, scraping the /database metrics used a significant amount of CPU because each query would rebuild the PG to Ruby data type map. We now memoize this map so we only need to build this map once.

Before (1.8 s)

image

After (0.07 s)

image

Closes https://gitlab.com/gitlab-org/gitlab-exporter/-/issues/75

Edited by Stan Hu

Merge request reports