prometheus-community / node-exporter-textfile-collector-scripts

Scripts for node-exporter's textfile collector
Apache License 2.0
488 stars 185 forks source link

btrfs_stats.py: Precompiled regular expressions improve performance #210

Closed wangqingfree closed 4 months ago

wangqingfree commented 4 months ago

Performance Improvement: The regular expression DEVICE_PATTERN is precompiled and stored as a function-level variable, ensuring it doesn't need to be recompiled for each iteration in the loop