Full commit

# Gauges

Gauges are used to measure the instantaneous value of something.

## Creating

(use '[metrics.gauges :only (gauge)])

(def files-open
(gauge "files-open"
(return-number-of-files-open ...)))


That's it. Pretty simple.

gauge is a macro. If you need a function instead you can use gauge-fn, but you have to pass it a function, not just a body:

(use '[metrics.gauges :only (gauge-fn)])

(def files-open
(gauge-fn "files-open"
#(return-number-of-files-open ...)))


You can also use the defgauge macro to create a gauge and bind it to a var in one concise, easy step:

(use '[metrics.gauges :only (defgauge)])

(defgauge files-open
(return-number-of-files-open ...))


defgauge can take a body of statements like gauge or a function like gauge-fn.

All the def[metric] macros do some :ref:magic <desugaring> to the metric title to make it easier to define.

## Writing

There is no writing. Gauges execute the form(s) (or function) you passed when creating them every time they're read. You don't need to do anything else.

(use '[metrics.gauges :only (value)])
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.5475562214851379, "perplexity": 10538.449726929346}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2015-48/segments/1448398455135.96/warc/CC-MAIN-20151124205415-00282-ip-10-71-132-137.ec2.internal.warc.gz"}