diff options
| author | Demitri Swan <demitriswan@gmail.com> | 2019-10-31 19:07:40 +0000 |
|---|---|---|
| committer | Demitri Swan <demitriswan@gmail.com> | 2019-10-31 19:30:43 +0000 |
| commit | 4b7241f6671b1dc32602d55ea3560ea7895b3daf (patch) | |
| tree | aeb3d487aadac669269ee76a17987e28f925c49c | |
| parent | 1d536b7211a6306bce154745c9b4c52a52c63c5f (diff) | |
Issue-7: The documentation for prom and promhttp should be updated
66 files changed, 1714 insertions, 292 deletions
diff --git a/docs/dir_000003_000000.html b/docs/dir_000003_000000.html index f0ce765..9f76930 100644 --- a/docs/dir_000003_000000.html +++ b/docs/dir_000003_000000.html @@ -64,7 +64,7 @@ $(function() { </div> </div><!-- top --> <div class="contents"> -<h3>include → prom Relation</h3><table class="dirtab"><tr class="dirtab"><th class="dirtab">File in promhttp/include</th><th class="dirtab">Includes file in prom</th></tr><tr class="dirtab"><td class="dirtab"><a class="el" href="promhttp_8h.html">promhttp.h</a></td><td class="dirtab"><a class="el" href="dir_83821d63a26a6eb889c4977bd95ca990.html">include</a> / <a class="el" href="prom_8h.html">prom.h</a></td></tr></table></div><!-- contents --> +<h3>include → prom Relation</h3><table class="dirtab"><tr class="dirtab"><th class="dirtab">File in promhttp/include</th><th class="dirtab">Includes file in prom</th></tr><tr class="dirtab"><td class="dirtab"><a class="el" href="promhttp_8h.html">promhttp.h</a></td><td class="dirtab"><a class="el" href="dir_83821d63a26a6eb889c4977bd95ca990.html">include</a> / <a class="el" href="prom__collector__registry_8h.html">prom_collector_registry.h</a></td></tr></table></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> diff --git a/docs/dir_21619567660c3332e6a61228c76007f9.html b/docs/dir_21619567660c3332e6a61228c76007f9.html index ca466b9..c53b540 100644 --- a/docs/dir_21619567660c3332e6a61228c76007f9.html +++ b/docs/dir_21619567660c3332e6a61228c76007f9.html @@ -68,6 +68,17 @@ $(function() { <div class="title">promhttp Directory Reference</div> </div> </div><!--header--> <div class="contents"> +<div class="dynheader"> +Directory dependency graph for promhttp:</div> +<div class="dyncontent"> +<div class="center"><img src="dir_21619567660c3332e6a61228c76007f9_dep.png" border="0" usemap="#dir__21619567660c3332e6a61228c76007f9__dep" alt="promhttp"/></div> +<map name="dir__21619567660c3332e6a61228c76007f9__dep" id="dir__21619567660c3332e6a61228c76007f9__dep"> +<area shape="rect" id="node2" href="dir_8d140c3a8bac3cd45205c9ea74fd211f.html" title="include" alt="" coords="27,27,99,75"/> +<area shape="rect" id="node3" href="dir_2c63f04010e7ff462eba5e344f58cd21.html" title="prom" alt="" coords="27,123,99,171"/> +<area shape="rect" id="edge1-headlabel" href="dir_000003_000000.html" title="1" alt="" coords="66,97,76,111"/> +<area shape="rect" id="clust1" href="dir_21619567660c3332e6a61228c76007f9.html" alt="" coords="16,16,216,85"/> +</map> +</div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="subdirs"></a> Directories</h2></td></tr> diff --git a/docs/dir_8d140c3a8bac3cd45205c9ea74fd211f.html b/docs/dir_8d140c3a8bac3cd45205c9ea74fd211f.html index 4f31cf1..198903e 100644 --- a/docs/dir_8d140c3a8bac3cd45205c9ea74fd211f.html +++ b/docs/dir_8d140c3a8bac3cd45205c9ea74fd211f.html @@ -68,6 +68,17 @@ $(function() { <div class="title">include Directory Reference</div> </div> </div><!--header--> <div class="contents"> +<div class="dynheader"> +Directory dependency graph for include:</div> +<div class="dyncontent"> +<div class="center"><img src="dir_8d140c3a8bac3cd45205c9ea74fd211f_dep.png" border="0" usemap="#dir__8d140c3a8bac3cd45205c9ea74fd211f__dep" alt="promhttp/include"/></div> +<map name="dir__8d140c3a8bac3cd45205c9ea74fd211f__dep" id="dir__8d140c3a8bac3cd45205c9ea74fd211f__dep"> +<area shape="rect" id="node1" href="dir_8d140c3a8bac3cd45205c9ea74fd211f.html" title="include" alt="" coords="27,52,99,100"/> +<area shape="rect" id="node2" href="dir_2c63f04010e7ff462eba5e344f58cd21.html" title="prom" alt="" coords="27,148,99,196"/> +<area shape="rect" id="edge1-headlabel" href="dir_000003_000000.html" title="1" alt="" coords="66,122,76,137"/> +<area shape="rect" id="clust1" href="dir_21619567660c3332e6a61228c76007f9.html" title="promhttp" alt="" coords="16,16,109,111"/> +</map> +</div> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="files"></a> Files</h2></td></tr> diff --git a/docs/globals.html b/docs/globals.html index 2c2629c..3e01c4b 100644 --- a/docs/globals.html +++ b/docs/globals.html @@ -75,6 +75,9 @@ $(function() { <li>prom_collector_destroy_generic() : <a class="el" href="prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337">prom_collector.h</a> </li> +<li>prom_collector_free_generic() +: <a class="el" href="prom__collector_8h.html#a875b72940cd578ee76c71f1f4853f139">prom_collector.h</a> +</li> <li>prom_collector_new() : <a class="el" href="prom__collector_8h.html#a4300cf33b6f8e4457df385c3d2a51a4b">prom_collector.h</a> </li> @@ -174,6 +177,9 @@ $(function() { <li>prom_histogram_buckets_linear() : <a class="el" href="prom__histogram__buckets_8h.html#aa1adc550bf8999a27f6a26769d6bfc72">prom_histogram_buckets.h</a> </li> +<li>prom_histogram_buckets_new() +: <a class="el" href="prom__histogram__buckets_8h.html#a03736e2fac21748bbfd80100bf9546c4">prom_histogram_buckets.h</a> +</li> <li>prom_histogram_default_buckets : <a class="el" href="prom__histogram__buckets_8h.html#aa8d61c1abc355eb54173b27cb1b50a5d">prom_histogram_buckets.h</a> </li> diff --git a/docs/globals_func.html b/docs/globals_func.html index 3417c7e..61f1433 100644 --- a/docs/globals_func.html +++ b/docs/globals_func.html @@ -72,6 +72,9 @@ $(function() { <li>prom_collector_destroy_generic() : <a class="el" href="prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337">prom_collector.h</a> </li> +<li>prom_collector_free_generic() +: <a class="el" href="prom__collector_8h.html#a875b72940cd578ee76c71f1f4853f139">prom_collector.h</a> +</li> <li>prom_collector_new() : <a class="el" href="prom__collector_8h.html#a4300cf33b6f8e4457df385c3d2a51a4b">prom_collector.h</a> </li> @@ -153,6 +156,9 @@ $(function() { <li>prom_histogram_buckets_linear() : <a class="el" href="prom__histogram__buckets_8h.html#aa1adc550bf8999a27f6a26769d6bfc72">prom_histogram_buckets.h</a> </li> +<li>prom_histogram_buckets_new() +: <a class="el" href="prom__histogram__buckets_8h.html#a03736e2fac21748bbfd80100bf9546c4">prom_histogram_buckets.h</a> +</li> <li>prom_histogram_destroy() : <a class="el" href="prom__histogram_8h.html#af9067b27e7ab2abd815af0614bb35357">prom_histogram.h</a> </li> diff --git a/docs/prom_8h.html b/docs/prom_8h.html index 9400ab3..fd93243 100644 --- a/docs/prom_8h.html +++ b/docs/prom_8h.html @@ -88,18 +88,18 @@ Include dependency graph for prom.h:</div> <div class="dyncontent"> <div class="center"><img src="prom_8h__incl.png" border="0" usemap="#prom_2include_2prom_8h" alt=""/></div> <map name="prom_2include_2prom_8h" id="prom_2include_2prom_8h"> -<area shape="rect" id="node2" href="prom__alloc_8h.html" title="memory management " alt="" coords="571,80,678,107"/> -<area shape="rect" id="node5" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="922,155,1052,181"/> -<area shape="rect" id="node6" href="prom__map_8h_source.html" title="prom_map.h" alt="" coords="979,229,1083,256"/> -<area shape="rect" id="node7" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="498,229,615,256"/> -<area shape="rect" id="node8" href="prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="310,311,482,338"/> -<area shape="rect" id="node9" href="prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="636,304,796,345"/> -<area shape="rect" id="node10" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="840,80,1027,107"/> -<area shape="rect" id="node11" href="prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="256,80,379,107"/> -<area shape="rect" id="node12" href="prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="702,80,816,107"/> -<area shape="rect" id="node13" href="prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="91,80,232,107"/> -<area shape="rect" id="node14" href="prom__histogram__buckets_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="52,155,250,181"/> -<area shape="rect" id="node15" href="prom__linked__list_8h_source.html" title="prom_linked_list.h" alt="" coords="404,80,546,107"/> +<area shape="rect" id="node2" href="prom__alloc_8h.html" title="memory management " alt="" coords="173,80,279,107"/> +<area shape="rect" id="node5" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="1021,155,1151,181"/> +<area shape="rect" id="node6" href="prom__map_8h_source.html" title="prom_map.h" alt="" coords="1079,229,1183,256"/> +<area shape="rect" id="node7" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="919,229,1037,256"/> +<area shape="rect" id="node8" href="prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="844,311,1016,338"/> +<area shape="rect" id="node9" href="prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="1099,304,1259,345"/> +<area shape="rect" id="node10" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="914,80,1101,107"/> +<area shape="rect" id="node11" href="prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="671,155,794,181"/> +<area shape="rect" id="node12" href="prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="533,155,647,181"/> +<area shape="rect" id="node13" href="prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="485,80,626,107"/> +<area shape="rect" id="node14" href="prom__histogram__buckets_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="260,155,459,181"/> +<area shape="rect" id="node15" href="prom__linked__list_8h_source.html" title="prom_linked_list.h" alt="" coords="5,80,148,107"/> </map> </div> </div> diff --git a/docs/prom_8h__incl.map b/docs/prom_8h__incl.map index 61509b9..f8280de 100644 --- a/docs/prom_8h__incl.map +++ b/docs/prom_8h__incl.map @@ -1,14 +1,14 @@ <map id="prom/include/prom.h" name="prom/include/prom.h"> -<area shape="rect" id="node2" href="$prom__alloc_8h.html" title="memory management " alt="" coords="571,80,678,107"/> -<area shape="rect" id="node5" href="$prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="922,155,1052,181"/> -<area shape="rect" id="node6" href="$prom__map_8h_source.html" title="prom_map.h" alt="" coords="979,229,1083,256"/> -<area shape="rect" id="node7" href="$prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="498,229,615,256"/> -<area shape="rect" id="node8" href="$prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="310,311,482,338"/> -<area shape="rect" id="node9" href="$prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="636,304,796,345"/> -<area shape="rect" id="node10" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="840,80,1027,107"/> -<area shape="rect" id="node11" href="$prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="256,80,379,107"/> -<area shape="rect" id="node12" href="$prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="702,80,816,107"/> -<area shape="rect" id="node13" href="$prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="91,80,232,107"/> -<area shape="rect" id="node14" href="$prom__histogram__buckets_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="52,155,250,181"/> -<area shape="rect" id="node15" href="$prom__linked__list_8h_source.html" title="prom_linked_list.h" alt="" coords="404,80,546,107"/> +<area shape="rect" id="node2" href="$prom__alloc_8h.html" title="memory management " alt="" coords="173,80,279,107"/> +<area shape="rect" id="node5" href="$prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="1021,155,1151,181"/> +<area shape="rect" id="node6" href="$prom__map_8h_source.html" title="prom_map.h" alt="" coords="1079,229,1183,256"/> +<area shape="rect" id="node7" href="$prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="919,229,1037,256"/> +<area shape="rect" id="node8" href="$prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="844,311,1016,338"/> +<area shape="rect" id="node9" href="$prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="1099,304,1259,345"/> +<area shape="rect" id="node10" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="914,80,1101,107"/> +<area shape="rect" id="node11" href="$prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="671,155,794,181"/> +<area shape="rect" id="node12" href="$prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="533,155,647,181"/> +<area shape="rect" id="node13" href="$prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="485,80,626,107"/> +<area shape="rect" id="node14" href="$prom__histogram__buckets_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="260,155,459,181"/> +<area shape="rect" id="node15" href="$prom__linked__list_8h_source.html" title="prom_linked_list.h" alt="" coords="5,80,148,107"/> </map> diff --git a/docs/prom_8h__incl.md5 b/docs/prom_8h__incl.md5 index 8863e60..74d8431 100644 --- a/docs/prom_8h__incl.md5 +++ b/docs/prom_8h__incl.md5 @@ -1 +1 @@ -997d8c31651c98f51e83142372bbf5a3
\ No newline at end of file +dff60c1f9e7587cb80e299960395a051
\ No newline at end of file diff --git a/docs/prom_8h__incl.png b/docs/prom_8h__incl.png Binary files differindex e260a66..83ece20 100644 --- a/docs/prom_8h__incl.png +++ b/docs/prom_8h__incl.png diff --git a/docs/prom__collector_8h.html b/docs/prom__collector_8h.html index 8054c84..8a6c744 100644 --- a/docs/prom__collector_8h.html +++ b/docs/prom__collector_8h.html @@ -92,8 +92,9 @@ This graph shows which files directly or indirectly include this file:</div> <div class="dyncontent"> <div class="center"><img src="prom__collector_8h__dep__incl.png" border="0" usemap="#prom_2include_2prom__collector_8hdep" alt=""/></div> <map name="prom_2include_2prom__collector_8hdep" id="prom_2include_2prom__collector_8hdep"> -<area shape="rect" id="node2" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="36,169,193,196"/> -<area shape="rect" id="node3" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="81,80,289,121"/> +<area shape="rect" id="node2" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="5,169,163,196"/> +<area shape="rect" id="node3" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="121,80,329,121"/> +<area shape="rect" id="node4" href="promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="187,169,397,196"/> </map> </div> </div> @@ -111,31 +112,26 @@ typedef struct prom_collector </td><td class="memItemRight" valign="bottom" </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> -<tr class="memitem:a4300cf33b6f8e4457df385c3d2a51a4b"><td class="memItemLeft" align="right" valign="top"><a id="a4300cf33b6f8e4457df385c3d2a51a4b"></a> -<a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#a4300cf33b6f8e4457df385c3d2a51a4b">prom_collector_new</a> (const char *name)</td></tr> -<tr class="memdesc:a4300cf33b6f8e4457df385c3d2a51a4b"><td class="mdescLeft"> </td><td class="mdescRight">Create a collector. <br /></td></tr> +<tr class="memitem:a4300cf33b6f8e4457df385c3d2a51a4b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#a4300cf33b6f8e4457df385c3d2a51a4b">prom_collector_new</a> (const char *name)</td></tr> +<tr class="memdesc:a4300cf33b6f8e4457df385c3d2a51a4b"><td class="mdescLeft"> </td><td class="mdescRight">Create a collector. <a href="#a4300cf33b6f8e4457df385c3d2a51a4b">More...</a><br /></td></tr> <tr class="separator:a4300cf33b6f8e4457df385c3d2a51a4b"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:af50746bb4af87eda617fa08237e3834e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#af50746bb4af87eda617fa08237e3834e">prom_collector_process_new</a> (const char *limits_path, const char *stat_path)</td></tr> -<tr class="memdesc:af50746bb4af87eda617fa08237e3834e"><td class="mdescLeft"> </td><td class="mdescRight">Return a collector including the default process metrics. <a href="#af50746bb4af87eda617fa08237e3834e">More...</a><br /></td></tr> +<tr class="memdesc:af50746bb4af87eda617fa08237e3834e"><td class="mdescLeft"> </td><td class="mdescRight">Construct a prom_collector_t* which includes the default process metrics. <a href="#af50746bb4af87eda617fa08237e3834e">More...</a><br /></td></tr> <tr class="separator:af50746bb4af87eda617fa08237e3834e"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a037b72b2edb81a477999a7dfc08758c7"><td class="memItemLeft" align="right" valign="top"><a id="a037b72b2edb81a477999a7dfc08758c7"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#a037b72b2edb81a477999a7dfc08758c7">prom_collector_destroy</a> (<a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *self)</td></tr> -<tr class="memdesc:a037b72b2edb81a477999a7dfc08758c7"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a collector. <br /></td></tr> +<tr class="memitem:a037b72b2edb81a477999a7dfc08758c7"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#a037b72b2edb81a477999a7dfc08758c7">prom_collector_destroy</a> (<a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *self)</td></tr> +<tr class="memdesc:a037b72b2edb81a477999a7dfc08758c7"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a collector. <a href="#a037b72b2edb81a477999a7dfc08758c7">More...</a><br /></td></tr> <tr class="separator:a037b72b2edb81a477999a7dfc08758c7"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a875b72940cd578ee76c71f1f4853f139"><td class="memItemLeft" align="right" valign="top"><a id="a875b72940cd578ee76c71f1f4853f139"></a> -void </td><td class="memItemRight" valign="bottom"><b>prom_collector_free_generic</b> (void *gen)</td></tr> +<tr class="memitem:a875b72940cd578ee76c71f1f4853f139"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#a875b72940cd578ee76c71f1f4853f139">prom_collector_free_generic</a> (void *gen)</td></tr> +<tr class="memdesc:a875b72940cd578ee76c71f1f4853f139"><td class="mdescLeft"> </td><td class="mdescRight">Frees a collector passed as a void pointer. <a href="#a875b72940cd578ee76c71f1f4853f139">More...</a><br /></td></tr> <tr class="separator:a875b72940cd578ee76c71f1f4853f139"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a12c297cce0a30ee4149f2b486d9f0337"><td class="memItemLeft" align="right" valign="top"><a id="a12c297cce0a30ee4149f2b486d9f0337"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337">prom_collector_destroy_generic</a> (void *gen)</td></tr> -<tr class="memdesc:a12c297cce0a30ee4149f2b486d9f0337"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a collector. <br /></td></tr> +<tr class="memitem:a12c297cce0a30ee4149f2b486d9f0337"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337">prom_collector_destroy_generic</a> (void *gen)</td></tr> +<tr class="memdesc:a12c297cce0a30ee4149f2b486d9f0337"><td class="mdescLeft"> </td><td class="mdescRight">Destroys a collector passed as a void pointer. <a href="#a12c297cce0a30ee4149f2b486d9f0337">More...</a><br /></td></tr> <tr class="separator:a12c297cce0a30ee4149f2b486d9f0337"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:abd87021bd63f759d55642685a74874ee"><td class="memItemLeft" align="right" valign="top"><a id="abd87021bd63f759d55642685a74874ee"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#abd87021bd63f759d55642685a74874ee">prom_collector_add_metric</a> (<a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *self, <a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric)</td></tr> -<tr class="memdesc:abd87021bd63f759d55642685a74874ee"><td class="mdescLeft"> </td><td class="mdescRight">Add a metric to a collector. <br /></td></tr> +<tr class="memitem:abd87021bd63f759d55642685a74874ee"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#abd87021bd63f759d55642685a74874ee">prom_collector_add_metric</a> (<a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *self, <a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric)</td></tr> +<tr class="memdesc:abd87021bd63f759d55642685a74874ee"><td class="mdescLeft"> </td><td class="mdescRight">Add a metric to a collector. <a href="#abd87021bd63f759d55642685a74874ee">More...</a><br /></td></tr> <tr class="separator:abd87021bd63f759d55642685a74874ee"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a9929cb81f4fb49ffca8aa880a4699650"><td class="memItemLeft" align="right" valign="top"><a id="a9929cb81f4fb49ffca8aa880a4699650"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#a9929cb81f4fb49ffca8aa880a4699650">prom_collector_set_collect_fn</a> (<a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *self, <a class="el" href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40">prom_collect_fn</a> *fn)</td></tr> -<tr class="memdesc:a9929cb81f4fb49ffca8aa880a4699650"><td class="mdescLeft"> </td><td class="mdescRight">The collect function is responsible for doing any work involving a set of metrics and then returning them for metric exposition. <br /></td></tr> +<tr class="memitem:a9929cb81f4fb49ffca8aa880a4699650"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector_8h.html#a9929cb81f4fb49ffca8aa880a4699650">prom_collector_set_collect_fn</a> (<a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *self, <a class="el" href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40">prom_collect_fn</a> *fn)</td></tr> +<tr class="memdesc:a9929cb81f4fb49ffca8aa880a4699650"><td class="mdescLeft"> </td><td class="mdescRight">The collect function is responsible for doing any work involving a set of metrics and then returning them for metric exposition. <a href="#a9929cb81f4fb49ffca8aa880a4699650">More...</a><br /></td></tr> <tr class="separator:a9929cb81f4fb49ffca8aa880a4699650"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> @@ -154,11 +150,163 @@ int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom_ </div><div class="memdoc"> <p>The function responsible for preparing metric data and returning metrics for a given collector. </p> -<p>If you use the default collector registry, this should not concern you. If you are using a custom collector, you may which to set this function on your collector to do additional work before returning the contained metrics. </p> +<p>If you use the default collector registry, this should not concern you. If you are using a custom collector, you may set this function on your collector to do additional work before returning the contained metrics.</p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_collector_t* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The prom_map_t* containing the collected metrics </dd></dl> </div> </div> <h2 class="groupheader">Function Documentation</h2> +<a id="abd87021bd63f759d55642685a74874ee"></a> +<h2 class="memtitle"><span class="permalink"><a href="#abd87021bd63f759d55642685a74874ee">◆ </a></span>prom_collector_add_metric()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_collector_add_metric </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype"><a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> * </td> + <td class="paramname"><em>metric</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Add a metric to a collector. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_collector_t* </td></tr> + <tr><td class="paramname">metric</td><td>the prom_metric_t* to add to the prom_collector_t* passed as self. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure. </dd></dl> + +</div> +</div> +<a id="a037b72b2edb81a477999a7dfc08758c7"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a037b72b2edb81a477999a7dfc08758c7">◆ </a></span>prom_collector_destroy()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_collector_destroy </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> * </td> + <td class="paramname"><em>self</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Destroy a collector. </p> +<p>You MUST set self to NULL after destruction. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_collector_t* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure. </dd></dl> + +</div> +</div> +<a id="a12c297cce0a30ee4149f2b486d9f0337"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a12c297cce0a30ee4149f2b486d9f0337">◆ </a></span>prom_collector_destroy_generic()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_collector_destroy_generic </td> + <td>(</td> + <td class="paramtype">void * </td> + <td class="paramname"><em>gen</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Destroys a collector passed as a void pointer. </p> +<p>You MUST set self to NULL after destruction. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">gen</td><td>The target prom_collector_t* represented as a void* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure. </dd></dl> + +</div> +</div> +<a id="a875b72940cd578ee76c71f1f4853f139"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a875b72940cd578ee76c71f1f4853f139">◆ </a></span>prom_collector_free_generic()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">void prom_collector_free_generic </td> + <td>(</td> + <td class="paramtype">void * </td> + <td class="paramname"><em>gen</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Frees a collector passed as a void pointer. </p> +<p>You MUST set self to NULL after destruction. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">gen</td><td>The target prom_collector_t* represented as a void* </td></tr> + </table> + </dd> +</dl> + +</div> +</div> +<a id="a4300cf33b6f8e4457df385c3d2a51a4b"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a4300cf33b6f8e4457df385c3d2a51a4b">◆ </a></span>prom_collector_new()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a>* prom_collector_new </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Create a collector. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">name</td><td>The name of the collector. The name MUST NOT be default or process. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The constructed prom_collector_t* </dd></dl> + +</div> +</div> <a id="af50746bb4af87eda617fa08237e3834e"></a> <h2 class="memtitle"><span class="permalink"><a href="#af50746bb4af87eda617fa08237e3834e">◆ </a></span>prom_collector_process_new()</h2> @@ -185,14 +333,53 @@ int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom_ </table> </div><div class="memdoc"> -<p>Return a collector including the default process metrics. </p> +<p>Construct a prom_collector_t* which includes the default process metrics. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">limits_path</td><td>Pass NULL to discover the path to the /proc/[pid]/limits file associated with process ID assigned by the host environment. Otherwise, pass a string to said path. </td></tr> + <tr><td class="paramname">stat_path</td><td>Pass NULL to discover the path to the /proc/[pid]/stat file associated with process ID assigned by the host environment. Otherwise, pass a string to said path. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The constructed prom_collector_t* </dd></dl> + +</div> +</div> +<a id="a9929cb81f4fb49ffca8aa880a4699650"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a9929cb81f4fb49ffca8aa880a4699650">◆ </a></span>prom_collector_set_collect_fn()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_collector_set_collect_fn </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype"><a class="el" href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40">prom_collect_fn</a> * </td> + <td class="paramname"><em>fn</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>The collect function is responsible for doing any work involving a set of metrics and then returning them for metric exposition. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> - <tr><td class="paramname">limits_path</td><td>Pass NULL to discover the path to the proc/[pid]/limits file associated with process ID assigned by the host environment. Otherwise, pass a string to said path. </td></tr> - <tr><td class="paramname">stat_path</td><td>Pass NULL to discover the path to the proc/[pid]/stat file associated with process ID assigned by the host environment. Otherwise, pass a string to said path. </td></tr> + <tr><td class="paramname">self</td><td>The target prom_collector_t* </td></tr> + <tr><td class="paramname">fn</td><td>The prom_collect_fn* which will be responsible for handling any metric collection operations before returning the collected metrics for exposition. </td></tr> </table> </dd> </dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure. </dd></dl> </div> </div> diff --git a/docs/prom__collector_8h__dep__incl.map b/docs/prom__collector_8h__dep__incl.map index 9fa0427..cd35408 100644 --- a/docs/prom__collector_8h__dep__incl.map +++ b/docs/prom__collector_8h__dep__incl.map @@ -1,4 +1,5 @@ <map id="prom/include/prom_collector.h" name="prom/include/prom_collector.h"> -<area shape="rect" id="node2" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="36,169,193,196"/> -<area shape="rect" id="node3" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="81,80,289,121"/> +<area shape="rect" id="node2" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="5,169,163,196"/> +<area shape="rect" id="node3" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="121,80,329,121"/> +<area shape="rect" id="node4" href="$promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="187,169,397,196"/> </map> diff --git a/docs/prom__collector_8h__dep__incl.md5 b/docs/prom__collector_8h__dep__incl.md5 index 82a4851..1df5832 100644 --- a/docs/prom__collector_8h__dep__incl.md5 +++ b/docs/prom__collector_8h__dep__incl.md5 @@ -1 +1 @@ -07dc7165f11a707089d59b1682323dc4
\ No newline at end of file +dcee52eb811bae7086fe3047a905fe5f
\ No newline at end of file diff --git a/docs/prom__collector_8h__dep__incl.png b/docs/prom__collector_8h__dep__incl.png Binary files differindex e39cd6f..edfa370 100644 --- a/docs/prom__collector_8h__dep__incl.png +++ b/docs/prom__collector_8h__dep__incl.png diff --git a/docs/prom__collector_8h_source.html b/docs/prom__collector_8h_source.html index 0f92e80..85ff5e1 100644 --- a/docs/prom__collector_8h_source.html +++ b/docs/prom__collector_8h_source.html @@ -68,16 +68,17 @@ $(function() { <div class="title">prom_collector.h</div> </div> </div><!--header--> <div class="contents"> -<a href="prom__collector_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#ifndef PROM_COLLECTOR_H</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#define PROM_COLLECTOR_H</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "prom_map.h"</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c"> 32</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_collector <a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a>;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40"> 40</a></span> <span class="keyword">typedef</span> prom_map_t* <a class="code" href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40">prom_collect_fn</a>(<a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a>* <span class="keyword">self</span>);</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a>* <a class="code" href="prom__collector_8h.html#a4300cf33b6f8e4457df385c3d2a51a4b">prom_collector_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a>* <a class="code" href="prom__collector_8h.html#af50746bb4af87eda617fa08237e3834e">prom_collector_process_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *limits_path, <span class="keyword">const</span> <span class="keywordtype">char</span> *stat_path);</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector_8h.html#a037b72b2edb81a477999a7dfc08758c7">prom_collector_destroy</a>(<a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="keywordtype">void</span> prom_collector_free_generic(<span class="keywordtype">void</span> *gen);</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337">prom_collector_destroy_generic</a>(<span class="keywordtype">void</span> *gen);</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector_8h.html#abd87021bd63f759d55642685a74874ee">prom_collector_add_metric</a>(<a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *<span class="keyword">self</span>, <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric);</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> </div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector_8h.html#a9929cb81f4fb49ffca8aa880a4699650">prom_collector_set_collect_fn</a>(<a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *<span class="keyword">self</span>, <a class="code" href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40">prom_collect_fn</a> *fn);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <span class="preprocessor">#endif // PROM_COLLECTOR_H</span></div><div class="ttc" id="prom__collector_8h_html_a28cf36f114f69a96508c044c44716f9c"><div class="ttname"><a href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a></div><div class="ttdeci">struct prom_collector prom_collector_t</div><div class="ttdoc">A prometheus collector calls collect to prepare metrics and return them to the registry to which it i...</div><div class="ttdef"><b>Definition:</b> prom_collector.h:32</div></div> +<a href="prom__collector_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#ifndef PROM_COLLECTOR_H</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#define PROM_COLLECTOR_H</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include "prom_map.h"</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c"> 32</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_collector <a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a>;</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40"> 43</a></span> <span class="keyword">typedef</span> prom_map_t* <a class="code" href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40">prom_collect_fn</a>(<a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a>* <span class="keyword">self</span>);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a>* <a class="code" href="prom__collector_8h.html#a4300cf33b6f8e4457df385c3d2a51a4b">prom_collector_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a>* <a class="code" href="prom__collector_8h.html#af50746bb4af87eda617fa08237e3834e">prom_collector_process_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *limits_path, <span class="keyword">const</span> <span class="keywordtype">char</span> *stat_path);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector_8h.html#a037b72b2edb81a477999a7dfc08758c7">prom_collector_destroy</a>(<a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="keywordtype">void</span> <a class="code" href="prom__collector_8h.html#a875b72940cd578ee76c71f1f4853f139">prom_collector_free_generic</a>(<span class="keywordtype">void</span> *gen);</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337">prom_collector_destroy_generic</a>(<span class="keywordtype">void</span> *gen);</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector_8h.html#abd87021bd63f759d55642685a74874ee">prom_collector_add_metric</a>(<a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *<span class="keyword">self</span>, <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector_8h.html#a9929cb81f4fb49ffca8aa880a4699650">prom_collector_set_collect_fn</a>(<a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *<span class="keyword">self</span>, <a class="code" href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40">prom_collect_fn</a> *fn);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> </div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> <span class="preprocessor">#endif // PROM_COLLECTOR_H</span></div><div class="ttc" id="prom__collector_8h_html_a28cf36f114f69a96508c044c44716f9c"><div class="ttname"><a href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a></div><div class="ttdeci">struct prom_collector prom_collector_t</div><div class="ttdoc">A prometheus collector calls collect to prepare metrics and return them to the registry to which it i...</div><div class="ttdef"><b>Definition:</b> prom_collector.h:32</div></div> <div class="ttc" id="prom__metric_8h_html_afd1bd014c48955d6c2c36aa8a8cbb889"><div class="ttname"><a href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a></div><div class="ttdeci">struct prom_metric prom_metric_t</div><div class="ttdoc">A prometheus metric. </div><div class="ttdef"><b>Definition:</b> prom_metric.h:34</div></div> <div class="ttc" id="prom__collector_8h_html_abd87021bd63f759d55642685a74874ee"><div class="ttname"><a href="prom__collector_8h.html#abd87021bd63f759d55642685a74874ee">prom_collector_add_metric</a></div><div class="ttdeci">int prom_collector_add_metric(prom_collector_t *self, prom_metric_t *metric)</div><div class="ttdoc">Add a metric to a collector. </div></div> <div class="ttc" id="prom__collector_8h_html_a037b72b2edb81a477999a7dfc08758c7"><div class="ttname"><a href="prom__collector_8h.html#a037b72b2edb81a477999a7dfc08758c7">prom_collector_destroy</a></div><div class="ttdeci">int prom_collector_destroy(prom_collector_t *self)</div><div class="ttdoc">Destroy a collector. </div></div> <div class="ttc" id="prom__collector_8h_html_a9929cb81f4fb49ffca8aa880a4699650"><div class="ttname"><a href="prom__collector_8h.html#a9929cb81f4fb49ffca8aa880a4699650">prom_collector_set_collect_fn</a></div><div class="ttdeci">int prom_collector_set_collect_fn(prom_collector_t *self, prom_collect_fn *fn)</div><div class="ttdoc">The collect function is responsible for doing any work involving a set of metrics and then returning ...</div></div> <div class="ttc" id="prom__collector_8h_html_a4300cf33b6f8e4457df385c3d2a51a4b"><div class="ttname"><a href="prom__collector_8h.html#a4300cf33b6f8e4457df385c3d2a51a4b">prom_collector_new</a></div><div class="ttdeci">prom_collector_t * prom_collector_new(const char *name)</div><div class="ttdoc">Create a collector. </div></div> -<div class="ttc" id="prom__collector_8h_html_af50746bb4af87eda617fa08237e3834e"><div class="ttname"><a href="prom__collector_8h.html#af50746bb4af87eda617fa08237e3834e">prom_collector_process_new</a></div><div class="ttdeci">prom_collector_t * prom_collector_process_new(const char *limits_path, const char *stat_path)</div><div class="ttdoc">Return a collector including the default process metrics. </div></div> +<div class="ttc" id="prom__collector_8h_html_a875b72940cd578ee76c71f1f4853f139"><div class="ttname"><a href="prom__collector_8h.html#a875b72940cd578ee76c71f1f4853f139">prom_collector_free_generic</a></div><div class="ttdeci">void prom_collector_free_generic(void *gen)</div><div class="ttdoc">Frees a collector passed as a void pointer. </div></div> +<div class="ttc" id="prom__collector_8h_html_af50746bb4af87eda617fa08237e3834e"><div class="ttname"><a href="prom__collector_8h.html#af50746bb4af87eda617fa08237e3834e">prom_collector_process_new</a></div><div class="ttdeci">prom_collector_t * prom_collector_process_new(const char *limits_path, const char *stat_path)</div><div class="ttdoc">Construct a prom_collector_t* which includes the default process metrics. </div></div> <div class="ttc" id="prom__metric_8h_html"><div class="ttname"><a href="prom__metric_8h.html">prom_metric.h</a></div><div class="ttdoc">Functions for retrieving metric samples from metrics given an ordered set of labels. </div></div> -<div class="ttc" id="prom__collector_8h_html_a12c297cce0a30ee4149f2b486d9f0337"><div class="ttname"><a href="prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337">prom_collector_destroy_generic</a></div><div class="ttdeci">int prom_collector_destroy_generic(void *gen)</div><div class="ttdoc">Destroy a collector. </div></div> -<div class="ttc" id="prom__collector_8h_html_af87330edd48cdb8e1074517e734b1e40"><div class="ttname"><a href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40">prom_collect_fn</a></div><div class="ttdeci">prom_map_t * prom_collect_fn(prom_collector_t *self)</div><div class="ttdoc">The function responsible for preparing metric data and returning metrics for a given collector...</div><div class="ttdef"><b>Definition:</b> prom_collector.h:40</div></div> +<div class="ttc" id="prom__collector_8h_html_a12c297cce0a30ee4149f2b486d9f0337"><div class="ttname"><a href="prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337">prom_collector_destroy_generic</a></div><div class="ttdeci">int prom_collector_destroy_generic(void *gen)</div><div class="ttdoc">Destroys a collector passed as a void pointer. </div></div> +<div class="ttc" id="prom__collector_8h_html_af87330edd48cdb8e1074517e734b1e40"><div class="ttname"><a href="prom__collector_8h.html#af87330edd48cdb8e1074517e734b1e40">prom_collect_fn</a></div><div class="ttdeci">prom_map_t * prom_collect_fn(prom_collector_t *self)</div><div class="ttdoc">The function responsible for preparing metric data and returning metrics for a given collector...</div><div class="ttdef"><b>Definition:</b> prom_collector.h:43</div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> diff --git a/docs/prom__collector__registry_8h.html b/docs/prom__collector__registry_8h.html index 8eb546a..51837c6 100644 --- a/docs/prom__collector__registry_8h.html +++ b/docs/prom__collector__registry_8h.html @@ -94,7 +94,8 @@ This graph shows which files directly or indirectly include this file:</div> <div class="dyncontent"> <div class="center"><img src="prom__collector__registry_8h__dep__incl.png" border="0" usemap="#prom_2include_2prom__collector__registry_8hdep" alt=""/></div> <map name="prom_2include_2prom__collector__registry_8hdep" id="prom_2include_2prom__collector__registry_8hdep"> -<area shape="rect" id="node2" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="31,95,188,121"/> +<area shape="rect" id="node2" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="5,95,163,121"/> +<area shape="rect" id="node3" href="promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="187,95,397,121"/> </map> </div> </div> @@ -109,21 +110,17 @@ typedef struct prom_collector_registry </td><td class="memItemRight" valign </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> -<tr class="memitem:aaf1421bd744f0dbbdaba7e64cec11f54"><td class="memItemLeft" align="right" valign="top"><a id="aaf1421bd744f0dbbdaba7e64cec11f54"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#aaf1421bd744f0dbbdaba7e64cec11f54">prom_collector_registry_default_init</a> (void)</td></tr> -<tr class="memdesc:aaf1421bd744f0dbbdaba7e64cec11f54"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the default collector registry and enables metric collection on the executing process. <br /></td></tr> +<tr class="memitem:aaf1421bd744f0dbbdaba7e64cec11f54"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#aaf1421bd744f0dbbdaba7e64cec11f54">prom_collector_registry_default_init</a> (void)</td></tr> +<tr class="memdesc:aaf1421bd744f0dbbdaba7e64cec11f54"><td class="mdescLeft"> </td><td class="mdescRight">Initializes the default collector registry and enables metric collection on the executing process. <a href="#aaf1421bd744f0dbbdaba7e64cec11f54">More...</a><br /></td></tr> <tr class="separator:aaf1421bd744f0dbbdaba7e64cec11f54"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ab5d622258998978c528253f07e2903b8"><td class="memItemLeft" align="right" valign="top"><a id="ab5d622258998978c528253f07e2903b8"></a> -<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#ab5d622258998978c528253f07e2903b8">prom_collector_registry_new</a> (const char *name)</td></tr> -<tr class="memdesc:ab5d622258998978c528253f07e2903b8"><td class="mdescLeft"> </td><td class="mdescRight">Return a new collector registry. <br /></td></tr> +<tr class="memitem:ab5d622258998978c528253f07e2903b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#ab5d622258998978c528253f07e2903b8">prom_collector_registry_new</a> (const char *name)</td></tr> +<tr class="memdesc:ab5d622258998978c528253f07e2903b8"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a prom_collector_registry_t*. <a href="#ab5d622258998978c528253f07e2903b8">More...</a><br /></td></tr> <tr class="separator:ab5d622258998978c528253f07e2903b8"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ad3854e6e40b6f741fde53dc65f0ecd87"><td class="memItemLeft" align="right" valign="top"><a id="ad3854e6e40b6f741fde53dc65f0ecd87"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#ad3854e6e40b6f741fde53dc65f0ecd87">prom_collector_registry_destroy</a> (<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *self)</td></tr> -<tr class="memdesc:ad3854e6e40b6f741fde53dc65f0ecd87"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a collector registry. <br /></td></tr> +<tr class="memitem:ad3854e6e40b6f741fde53dc65f0ecd87"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#ad3854e6e40b6f741fde53dc65f0ecd87">prom_collector_registry_destroy</a> (<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *self)</td></tr> +<tr class="memdesc:ad3854e6e40b6f741fde53dc65f0ecd87"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a collector registry. <a href="#ad3854e6e40b6f741fde53dc65f0ecd87">More...</a><br /></td></tr> <tr class="separator:ad3854e6e40b6f741fde53dc65f0ecd87"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a0d59bf988de4ee29e076910fa7135071"><td class="memItemLeft" align="right" valign="top"><a id="a0d59bf988de4ee29e076910fa7135071"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#a0d59bf988de4ee29e076910fa7135071">prom_collector_registry_enable_process_metrics</a> (<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *self)</td></tr> -<tr class="memdesc:a0d59bf988de4ee29e076910fa7135071"><td class="mdescLeft"> </td><td class="mdescRight">Enable process metrics on the given collector registry. <br /></td></tr> +<tr class="memitem:a0d59bf988de4ee29e076910fa7135071"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#a0d59bf988de4ee29e076910fa7135071">prom_collector_registry_enable_process_metrics</a> (<a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *self)</td></tr> +<tr class="memdesc:a0d59bf988de4ee29e076910fa7135071"><td class="mdescLeft"> </td><td class="mdescRight">Enable process metrics on the given collector registry. <a href="#a0d59bf988de4ee29e076910fa7135071">More...</a><br /></td></tr> <tr class="separator:a0d59bf988de4ee29e076910fa7135071"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a113683f4e15ad9240a37ed2139ddaea6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__collector__registry_8h.html#a113683f4e15ad9240a37ed2139ddaea6">prom_collector_registry_must_register_metric</a> (<a class="el" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric)</td></tr> <tr class="memdesc:a113683f4e15ad9240a37ed2139ddaea6"><td class="mdescLeft"> </td><td class="mdescRight">Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. <a href="#a113683f4e15ad9240a37ed2139ddaea6">More...</a><br /></td></tr> @@ -167,7 +164,90 @@ Variables</h2></td></tr> </div><div class="memdoc"> <p>Returns a string in the default metric exposition format. </p> -<p>Reference: <a href="https://prometheus.io/docs/instrumenting/exposition_formats/">https://prometheus.io/docs/instrumenting/exposition_formats/</a> </p> +<p>The string MUST be freed to avoid unnecessary heap memory growth.</p> +<p>Reference: <a href="https://prometheus.io/docs/instrumenting/exposition_formats/">https://prometheus.io/docs/instrumenting/exposition_formats/</a></p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The string int he default metric exposition format. </dd></dl> + +</div> +</div> +<a id="aaf1421bd744f0dbbdaba7e64cec11f54"></a> +<h2 class="memtitle"><span class="permalink"><a href="#aaf1421bd744f0dbbdaba7e64cec11f54">◆ </a></span>prom_collector_registry_default_init()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_collector_registry_default_init </td> + <td>(</td> + <td class="paramtype">void </td> + <td class="paramname"></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Initializes the default collector registry and enables metric collection on the executing process. </p> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl> + +</div> +</div> +<a id="ad3854e6e40b6f741fde53dc65f0ecd87"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ad3854e6e40b6f741fde53dc65f0ecd87">◆ </a></span>prom_collector_registry_destroy()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_collector_registry_destroy </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> * </td> + <td class="paramname"><em>self</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Destroy a collector registry. </p> +<p>You MUST set self to NULL after destruction. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl> + +</div> +</div> +<a id="a0d59bf988de4ee29e076910fa7135071"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a0d59bf988de4ee29e076910fa7135071">◆ </a></span>prom_collector_registry_enable_process_metrics()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_collector_registry_enable_process_metrics </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> * </td> + <td class="paramname"><em>self</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Enable process metrics on the given collector registry. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl> </div> </div> @@ -188,7 +268,41 @@ Variables</h2></td></tr> </div><div class="memdoc"> <p>Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. </p> -<p>The metric to be registered MUST NOT already be registered with the given metric. If so, the program will halt. It returns a prom_metric_t* to simplify metric creation and registration. Furthermore, PROM_DEFAULT_COLLECTOR_REGISTRY must be registered via <a class="el" href="prom__collector__registry_8h.html#aaf1421bd744f0dbbdaba7e64cec11f54" title="Initializes the default collector registry and enables metric collection on the executing process...">prom_collector_registry_default_init()</a> prior to calling this function. The metric will be added to the default registry's default collector. </p> +<p>The metric to be registered MUST NOT already be registered with the given . If so, the program will halt. It returns a prom_metric_t* to simplify metric creation and registration. Furthermore, PROM_DEFAULT_COLLECTOR_REGISTRY must be registered via <a class="el" href="prom__collector__registry_8h.html#aaf1421bd744f0dbbdaba7e64cec11f54" title="Initializes the default collector registry and enables metric collection on the executing process...">prom_collector_registry_default_init()</a> prior to calling this function. The metric will be added to the default registry's default collector.</p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">metric</td><td>The metric to register on PROM_DEFAULT_COLLECTOR_REGISTRY* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The registered prom_metric_t* </dd></dl> + +</div> +</div> +<a id="ab5d622258998978c528253f07e2903b8"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ab5d622258998978c528253f07e2903b8">◆ </a></span>prom_collector_registry_new()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a>* prom_collector_registry_new </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Constructs a prom_collector_registry_t*. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">name</td><td>The name of the collector registry. It MUST NOT be default. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The constructed prom_collector_registry_t* </dd></dl> </div> </div> @@ -219,7 +333,14 @@ Variables</h2></td></tr> </div><div class="memdoc"> <p>Register a collector with the given registry. </p> -<p>Returns an error on failure. </p> +<p>Returns a non-zero integer value on failure. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr> + <tr><td class="paramname">collector</td><td>The prom_collector_t* to register onto the prom_collector_registry_t* as self </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl> </div> </div> @@ -240,7 +361,15 @@ Variables</h2></td></tr> </div><div class="memdoc"> <p>Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. </p> -<p>Returns an error on failure. See prom_collector_registry_must_register_metric. </p> +<p>Returns an non-zero integer value on failure.</p> +<p>See prom_collector_registry_must_register_metric.</p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">metric</td><td>The metric to register on PROM_DEFAULT_COLLECTOR_REGISTRY* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl> </div> </div> @@ -271,7 +400,16 @@ Variables</h2></td></tr> </div><div class="memdoc"> <p>Validates that the given metric name complies with the specification: </p> -<p>Reference: <a href="https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels">https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels</a> </p> +<p>Reference: <a href="https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels">https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels</a></p> +<p>Returns a non-zero integer value on failure.</p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_collector_registry_t* </td></tr> + <tr><td class="paramname">metric_name</td><td>The metric name to validate </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl> </div> </div> diff --git a/docs/prom__collector__registry_8h__dep__incl.map b/docs/prom__collector__registry_8h__dep__incl.map index 31fbe4c..50e0594 100644 --- a/docs/prom__collector__registry_8h__dep__incl.map +++ b/docs/prom__collector__registry_8h__dep__incl.map @@ -1,3 +1,4 @@ <map id="prom/include/prom_collector_registry.h" name="prom/include/prom_collector_registry.h"> -<area shape="rect" id="node2" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="31,95,188,121"/> +<area shape="rect" id="node2" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="5,95,163,121"/> +<area shape="rect" id="node3" href="$promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="187,95,397,121"/> </map> diff --git a/docs/prom__collector__registry_8h__dep__incl.md5 b/docs/prom__collector__registry_8h__dep__incl.md5 index fc16350..38641f3 100644 --- a/docs/prom__collector__registry_8h__dep__incl.md5 +++ b/docs/prom__collector__registry_8h__dep__incl.md5 @@ -1 +1 @@ -a87e40a3226cc69d3f7ff08cb008a187
\ No newline at end of file +5a1243c1b32399d7faa747e6b084c4b1
\ No newline at end of file diff --git a/docs/prom__collector__registry_8h__dep__incl.png b/docs/prom__collector__registry_8h__dep__incl.png Binary files differindex 8091912..ee24ede 100644 --- a/docs/prom__collector__registry_8h__dep__incl.png +++ b/docs/prom__collector__registry_8h__dep__incl.png diff --git a/docs/prom__collector__registry_8h_source.html b/docs/prom__collector__registry_8h_source.html index f9a8d19..84f4639 100644 --- a/docs/prom__collector__registry_8h_source.html +++ b/docs/prom__collector__registry_8h_source.html @@ -68,13 +68,13 @@ $(function() { <div class="title">prom_collector_registry.h</div> </div> </div><!--header--> <div class="contents"> -<a href="prom__collector__registry_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_REGISTRY_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_REGISTRY_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="prom__collector_8h.html">prom_collector.h</a>"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202"> 31</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_collector_registry <a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a>;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="prom__collector__registry_8h.html#a6092b48e150390c1927da5fe8914981b"> 37</a></span> <a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<a class="code" href="prom__collector__registry_8h.html#a6092b48e150390c1927da5fe8914981b">PROM_COLLECTOR_REGISTRY_DEFAULT</a>;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#aaf1421bd744f0dbbdaba7e64cec11f54">prom_collector_registry_default_init</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a>* <a class="code" href="prom__collector__registry_8h.html#ab5d622258998978c528253f07e2903b8">prom_collector_registry_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#ad3854e6e40b6f741fde53dc65f0ecd87">prom_collector_registry_destroy</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> </div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#a0d59bf988de4ee29e076910fa7135071">prom_collector_registry_enable_process_metrics</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a>* <a class="code" href="prom__collector__registry_8h.html#a113683f4e15ad9240a37ed2139ddaea6">prom_collector_registry_must_register_metric</a>(<a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#aa735fa0fbe03d6d9a0d11eb4792ec761">prom_collector_registry_register_metric</a>(<a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric);</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#a42203da085c6c6f2bc3ba31501683882">prom_collector_registry_register_collector</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>, <a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *collector);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="prom__collector__registry_8h.html#a0149a2702ae0b3ff39d57904d613c14f">prom_collector_registry_bridge</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#acf002221c3239584723f9fb15c53e15e">prom_collector_registry_validate_metric_name</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>,</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *metric_name);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> <span class="preprocessor">#endif // PROM_H</span></div><div class="ttc" id="prom__collector_8h_html_a28cf36f114f69a96508c044c44716f9c"><div class="ttname"><a href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a></div><div class="ttdeci">struct prom_collector prom_collector_t</div><div class="ttdoc">A prometheus collector calls collect to prepare metrics and return them to the registry to which it i...</div><div class="ttdef"><b>Definition:</b> prom_collector.h:32</div></div> +<a href="prom__collector__registry_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_REGISTRY_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_REGISTRY_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="prom__collector_8h.html">prom_collector.h</a>"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202"> 31</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_collector_registry <a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a>;</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="prom__collector__registry_8h.html#a6092b48e150390c1927da5fe8914981b"> 37</a></span> <a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<a class="code" href="prom__collector__registry_8h.html#a6092b48e150390c1927da5fe8914981b">PROM_COLLECTOR_REGISTRY_DEFAULT</a>;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#aaf1421bd744f0dbbdaba7e64cec11f54">prom_collector_registry_default_init</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a>* <a class="code" href="prom__collector__registry_8h.html#ab5d622258998978c528253f07e2903b8">prom_collector_registry_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#ad3854e6e40b6f741fde53dc65f0ecd87">prom_collector_registry_destroy</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#a0d59bf988de4ee29e076910fa7135071">prom_collector_registry_enable_process_metrics</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span> <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a>* <a class="code" href="prom__collector__registry_8h.html#a113683f4e15ad9240a37ed2139ddaea6">prom_collector_registry_must_register_metric</a>(<a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#aa735fa0fbe03d6d9a0d11eb4792ec761">prom_collector_registry_register_metric</a>(<a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *metric);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#a42203da085c6c6f2bc3ba31501683882">prom_collector_registry_register_collector</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>, <a class="code" href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a> *collector);</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">const</span> <span class="keywordtype">char</span>* <a class="code" href="prom__collector__registry_8h.html#a0149a2702ae0b3ff39d57904d613c14f">prom_collector_registry_bridge</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="keywordtype">int</span> <a class="code" href="prom__collector__registry_8h.html#acf002221c3239584723f9fb15c53e15e">prom_collector_registry_validate_metric_name</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *<span class="keyword">self</span>,</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *metric_name);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="preprocessor">#endif // PROM_H</span></div><div class="ttc" id="prom__collector_8h_html_a28cf36f114f69a96508c044c44716f9c"><div class="ttname"><a href="prom__collector_8h.html#a28cf36f114f69a96508c044c44716f9c">prom_collector_t</a></div><div class="ttdeci">struct prom_collector prom_collector_t</div><div class="ttdoc">A prometheus collector calls collect to prepare metrics and return them to the registry to which it i...</div><div class="ttdef"><b>Definition:</b> prom_collector.h:32</div></div> <div class="ttc" id="prom__collector__registry_8h_html_a0149a2702ae0b3ff39d57904d613c14f"><div class="ttname"><a href="prom__collector__registry_8h.html#a0149a2702ae0b3ff39d57904d613c14f">prom_collector_registry_bridge</a></div><div class="ttdeci">const char * prom_collector_registry_bridge(prom_collector_registry_t *self)</div><div class="ttdoc">Returns a string in the default metric exposition format. </div></div> <div class="ttc" id="prom__collector__registry_8h_html_ad3854e6e40b6f741fde53dc65f0ecd87"><div class="ttname"><a href="prom__collector__registry_8h.html#ad3854e6e40b6f741fde53dc65f0ecd87">prom_collector_registry_destroy</a></div><div class="ttdeci">int prom_collector_registry_destroy(prom_collector_registry_t *self)</div><div class="ttdoc">Destroy a collector registry. </div></div> <div class="ttc" id="prom__metric_8h_html_afd1bd014c48955d6c2c36aa8a8cbb889"><div class="ttname"><a href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a></div><div class="ttdeci">struct prom_metric prom_metric_t</div><div class="ttdoc">A prometheus metric. </div><div class="ttdef"><b>Definition:</b> prom_metric.h:34</div></div> <div class="ttc" id="prom__collector__registry_8h_html_aaf1421bd744f0dbbdaba7e64cec11f54"><div class="ttname"><a href="prom__collector__registry_8h.html#aaf1421bd744f0dbbdaba7e64cec11f54">prom_collector_registry_default_init</a></div><div class="ttdeci">int prom_collector_registry_default_init(void)</div><div class="ttdoc">Initializes the default collector registry and enables metric collection on the executing process...</div></div> <div class="ttc" id="prom__collector_8h_html"><div class="ttname"><a href="prom__collector_8h.html">prom_collector.h</a></div><div class="ttdoc">A Prometheus collector returns a collection of metrics. </div></div> -<div class="ttc" id="prom__collector__registry_8h_html_ab5d622258998978c528253f07e2903b8"><div class="ttname"><a href="prom__collector__registry_8h.html#ab5d622258998978c528253f07e2903b8">prom_collector_registry_new</a></div><div class="ttdeci">prom_collector_registry_t * prom_collector_registry_new(const char *name)</div><div class="ttdoc">Return a new collector registry. </div></div> +<div class="ttc" id="prom__collector__registry_8h_html_ab5d622258998978c528253f07e2903b8"><div class="ttname"><a href="prom__collector__registry_8h.html#ab5d622258998978c528253f07e2903b8">prom_collector_registry_new</a></div><div class="ttdeci">prom_collector_registry_t * prom_collector_registry_new(const char *name)</div><div class="ttdoc">Constructs a prom_collector_registry_t*. </div></div> <div class="ttc" id="prom__collector__registry_8h_html_a0d59bf988de4ee29e076910fa7135071"><div class="ttname"><a href="prom__collector__registry_8h.html#a0d59bf988de4ee29e076910fa7135071">prom_collector_registry_enable_process_metrics</a></div><div class="ttdeci">int prom_collector_registry_enable_process_metrics(prom_collector_registry_t *self)</div><div class="ttdoc">Enable process metrics on the given collector registry. </div></div> <div class="ttc" id="prom__collector__registry_8h_html_a20f07748401fbbde9efc8a718f9bc202"><div class="ttname"><a href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a></div><div class="ttdeci">struct prom_collector_registry prom_collector_registry_t</div><div class="ttdoc">A prom_registry_t is responsible for registering metrics and briding them to the string exposition fo...</div><div class="ttdef"><b>Definition:</b> prom_collector_registry.h:31</div></div> <div class="ttc" id="prom__collector__registry_8h_html_a113683f4e15ad9240a37ed2139ddaea6"><div class="ttname"><a href="prom__collector__registry_8h.html#a113683f4e15ad9240a37ed2139ddaea6">prom_collector_registry_must_register_metric</a></div><div class="ttdeci">prom_metric_t * prom_collector_registry_must_register_metric(prom_metric_t *metric)</div><div class="ttdoc">Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. ...</div></div> diff --git a/docs/prom__counter_8h.html b/docs/prom__counter_8h.html index bb09195..e3d472e 100644 --- a/docs/prom__counter_8h.html +++ b/docs/prom__counter_8h.html @@ -105,21 +105,17 @@ Typedefs</h2></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> -<tr class="memitem:a3302a9f1a3556d17af9af29729be2651"><td class="memItemLeft" align="right" valign="top"><a id="a3302a9f1a3556d17af9af29729be2651"></a> -<a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__counter_8h.html#a3302a9f1a3556d17af9af29729be2651">prom_counter_new</a> (const char *name, const char *help, size_t label_key_count, const char **label_keys)</td></tr> -<tr class="memdesc:a3302a9f1a3556d17af9af29729be2651"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to a prom_counter. <br /></td></tr> +<tr class="memitem:a3302a9f1a3556d17af9af29729be2651"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__counter_8h.html#a3302a9f1a3556d17af9af29729be2651">prom_counter_new</a> (const char *name, const char *help, size_t label_key_count, const char **label_keys)</td></tr> +<tr class="memdesc:a3302a9f1a3556d17af9af29729be2651"><td class="mdescLeft"> </td><td class="mdescRight">Construct a prom_counter_t*. <a href="#a3302a9f1a3556d17af9af29729be2651">More...</a><br /></td></tr> <tr class="separator:a3302a9f1a3556d17af9af29729be2651"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ac36abc71c11df1e774c8c102b1fdb78d"><td class="memItemLeft" align="right" valign="top"><a id="ac36abc71c11df1e774c8c102b1fdb78d"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__counter_8h.html#ac36abc71c11df1e774c8c102b1fdb78d">prom_counter_destroy</a> (<a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *self)</td></tr> -<tr class="memdesc:ac36abc71c11df1e774c8c102b1fdb78d"><td class="mdescLeft"> </td><td class="mdescRight">Destroys a pointer to a prom_counter. <br /></td></tr> +<tr class="memitem:ac36abc71c11df1e774c8c102b1fdb78d"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__counter_8h.html#ac36abc71c11df1e774c8c102b1fdb78d">prom_counter_destroy</a> (<a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *self)</td></tr> +<tr class="memdesc:ac36abc71c11df1e774c8c102b1fdb78d"><td class="mdescLeft"> </td><td class="mdescRight">Destroys a prom_counter_t*. <a href="#ac36abc71c11df1e774c8c102b1fdb78d">More...</a><br /></td></tr> <tr class="separator:ac36abc71c11df1e774c8c102b1fdb78d"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a315695fdd8b9b6fa59904bb2e35bfa35"><td class="memItemLeft" align="right" valign="top"><a id="a315695fdd8b9b6fa59904bb2e35bfa35"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__counter_8h.html#a315695fdd8b9b6fa59904bb2e35bfa35">prom_counter_inc</a> (<a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *self, const char **label_values)</td></tr> -<tr class="memdesc:a315695fdd8b9b6fa59904bb2e35bfa35"><td class="mdescLeft"> </td><td class="mdescRight">Increment the prom_counter by 1. <br /></td></tr> +<tr class="memitem:a315695fdd8b9b6fa59904bb2e35bfa35"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__counter_8h.html#a315695fdd8b9b6fa59904bb2e35bfa35">prom_counter_inc</a> (<a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *self, const char **label_values)</td></tr> +<tr class="memdesc:a315695fdd8b9b6fa59904bb2e35bfa35"><td class="mdescLeft"> </td><td class="mdescRight">Increment the prom_counter_t by 1. <a href="#a315695fdd8b9b6fa59904bb2e35bfa35">More...</a><br /></td></tr> <tr class="separator:a315695fdd8b9b6fa59904bb2e35bfa35"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:addd8a7efc39e17d30b2267e5a0a626db"><td class="memItemLeft" align="right" valign="top"><a id="addd8a7efc39e17d30b2267e5a0a626db"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__counter_8h.html#addd8a7efc39e17d30b2267e5a0a626db">prom_counter_add</a> (<a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *self, double r_value, const char **label_values)</td></tr> -<tr class="memdesc:addd8a7efc39e17d30b2267e5a0a626db"><td class="mdescLeft"> </td><td class="mdescRight">Add the value to the prom_counter. <br /></td></tr> +<tr class="memitem:addd8a7efc39e17d30b2267e5a0a626db"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__counter_8h.html#addd8a7efc39e17d30b2267e5a0a626db">prom_counter_add</a> (<a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *self, double r_value, const char **label_values)</td></tr> +<tr class="memdesc:addd8a7efc39e17d30b2267e5a0a626db"><td class="mdescLeft"> </td><td class="mdescRight">Add the value to the prom_counter_t*. <a href="#addd8a7efc39e17d30b2267e5a0a626db">More...</a><br /></td></tr> <tr class="separator:addd8a7efc39e17d30b2267e5a0a626db"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> @@ -144,6 +140,181 @@ int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom_ </div> </div> +<h2 class="groupheader">Function Documentation</h2> +<a id="addd8a7efc39e17d30b2267e5a0a626db"></a> +<h2 class="memtitle"><span class="permalink"><a href="#addd8a7efc39e17d30b2267e5a0a626db">◆ </a></span>prom_counter_add()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_counter_add </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">double </td> + <td class="paramname"><em>r_value</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_values</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Add the value to the prom_counter_t*. </p> +<p>A non-zero integer value will be returned on failure. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_counter_t* </td></tr> + <tr><td class="paramname">r_value</td><td>The double to add to the prom_counter_t passed as self. The value MUST be greater than or equal to 0. </td></tr> + <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the counter's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure.</dd></dl> +<p><em>Example</em> </p><pre class="fragment">// An example with labels +prom_counter_add(foo_counter, 22, (const char**) { "bar", "bang" }); + +// An example without labels +prom_counter_add(foo_counter, 22, NULL);</pre> +</div> +</div> +<a id="ac36abc71c11df1e774c8c102b1fdb78d"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ac36abc71c11df1e774c8c102b1fdb78d">◆ </a></span>prom_counter_destroy()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_counter_destroy </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> * </td> + <td class="paramname"><em>self</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Destroys a prom_counter_t*. </p> +<p>You must set self to NULL after destruction. A non-zero integer value will be returned on failure. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>A prom_counter_t* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure. </dd></dl> + +</div> +</div> +<a id="a315695fdd8b9b6fa59904bb2e35bfa35"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a315695fdd8b9b6fa59904bb2e35bfa35">◆ </a></span>prom_counter_inc()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_counter_inc </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_values</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Increment the prom_counter_t by 1. </p> +<p>A non-zero integer value will be returned on failure. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_counter_t* </td></tr> + <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the counter's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure.</dd></dl> +<p><em>Example</em> </p><pre class="fragment">// An example with labels +prom_counter_inc(foo_counter, (const char**) { "bar", "bang" }); + +// An example without labels +prom_counter_inc(foo_counter, NULL);</pre> +</div> +</div> +<a id="a3302a9f1a3556d17af9af29729be2651"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a3302a9f1a3556d17af9af29729be2651">◆ </a></span>prom_counter_new()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a>* prom_counter_new </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>help</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">size_t </td> + <td class="paramname"><em>label_key_count</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_keys</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Construct a prom_counter_t*. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">name</td><td>The name of the metric </td></tr> + <tr><td class="paramname">help</td><td>The metric description </td></tr> + <tr><td class="paramname">label_key_count</td><td>The number of labels associated with the given metric. Pass 0 if the metric does not require labels. </td></tr> + <tr><td class="paramname">label_keys</td><td>A collection of label keys. The number of keys MUST match the value passed as label_key_count. If no labels are required, pass NULL. Otherwise, it may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The constructed prom_counter_t*</dd></dl> +<p><em>Example</em> </p><pre class="fragment">// An example with labels +prom_counter_new("foo", "foo is a counter with labels", 2, (const char**) { "one", "two" }); + +// An example without labels +prom_counter_new("foo", "foo is a counter without labels", 0, NULL);</pre> +</div> +</div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> diff --git a/docs/prom__counter_8h_source.html b/docs/prom__counter_8h_source.html index cf59fea..7a3a8d5 100644 --- a/docs/prom__counter_8h_source.html +++ b/docs/prom__counter_8h_source.html @@ -68,13 +68,13 @@ $(function() { <div class="title">prom_counter.h</div> </div> </div><!--header--> <div class="contents"> -<a href="prom__counter_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef PROM_COUNTER_INCLUDED</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#define PROM_COUNTER_INCLUDED</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <stdlib.h></span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606"> 36</a></span> <span class="keyword">typedef</span> <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> <a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a>* <a class="code" href="prom__counter_8h.html#a3302a9f1a3556d17af9af29729be2651">prom_counter_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name,</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *help,</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keywordtype">size_t</span> label_key_count,</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> **label_keys);</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">int</span> <a class="code" href="prom__counter_8h.html#ac36abc71c11df1e774c8c102b1fdb78d">prom_counter_destroy</a>(<a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="keywordtype">int</span> <a class="code" href="prom__counter_8h.html#a315695fdd8b9b6fa59904bb2e35bfa35">prom_counter_inc</a>(<a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> </div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="keywordtype">int</span> <a class="code" href="prom__counter_8h.html#addd8a7efc39e17d30b2267e5a0a626db">prom_counter_add</a>(<a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="preprocessor">#endif // PROM_COUNTER_INCLUDED</span></div><div class="ttc" id="prom__counter_8h_html_addd8a7efc39e17d30b2267e5a0a626db"><div class="ttname"><a href="prom__counter_8h.html#addd8a7efc39e17d30b2267e5a0a626db">prom_counter_add</a></div><div class="ttdeci">int prom_counter_add(prom_counter_t *self, double r_value, const char **label_values)</div><div class="ttdoc">Add the value to the prom_counter. </div></div> -<div class="ttc" id="prom__counter_8h_html_a315695fdd8b9b6fa59904bb2e35bfa35"><div class="ttname"><a href="prom__counter_8h.html#a315695fdd8b9b6fa59904bb2e35bfa35">prom_counter_inc</a></div><div class="ttdeci">int prom_counter_inc(prom_counter_t *self, const char **label_values)</div><div class="ttdoc">Increment the prom_counter by 1. </div></div> +<a href="prom__counter_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#ifndef PROM_COUNTER_H</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#define PROM_COUNTER_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> </div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <stdlib.h></span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> </div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606"> 36</a></span> <span class="keyword">typedef</span> <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> <a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a>* <a class="code" href="prom__counter_8h.html#a3302a9f1a3556d17af9af29729be2651">prom_counter_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name,</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *help,</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  <span class="keywordtype">size_t</span> label_key_count,</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> **label_keys);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="keywordtype">int</span> <a class="code" href="prom__counter_8h.html#ac36abc71c11df1e774c8c102b1fdb78d">prom_counter_destroy</a>(<a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> </div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <span class="keywordtype">int</span> <a class="code" href="prom__counter_8h.html#a315695fdd8b9b6fa59904bb2e35bfa35">prom_counter_inc</a>(<a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span> </div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span> </div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="keywordtype">int</span> <a class="code" href="prom__counter_8h.html#addd8a7efc39e17d30b2267e5a0a626db">prom_counter_add</a>(<a class="code" href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> <span class="preprocessor">#endif // PROM_COUNTER_H</span></div><div class="ttc" id="prom__counter_8h_html_addd8a7efc39e17d30b2267e5a0a626db"><div class="ttname"><a href="prom__counter_8h.html#addd8a7efc39e17d30b2267e5a0a626db">prom_counter_add</a></div><div class="ttdeci">int prom_counter_add(prom_counter_t *self, double r_value, const char **label_values)</div><div class="ttdoc">Add the value to the prom_counter_t*. </div></div> +<div class="ttc" id="prom__counter_8h_html_a315695fdd8b9b6fa59904bb2e35bfa35"><div class="ttname"><a href="prom__counter_8h.html#a315695fdd8b9b6fa59904bb2e35bfa35">prom_counter_inc</a></div><div class="ttdeci">int prom_counter_inc(prom_counter_t *self, const char **label_values)</div><div class="ttdoc">Increment the prom_counter_t by 1. </div></div> <div class="ttc" id="prom__metric_8h_html_afd1bd014c48955d6c2c36aa8a8cbb889"><div class="ttname"><a href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a></div><div class="ttdeci">struct prom_metric prom_metric_t</div><div class="ttdoc">A prometheus metric. </div><div class="ttdef"><b>Definition:</b> prom_metric.h:34</div></div> <div class="ttc" id="prom__counter_8h_html_a814ceed99a1d618334e51f4d0e160606"><div class="ttname"><a href="prom__counter_8h.html#a814ceed99a1d618334e51f4d0e160606">prom_counter_t</a></div><div class="ttdeci">prom_metric_t prom_counter_t</div><div class="ttdoc">A prometheus counter. </div><div class="ttdef"><b>Definition:</b> prom_counter.h:36</div></div> -<div class="ttc" id="prom__counter_8h_html_ac36abc71c11df1e774c8c102b1fdb78d"><div class="ttname"><a href="prom__counter_8h.html#ac36abc71c11df1e774c8c102b1fdb78d">prom_counter_destroy</a></div><div class="ttdeci">int prom_counter_destroy(prom_counter_t *self)</div><div class="ttdoc">Destroys a pointer to a prom_counter. </div></div> +<div class="ttc" id="prom__counter_8h_html_ac36abc71c11df1e774c8c102b1fdb78d"><div class="ttname"><a href="prom__counter_8h.html#ac36abc71c11df1e774c8c102b1fdb78d">prom_counter_destroy</a></div><div class="ttdeci">int prom_counter_destroy(prom_counter_t *self)</div><div class="ttdoc">Destroys a prom_counter_t*. </div></div> <div class="ttc" id="prom__metric_8h_html"><div class="ttname"><a href="prom__metric_8h.html">prom_metric.h</a></div><div class="ttdoc">Functions for retrieving metric samples from metrics given an ordered set of labels. </div></div> -<div class="ttc" id="prom__counter_8h_html_a3302a9f1a3556d17af9af29729be2651"><div class="ttname"><a href="prom__counter_8h.html#a3302a9f1a3556d17af9af29729be2651">prom_counter_new</a></div><div class="ttdeci">prom_counter_t * prom_counter_new(const char *name, const char *help, size_t label_key_count, const char **label_keys)</div><div class="ttdoc">Returns a pointer to a prom_counter. </div></div> +<div class="ttc" id="prom__counter_8h_html_a3302a9f1a3556d17af9af29729be2651"><div class="ttname"><a href="prom__counter_8h.html#a3302a9f1a3556d17af9af29729be2651">prom_counter_new</a></div><div class="ttdeci">prom_counter_t * prom_counter_new(const char *name, const char *help, size_t label_key_count, const char **label_keys)</div><div class="ttdoc">Construct a prom_counter_t*. </div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> diff --git a/docs/prom__gauge_8h.html b/docs/prom__gauge_8h.html index ba0c18c..4d330ef 100644 --- a/docs/prom__gauge_8h.html +++ b/docs/prom__gauge_8h.html @@ -105,33 +105,26 @@ Typedefs</h2></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> -<tr class="memitem:a5ecd07c83cf0981944a9256914571d70"><td class="memItemLeft" align="right" valign="top"><a id="a5ecd07c83cf0981944a9256914571d70"></a> -<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a5ecd07c83cf0981944a9256914571d70">prom_gauge_new</a> (const char *name, const char *help, size_t label_key_count, const char **label_keys)</td></tr> -<tr class="memdesc:a5ecd07c83cf0981944a9256914571d70"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to a prom_gauge. <br /></td></tr> +<tr class="memitem:a5ecd07c83cf0981944a9256914571d70"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a5ecd07c83cf0981944a9256914571d70">prom_gauge_new</a> (const char *name, const char *help, size_t label_key_count, const char **label_keys)</td></tr> +<tr class="memdesc:a5ecd07c83cf0981944a9256914571d70"><td class="mdescLeft"> </td><td class="mdescRight">Constructs a prom_gauge_t*. <a href="#a5ecd07c83cf0981944a9256914571d70">More...</a><br /></td></tr> <tr class="separator:a5ecd07c83cf0981944a9256914571d70"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a2fc5dc11239cefdf59ae978be4bfd789"><td class="memItemLeft" align="right" valign="top"><a id="a2fc5dc11239cefdf59ae978be4bfd789"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a2fc5dc11239cefdf59ae978be4bfd789">prom_gauge_destroy</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self)</td></tr> -<tr class="memdesc:a2fc5dc11239cefdf59ae978be4bfd789"><td class="mdescLeft"> </td><td class="mdescRight">Destroys a pointer to a prom_gauge. <br /></td></tr> +<tr class="memitem:a2fc5dc11239cefdf59ae978be4bfd789"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a2fc5dc11239cefdf59ae978be4bfd789">prom_gauge_destroy</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self)</td></tr> +<tr class="memdesc:a2fc5dc11239cefdf59ae978be4bfd789"><td class="mdescLeft"> </td><td class="mdescRight">Destroys a prom_gauge_t*. <a href="#a2fc5dc11239cefdf59ae978be4bfd789">More...</a><br /></td></tr> <tr class="separator:a2fc5dc11239cefdf59ae978be4bfd789"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:ad953b12ea1f8a3c3b7a39e6c260d07a2"><td class="memItemLeft" align="right" valign="top"><a id="ad953b12ea1f8a3c3b7a39e6c260d07a2"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#ad953b12ea1f8a3c3b7a39e6c260d07a2">prom_gauge_inc</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, const char **label_values)</td></tr> -<tr class="memdesc:ad953b12ea1f8a3c3b7a39e6c260d07a2"><td class="mdescLeft"> </td><td class="mdescRight">Increment the prom_gauge by 1. <br /></td></tr> +<tr class="memitem:ad953b12ea1f8a3c3b7a39e6c260d07a2"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#ad953b12ea1f8a3c3b7a39e6c260d07a2">prom_gauge_inc</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, const char **label_values)</td></tr> +<tr class="memdesc:ad953b12ea1f8a3c3b7a39e6c260d07a2"><td class="mdescLeft"> </td><td class="mdescRight">Increment the prom_gauge_t* by 1. <a href="#ad953b12ea1f8a3c3b7a39e6c260d07a2">More...</a><br /></td></tr> <tr class="separator:ad953b12ea1f8a3c3b7a39e6c260d07a2"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:aa351ef4f2d917d7dae914df6d81c547b"><td class="memItemLeft" align="right" valign="top"><a id="aa351ef4f2d917d7dae914df6d81c547b"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#aa351ef4f2d917d7dae914df6d81c547b">prom_gauge_dec</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, const char **label_values)</td></tr> -<tr class="memdesc:aa351ef4f2d917d7dae914df6d81c547b"><td class="mdescLeft"> </td><td class="mdescRight">Descrement the prom_gauge by 1. <br /></td></tr> +<tr class="memitem:aa351ef4f2d917d7dae914df6d81c547b"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#aa351ef4f2d917d7dae914df6d81c547b">prom_gauge_dec</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, const char **label_values)</td></tr> +<tr class="memdesc:aa351ef4f2d917d7dae914df6d81c547b"><td class="mdescLeft"> </td><td class="mdescRight">Decrement the prom_gauge_t* by 1. <a href="#aa351ef4f2d917d7dae914df6d81c547b">More...</a><br /></td></tr> <tr class="separator:aa351ef4f2d917d7dae914df6d81c547b"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a96bc5b32abee5f99fbd4ae11bebd44c8"><td class="memItemLeft" align="right" valign="top"><a id="a96bc5b32abee5f99fbd4ae11bebd44c8"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a96bc5b32abee5f99fbd4ae11bebd44c8">prom_gauge_add</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, double r_value, const char **label_values)</td></tr> -<tr class="memdesc:a96bc5b32abee5f99fbd4ae11bebd44c8"><td class="mdescLeft"> </td><td class="mdescRight">Add the value to the prom_gauge. <br /></td></tr> +<tr class="memitem:a96bc5b32abee5f99fbd4ae11bebd44c8"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a96bc5b32abee5f99fbd4ae11bebd44c8">prom_gauge_add</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, double r_value, const char **label_values)</td></tr> +<tr class="memdesc:a96bc5b32abee5f99fbd4ae11bebd44c8"><td class="mdescLeft"> </td><td class="mdescRight">Add the value to the prom_gauge_t*. <a href="#a96bc5b32abee5f99fbd4ae11bebd44c8">More...</a><br /></td></tr> <tr class="separator:a96bc5b32abee5f99fbd4ae11bebd44c8"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a7ae193d586176bff82a39cd65e2bc999"><td class="memItemLeft" align="right" valign="top"><a id="a7ae193d586176bff82a39cd65e2bc999"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a7ae193d586176bff82a39cd65e2bc999">prom_gauge_sub</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, double r_value, const char **label_values)</td></tr> -<tr class="memdesc:a7ae193d586176bff82a39cd65e2bc999"><td class="mdescLeft"> </td><td class="mdescRight">Subtract the value from the prom_gauge. <br /></td></tr> +<tr class="memitem:a7ae193d586176bff82a39cd65e2bc999"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a7ae193d586176bff82a39cd65e2bc999">prom_gauge_sub</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, double r_value, const char **label_values)</td></tr> +<tr class="memdesc:a7ae193d586176bff82a39cd65e2bc999"><td class="mdescLeft"> </td><td class="mdescRight">Subtract the value to the prom_gauge. <a href="#a7ae193d586176bff82a39cd65e2bc999">More...</a><br /></td></tr> <tr class="separator:a7ae193d586176bff82a39cd65e2bc999"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a04210b18bfb89aa6f3ddc72d7851a528"><td class="memItemLeft" align="right" valign="top"><a id="a04210b18bfb89aa6f3ddc72d7851a528"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a04210b18bfb89aa6f3ddc72d7851a528">prom_gauge_set</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, double r_value, const char **label_values)</td></tr> -<tr class="memdesc:a04210b18bfb89aa6f3ddc72d7851a528"><td class="mdescLeft"> </td><td class="mdescRight">Set the value for the prom_gauge. <br /></td></tr> +<tr class="memitem:a04210b18bfb89aa6f3ddc72d7851a528"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__gauge_8h.html#a04210b18bfb89aa6f3ddc72d7851a528">prom_gauge_set</a> (<a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *self, double r_value, const char **label_values)</td></tr> +<tr class="memdesc:a04210b18bfb89aa6f3ddc72d7851a528"><td class="mdescLeft"> </td><td class="mdescRight">Set the value for the prom_gauge_t*. <a href="#a04210b18bfb89aa6f3ddc72d7851a528">More...</a><br /></td></tr> <tr class="separator:a04210b18bfb89aa6f3ddc72d7851a528"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> @@ -156,6 +149,321 @@ int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom_ </div> </div> +<h2 class="groupheader">Function Documentation</h2> +<a id="a96bc5b32abee5f99fbd4ae11bebd44c8"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a96bc5b32abee5f99fbd4ae11bebd44c8">◆ </a></span>prom_gauge_add()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_gauge_add </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">double </td> + <td class="paramname"><em>r_value</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_values</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Add the value to the prom_gauge_t*. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_gauge_t* </td></tr> + <tr><td class="paramname">r_value</td><td>The double to add to the prom_gauge_t passed as self. </td></tr> + <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure.</dd></dl> +<p><em>Example</em> </p><pre class="fragment">// An example with labels +prom_gauge_add(foo_gauge 22, (const char**) { "bar", "bang" }); + +// An example without labels +prom_gauge_add(foo_gauge, 22, NULL);</pre> +</div> +</div> +<a id="aa351ef4f2d917d7dae914df6d81c547b"></a> +<h2 class="memtitle"><span class="permalink"><a href="#aa351ef4f2d917d7dae914df6d81c547b">◆ </a></span>prom_gauge_dec()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_gauge_dec </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_values</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Decrement the prom_gauge_t* by 1. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_gauger_t* </td></tr> + <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure. <em>Example</em> <pre class="fragment">// An example with labels +prom_gauge_dec(foo_gauge, (const char**) { "bar", "bang" }); + +// An example without labels +prom_gauge_dec(foo_gauge, NULL);</pre> </dd></dl> + +</div> +</div> +<a id="a2fc5dc11239cefdf59ae978be4bfd789"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a2fc5dc11239cefdf59ae978be4bfd789">◆ </a></span>prom_gauge_destroy()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_gauge_destroy </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> * </td> + <td class="paramname"><em>self</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Destroys a prom_gauge_t*. </p> +<p>You must set self to NULL after destruction. A non-zero integer value will be returned on failure. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_gauge_t* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure </dd></dl> + +</div> +</div> +<a id="ad953b12ea1f8a3c3b7a39e6c260d07a2"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ad953b12ea1f8a3c3b7a39e6c260d07a2">◆ </a></span>prom_gauge_inc()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_gauge_inc </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_values</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Increment the prom_gauge_t* by 1. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_gauger_t* </td></tr> + <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure <em>Example</em> <pre class="fragment">// An example with labels +prom_gauge_inc(foo_gauge, (const char**) { "bar", "bang" }); + +// An example without labels +prom_gauge_inc(foo_gauge, NULL);</pre> </dd></dl> + +</div> +</div> +<a id="a5ecd07c83cf0981944a9256914571d70"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a5ecd07c83cf0981944a9256914571d70">◆ </a></span>prom_gauge_new()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a>* prom_gauge_new </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>help</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">size_t </td> + <td class="paramname"><em>label_key_count</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_keys</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Constructs a prom_gauge_t*. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">name</td><td>The name of the metric </td></tr> + <tr><td class="paramname">help</td><td>The metric description </td></tr> + <tr><td class="paramname">label_key_count</td><td>The number of labels associated with the given metric. Pass 0 if the metric does not require labels. </td></tr> + <tr><td class="paramname">label_keys</td><td>A collection of label keys. The number of keys MUST match the value passed as label_key_count. If no labels are required, pass NULL. Otherwise, it may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The constructed prom_guage_t* <pre class="fragment">// An example with labels +prom_gauge_new("foo", "foo is a gauge with labels", 2, (const char**) { "one", "two" }); + +// An example without labels +prom_gauge_new("foo", "foo is a gauge without labels", 0, NULL);</pre> </dd></dl> + +</div> +</div> +<a id="a04210b18bfb89aa6f3ddc72d7851a528"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a04210b18bfb89aa6f3ddc72d7851a528">◆ </a></span>prom_gauge_set()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_gauge_set </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">double </td> + <td class="paramname"><em>r_value</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_values</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Set the value for the prom_gauge_t*. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_gauge_t* </td></tr> + <tr><td class="paramname">r_value</td><td>The double to which the prom_gauge_t* passed as self will be set </td></tr> + <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure.</dd></dl> +<p><em>Example</em> </p><pre class="fragment">// An example with labels +prom_gauge_set(foo_gauge 22, (const char**) { "bar", "bang" }); + +// An example without labels +prom_gauge_set(foo_gauge, 22, NULL);</pre> +</div> +</div> +<a id="a7ae193d586176bff82a39cd65e2bc999"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a7ae193d586176bff82a39cd65e2bc999">◆ </a></span>prom_gauge_sub()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_gauge_sub </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">double </td> + <td class="paramname"><em>r_value</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_values</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Subtract the value to the prom_gauge. </p> +<p>A non-zero integer value will be returned on failure. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_gauge_t* </td></tr> + <tr><td class="paramname">r_value</td><td>The double to add to the prom_gauge_t passed as self. </td></tr> + <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the gauge's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A non-zero integer value upon failure.</dd></dl> +<p><em>Example</em> </p><pre class="fragment">// An example with labels +prom_gauge_sub(foo_gauge 22, (const char**) { "bar", "bang" }); + +// An example without labels +prom_gauge_sub(foo_gauge, 22, NULL);</pre> +</div> +</div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> diff --git a/docs/prom__gauge_8h_source.html b/docs/prom__gauge_8h_source.html index 8b0e466..2fd1ca6 100644 --- a/docs/prom__gauge_8h_source.html +++ b/docs/prom__gauge_8h_source.html @@ -68,15 +68,15 @@ $(function() { <div class="title">prom_gauge.h</div> </div> </div><!--header--> <div class="contents"> -<a href="prom__gauge_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_GAUGE_INCLUDED</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_GAUGE_INCLUDED</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <stdlib.h></span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5"> 35</a></span> <span class="keyword">typedef</span> <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> <a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a>* <a class="code" href="prom__gauge_8h.html#a5ecd07c83cf0981944a9256914571d70">prom_gauge_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name,</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *help,</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordtype">size_t</span> label_key_count,</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> **label_keys);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#a2fc5dc11239cefdf59ae978be4bfd789">prom_gauge_destroy</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#ad953b12ea1f8a3c3b7a39e6c260d07a2">prom_gauge_inc</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> </div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#aa351ef4f2d917d7dae914df6d81c547b">prom_gauge_dec</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#a96bc5b32abee5f99fbd4ae11bebd44c8">prom_gauge_add</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#a7ae193d586176bff82a39cd65e2bc999">prom_gauge_sub</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#a04210b18bfb89aa6f3ddc72d7851a528">prom_gauge_set</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="preprocessor">#endif // PROM_GAUGE_INCLUDED</span></div><div class="ttc" id="prom__gauge_8h_html_a5ecd07c83cf0981944a9256914571d70"><div class="ttname"><a href="prom__gauge_8h.html#a5ecd07c83cf0981944a9256914571d70">prom_gauge_new</a></div><div class="ttdeci">prom_gauge_t * prom_gauge_new(const char *name, const char *help, size_t label_key_count, const char **label_keys)</div><div class="ttdoc">Returns a pointer to a prom_gauge. </div></div> +<a href="prom__gauge_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_GAUGE_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_GAUGE_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <stdlib.h></span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5"> 35</a></span> <span class="keyword">typedef</span> <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> <a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> <a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a>* <a class="code" href="prom__gauge_8h.html#a5ecd07c83cf0981944a9256914571d70">prom_gauge_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name,</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *help,</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <span class="keywordtype">size_t</span> label_key_count,</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> **label_keys);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#a2fc5dc11239cefdf59ae978be4bfd789">prom_gauge_destroy</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#ad953b12ea1f8a3c3b7a39e6c260d07a2">prom_gauge_inc</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> </div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#aa351ef4f2d917d7dae914df6d81c547b">prom_gauge_dec</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span> </div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#a96bc5b32abee5f99fbd4ae11bebd44c8">prom_gauge_add</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> </div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> </div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#a7ae193d586176bff82a39cd65e2bc999">prom_gauge_sub</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> </div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> </div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span> <span class="keywordtype">int</span> <a class="code" href="prom__gauge_8h.html#a04210b18bfb89aa6f3ddc72d7851a528">prom_gauge_set</a>(<a class="code" href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span> </div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span> <span class="preprocessor">#endif // PROM_GAUGE_H</span></div><div class="ttc" id="prom__gauge_8h_html_a5ecd07c83cf0981944a9256914571d70"><div class="ttname"><a href="prom__gauge_8h.html#a5ecd07c83cf0981944a9256914571d70">prom_gauge_new</a></div><div class="ttdeci">prom_gauge_t * prom_gauge_new(const char *name, const char *help, size_t label_key_count, const char **label_keys)</div><div class="ttdoc">Constructs a prom_gauge_t*. </div></div> <div class="ttc" id="prom__metric_8h_html_afd1bd014c48955d6c2c36aa8a8cbb889"><div class="ttname"><a href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a></div><div class="ttdeci">struct prom_metric prom_metric_t</div><div class="ttdoc">A prometheus metric. </div><div class="ttdef"><b>Definition:</b> prom_metric.h:34</div></div> -<div class="ttc" id="prom__gauge_8h_html_a7ae193d586176bff82a39cd65e2bc999"><div class="ttname"><a href="prom__gauge_8h.html#a7ae193d586176bff82a39cd65e2bc999">prom_gauge_sub</a></div><div class="ttdeci">int prom_gauge_sub(prom_gauge_t *self, double r_value, const char **label_values)</div><div class="ttdoc">Subtract the value from the prom_gauge. </div></div> -<div class="ttc" id="prom__gauge_8h_html_aa351ef4f2d917d7dae914df6d81c547b"><div class="ttname"><a href="prom__gauge_8h.html#aa351ef4f2d917d7dae914df6d81c547b">prom_gauge_dec</a></div><div class="ttdeci">int prom_gauge_dec(prom_gauge_t *self, const char **label_values)</div><div class="ttdoc">Descrement the prom_gauge by 1. </div></div> +<div class="ttc" id="prom__gauge_8h_html_a7ae193d586176bff82a39cd65e2bc999"><div class="ttname"><a href="prom__gauge_8h.html#a7ae193d586176bff82a39cd65e2bc999">prom_gauge_sub</a></div><div class="ttdeci">int prom_gauge_sub(prom_gauge_t *self, double r_value, const char **label_values)</div><div class="ttdoc">Subtract the value to the prom_gauge. </div></div> +<div class="ttc" id="prom__gauge_8h_html_aa351ef4f2d917d7dae914df6d81c547b"><div class="ttname"><a href="prom__gauge_8h.html#aa351ef4f2d917d7dae914df6d81c547b">prom_gauge_dec</a></div><div class="ttdeci">int prom_gauge_dec(prom_gauge_t *self, const char **label_values)</div><div class="ttdoc">Decrement the prom_gauge_t* by 1. </div></div> <div class="ttc" id="prom__gauge_8h_html_a09417d7e7bab055a48f8e13181d136a5"><div class="ttname"><a href="prom__gauge_8h.html#a09417d7e7bab055a48f8e13181d136a5">prom_gauge_t</a></div><div class="ttdeci">prom_metric_t prom_gauge_t</div><div class="ttdoc">A prometheus gauge. </div><div class="ttdef"><b>Definition:</b> prom_gauge.h:35</div></div> -<div class="ttc" id="prom__gauge_8h_html_a96bc5b32abee5f99fbd4ae11bebd44c8"><div class="ttname"><a href="prom__gauge_8h.html#a96bc5b32abee5f99fbd4ae11bebd44c8">prom_gauge_add</a></div><div class="ttdeci">int prom_gauge_add(prom_gauge_t *self, double r_value, const char **label_values)</div><div class="ttdoc">Add the value to the prom_gauge. </div></div> -<div class="ttc" id="prom__gauge_8h_html_ad953b12ea1f8a3c3b7a39e6c260d07a2"><div class="ttname"><a href="prom__gauge_8h.html#ad953b12ea1f8a3c3b7a39e6c260d07a2">prom_gauge_inc</a></div><div class="ttdeci">int prom_gauge_inc(prom_gauge_t *self, const char **label_values)</div><div class="ttdoc">Increment the prom_gauge by 1. </div></div> -<div class="ttc" id="prom__gauge_8h_html_a04210b18bfb89aa6f3ddc72d7851a528"><div class="ttname"><a href="prom__gauge_8h.html#a04210b18bfb89aa6f3ddc72d7851a528">prom_gauge_set</a></div><div class="ttdeci">int prom_gauge_set(prom_gauge_t *self, double r_value, const char **label_values)</div><div class="ttdoc">Set the value for the prom_gauge. </div></div> -<div class="ttc" id="prom__gauge_8h_html_a2fc5dc11239cefdf59ae978be4bfd789"><div class="ttname"><a href="prom__gauge_8h.html#a2fc5dc11239cefdf59ae978be4bfd789">prom_gauge_destroy</a></div><div class="ttdeci">int prom_gauge_destroy(prom_gauge_t *self)</div><div class="ttdoc">Destroys a pointer to a prom_gauge. </div></div> +<div class="ttc" id="prom__gauge_8h_html_a96bc5b32abee5f99fbd4ae11bebd44c8"><div class="ttname"><a href="prom__gauge_8h.html#a96bc5b32abee5f99fbd4ae11bebd44c8">prom_gauge_add</a></div><div class="ttdeci">int prom_gauge_add(prom_gauge_t *self, double r_value, const char **label_values)</div><div class="ttdoc">Add the value to the prom_gauge_t*. </div></div> +<div class="ttc" id="prom__gauge_8h_html_ad953b12ea1f8a3c3b7a39e6c260d07a2"><div class="ttname"><a href="prom__gauge_8h.html#ad953b12ea1f8a3c3b7a39e6c260d07a2">prom_gauge_inc</a></div><div class="ttdeci">int prom_gauge_inc(prom_gauge_t *self, const char **label_values)</div><div class="ttdoc">Increment the prom_gauge_t* by 1. </div></div> +<div class="ttc" id="prom__gauge_8h_html_a04210b18bfb89aa6f3ddc72d7851a528"><div class="ttname"><a href="prom__gauge_8h.html#a04210b18bfb89aa6f3ddc72d7851a528">prom_gauge_set</a></div><div class="ttdeci">int prom_gauge_set(prom_gauge_t *self, double r_value, const char **label_values)</div><div class="ttdoc">Set the value for the prom_gauge_t*. </div></div> +<div class="ttc" id="prom__gauge_8h_html_a2fc5dc11239cefdf59ae978be4bfd789"><div class="ttname"><a href="prom__gauge_8h.html#a2fc5dc11239cefdf59ae978be4bfd789">prom_gauge_destroy</a></div><div class="ttdeci">int prom_gauge_destroy(prom_gauge_t *self)</div><div class="ttdoc">Destroys a prom_gauge_t*. </div></div> <div class="ttc" id="prom__metric_8h_html"><div class="ttname"><a href="prom__metric_8h.html">prom_metric.h</a></div><div class="ttdoc">Functions for retrieving metric samples from metrics given an ordered set of labels. </div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> diff --git a/docs/prom__histogram_8h.html b/docs/prom__histogram_8h.html index 8c5e752..2d100bc 100644 --- a/docs/prom__histogram_8h.html +++ b/docs/prom__histogram_8h.html @@ -82,10 +82,10 @@ Include dependency graph for prom_histogram.h:</div> <div class="dyncontent"> <div class="center"><img src="prom__histogram_8h__incl.png" border="0" usemap="#prom_2include_2prom__histogram_8h" alt=""/></div> <map name="prom_2include_2prom__histogram_8h" id="prom_2include_2prom__histogram_8h"> -<area shape="rect" id="node3" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="129,80,246,107"/> -<area shape="rect" id="node6" href="prom__histogram__buckets_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="269,80,468,107"/> -<area shape="rect" id="node4" href="prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="5,162,177,189"/> -<area shape="rect" id="node5" href="prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="202,155,362,196"/> +<area shape="rect" id="node3" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="244,80,361,107"/> +<area shape="rect" id="node6" href="prom__histogram__buckets_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="22,80,220,107"/> +<area shape="rect" id="node4" href="prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="164,162,336,189"/> +<area shape="rect" id="node5" href="prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="361,155,521,196"/> </map> </div> </div><div class="textblock"><div class="dynheader"> @@ -107,17 +107,14 @@ Typedefs</h2></td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> -<tr class="memitem:ad42681e59e727f9e3d43bf0cdbba9a1b"><td class="memItemLeft" align="right" valign="top"><a id="ad42681e59e727f9e3d43bf0cdbba9a1b"></a> -<a class="el" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram_8h.html#ad42681e59e727f9e3d43bf0cdbba9a1b">prom_histogram_new</a> (const char *name, const char *help, <a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *buckets, size_t label_key_count, const char **label_keys)</td></tr> -<tr class="memdesc:ad42681e59e727f9e3d43bf0cdbba9a1b"><td class="mdescLeft"> </td><td class="mdescRight">Returns a pointer to a prom_histogram_t. <br /></td></tr> +<tr class="memitem:ad42681e59e727f9e3d43bf0cdbba9a1b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram_8h.html#ad42681e59e727f9e3d43bf0cdbba9a1b">prom_histogram_new</a> (const char *name, const char *help, <a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *buckets, size_t label_key_count, const char **label_keys)</td></tr> +<tr class="memdesc:ad42681e59e727f9e3d43bf0cdbba9a1b"><td class="mdescLeft"> </td><td class="mdescRight">Construct a prom_histogram_t*. <a href="#ad42681e59e727f9e3d43bf0cdbba9a1b">More...</a><br /></td></tr> <tr class="separator:ad42681e59e727f9e3d43bf0cdbba9a1b"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:af9067b27e7ab2abd815af0614bb35357"><td class="memItemLeft" align="right" valign="top"><a id="af9067b27e7ab2abd815af0614bb35357"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram_8h.html#af9067b27e7ab2abd815af0614bb35357">prom_histogram_destroy</a> (<a class="el" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> *self)</td></tr> -<tr class="memdesc:af9067b27e7ab2abd815af0614bb35357"><td class="mdescLeft"> </td><td class="mdescRight">Destroys a pointer to a prom_gauge. <br /></td></tr> +<tr class="memitem:af9067b27e7ab2abd815af0614bb35357"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram_8h.html#af9067b27e7ab2abd815af0614bb35357">prom_histogram_destroy</a> (<a class="el" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> *self)</td></tr> +<tr class="memdesc:af9067b27e7ab2abd815af0614bb35357"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a prom_histogram_t*. <a href="#af9067b27e7ab2abd815af0614bb35357">More...</a><br /></td></tr> <tr class="separator:af9067b27e7ab2abd815af0614bb35357"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a274e4b869c7d9239e9f47b3898210fbe"><td class="memItemLeft" align="right" valign="top"><a id="a274e4b869c7d9239e9f47b3898210fbe"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram_8h.html#a274e4b869c7d9239e9f47b3898210fbe">prom_histogram_observe</a> (<a class="el" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> *self, double value, const char **label_values)</td></tr> -<tr class="memdesc:a274e4b869c7d9239e9f47b3898210fbe"><td class="mdescLeft"> </td><td class="mdescRight">Observe the prom_histogram_t given the value and labells. <br /></td></tr> +<tr class="memitem:a274e4b869c7d9239e9f47b3898210fbe"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram_8h.html#a274e4b869c7d9239e9f47b3898210fbe">prom_histogram_observe</a> (<a class="el" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> *self, double value, const char **label_values)</td></tr> +<tr class="memdesc:a274e4b869c7d9239e9f47b3898210fbe"><td class="mdescLeft"> </td><td class="mdescRight">Observe the prom_histogram_t given the value and labells. <a href="#a274e4b869c7d9239e9f47b3898210fbe">More...</a><br /></td></tr> <tr class="separator:a274e4b869c7d9239e9f47b3898210fbe"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> @@ -142,6 +139,138 @@ int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom_ </div> </div> +<h2 class="groupheader">Function Documentation</h2> +<a id="af9067b27e7ab2abd815af0614bb35357"></a> +<h2 class="memtitle"><span class="permalink"><a href="#af9067b27e7ab2abd815af0614bb35357">◆ </a></span>prom_histogram_destroy()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_histogram_destroy </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> * </td> + <td class="paramname"><em>self</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Destroy a prom_histogram_t*. </p> +<p>self MUSTS be set to NULL after destruction. Returns a non-zero integer value upon failure. </p><dl class="section return"><dt>Returns</dt><dd>Non-zero value upon failure. </dd></dl> + +</div> +</div> +<a id="ad42681e59e727f9e3d43bf0cdbba9a1b"></a> +<h2 class="memtitle"><span class="permalink"><a href="#ad42681e59e727f9e3d43bf0cdbba9a1b">◆ </a></span>prom_histogram_new()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a>* prom_histogram_new </td> + <td>(</td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>name</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char * </td> + <td class="paramname"><em>help</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype"><a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> * </td> + <td class="paramname"><em>buckets</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">size_t </td> + <td class="paramname"><em>label_key_count</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_keys</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Construct a prom_histogram_t*. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">name</td><td>The name of the metric </td></tr> + <tr><td class="paramname">help</td><td>The metric description </td></tr> + <tr><td class="paramname">buckets</td><td>The prom_histogram_buckets_t*. See <a class="el" href="prom__histogram__buckets_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram ">prom_histogram_buckets.h</a>. </td></tr> + <tr><td class="paramname">label_key_count</td><td>is the number of labels associated with the given metric. Pass 0 if the metric does not require labels. </td></tr> + <tr><td class="paramname">label_keys</td><td>A collection of label keys. The number of keys MUST match the value passed as label_key_count. If no labels are required, pass NULL. Otherwise, it may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The constructed prom_histogram_t*</dd></dl> +<p><em>Example</em> </p><pre class="fragment">// An example with labels +prom_histogram_buckets_t* buckets = prom_histogram_buckets_linear(5.0, 5.0, 10); +prom_histogram_new("foo", "foo is a counter with labels", buckets, 2, (const char**) { "one", "two" }); + +// An example without labels +prom_histogram_buckets_t* buckets = prom_histogram_buckets_linear(5.0, 5.0, 10); +prom_histogram_new("foo", "foo is a counter without labels", buckets, 0, NULL);</pre> +</div> +</div> +<a id="a274e4b869c7d9239e9f47b3898210fbe"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a274e4b869c7d9239e9f47b3898210fbe">◆ </a></span>prom_histogram_observe()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_histogram_observe </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">double </td> + <td class="paramname"><em>value</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">const char ** </td> + <td class="paramname"><em>label_values</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Observe the prom_histogram_t given the value and labells. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_histogram_t* </td></tr> + <tr><td class="paramname">value</td><td>The value to observe </td></tr> + <tr><td class="paramname">label_keys</td><td>A collection of label keys. The number of keys MUST match the value passed as label_key_count. If no labels are required, pass NULL. Otherwise, it may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Non-zero value upon failure </dd></dl> + +</div> +</div> </div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> diff --git a/docs/prom__histogram_8h__incl.map b/docs/prom__histogram_8h__incl.map index 2545fab..1f8df46 100644 --- a/docs/prom__histogram_8h__incl.map +++ b/docs/prom__histogram_8h__incl.map @@ -1,6 +1,6 @@ <map id="prom/include/prom_histogram.h" name="prom/include/prom_histogram.h"> -<area shape="rect" id="node3" href="$prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="129,80,246,107"/> -<area shape="rect" id="node6" href="$prom__histogram__buckets_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="269,80,468,107"/> -<area shape="rect" id="node4" href="$prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="5,162,177,189"/> -<area shape="rect" id="node5" href="$prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="202,155,362,196"/> +<area shape="rect" id="node3" href="$prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="244,80,361,107"/> +<area shape="rect" id="node6" href="$prom__histogram__buckets_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="22,80,220,107"/> +<area shape="rect" id="node4" href="$prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="164,162,336,189"/> +<area shape="rect" id="node5" href="$prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="361,155,521,196"/> </map> diff --git a/docs/prom__histogram_8h__incl.md5 b/docs/prom__histogram_8h__incl.md5 index 1d78a11..b4476c4 100644 --- a/docs/prom__histogram_8h__incl.md5 +++ b/docs/prom__histogram_8h__incl.md5 @@ -1 +1 @@ -0893892567367d17547f313ae7f76866
\ No newline at end of file +8e71a9dfac588d13bbc0b4c82756ff76
\ No newline at end of file diff --git a/docs/prom__histogram_8h__incl.png b/docs/prom__histogram_8h__incl.png Binary files differindex e0618ef..9399b3e 100644 --- a/docs/prom__histogram_8h__incl.png +++ b/docs/prom__histogram_8h__incl.png diff --git a/docs/prom__histogram_8h_source.html b/docs/prom__histogram_8h_source.html index 7816971..1a13ef8 100644 --- a/docs/prom__histogram_8h_source.html +++ b/docs/prom__histogram_8h_source.html @@ -68,11 +68,11 @@ $(function() { <div class="title">prom_histogram.h</div> </div> </div><!--header--> <div class="contents"> -<a href="prom__histogram_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_HISTOGRAM_INCLUDED</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_HISTOGRAM_INCLUDED</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <stdlib.h></span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="prom__histogram__buckets_8h.html">prom_histogram_buckets.h</a>"</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae"> 36</a></span> <span class="keyword">typedef</span> <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> <a class="code" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <a class="code" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a>* <a class="code" href="prom__histogram_8h.html#ad42681e59e727f9e3d43bf0cdbba9a1b">prom_histogram_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name,</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *help,</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *buckets,</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keywordtype">size_t</span> label_key_count,</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> **label_keys);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> </div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="keywordtype">int</span> <a class="code" href="prom__histogram_8h.html#af9067b27e7ab2abd815af0614bb35357">prom_histogram_destroy</a>(<a class="code" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="keywordtype">int</span> <a class="code" href="prom__histogram_8h.html#a274e4b869c7d9239e9f47b3898210fbe">prom_histogram_observe</a>(<a class="code" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="preprocessor">#endif // PROM_HISTOGRAM_INCLUDED</span></div><div class="ttc" id="prom__histogram_8h_html_af9067b27e7ab2abd815af0614bb35357"><div class="ttname"><a href="prom__histogram_8h.html#af9067b27e7ab2abd815af0614bb35357">prom_histogram_destroy</a></div><div class="ttdeci">int prom_histogram_destroy(prom_histogram_t *self)</div><div class="ttdoc">Destroys a pointer to a prom_gauge. </div></div> +<a href="prom__histogram_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_HISTOGRAM_INCLUDED</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_HISTOGRAM_INCLUDED</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <stdlib.h></span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "<a class="code" href="prom__metric_8h.html">prom_metric.h</a>"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include "<a class="code" href="prom__histogram__buckets_8h.html">prom_histogram_buckets.h</a>"</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae"> 36</a></span> <span class="keyword">typedef</span> <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> <a class="code" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a>;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <a class="code" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a>* <a class="code" href="prom__histogram_8h.html#ad42681e59e727f9e3d43bf0cdbba9a1b">prom_histogram_new</a>(<span class="keyword">const</span> <span class="keywordtype">char</span> *name,</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> *help,</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *buckets,</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keywordtype">size_t</span> label_key_count,</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> **label_keys);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="keywordtype">int</span> <a class="code" href="prom__histogram_8h.html#af9067b27e7ab2abd815af0614bb35357">prom_histogram_destroy</a>(<a class="code" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> </div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> <span class="keywordtype">int</span> <a class="code" href="prom__histogram_8h.html#a274e4b869c7d9239e9f47b3898210fbe">prom_histogram_observe</a>(<a class="code" href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> value, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span> </div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <span class="preprocessor">#endif // PROM_HISTOGRAM_INCLUDED</span></div><div class="ttc" id="prom__histogram_8h_html_af9067b27e7ab2abd815af0614bb35357"><div class="ttname"><a href="prom__histogram_8h.html#af9067b27e7ab2abd815af0614bb35357">prom_histogram_destroy</a></div><div class="ttdeci">int prom_histogram_destroy(prom_histogram_t *self)</div><div class="ttdoc">Destroy a prom_histogram_t*. </div></div> <div class="ttc" id="prom__metric_8h_html_afd1bd014c48955d6c2c36aa8a8cbb889"><div class="ttname"><a href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a></div><div class="ttdeci">struct prom_metric prom_metric_t</div><div class="ttdoc">A prometheus metric. </div><div class="ttdef"><b>Definition:</b> prom_metric.h:34</div></div> -<div class="ttc" id="structprom__histogram__buckets_html"><div class="ttname"><a href="structprom__histogram__buckets.html">prom_histogram_buckets</a></div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:25</div></div> +<div class="ttc" id="structprom__histogram__buckets_html"><div class="ttname"><a href="structprom__histogram__buckets.html">prom_histogram_buckets</a></div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:27</div></div> <div class="ttc" id="prom__histogram_8h_html_a8c061924368d41c161025bf3d3cde9ae"><div class="ttname"><a href="prom__histogram_8h.html#a8c061924368d41c161025bf3d3cde9ae">prom_histogram_t</a></div><div class="ttdeci">prom_metric_t prom_histogram_t</div><div class="ttdoc">A prometheus histogram. </div><div class="ttdef"><b>Definition:</b> prom_histogram.h:36</div></div> -<div class="ttc" id="prom__histogram_8h_html_ad42681e59e727f9e3d43bf0cdbba9a1b"><div class="ttname"><a href="prom__histogram_8h.html#ad42681e59e727f9e3d43bf0cdbba9a1b">prom_histogram_new</a></div><div class="ttdeci">prom_histogram_t * prom_histogram_new(const char *name, const char *help, prom_histogram_buckets_t *buckets, size_t label_key_count, const char **label_keys)</div><div class="ttdoc">Returns a pointer to a prom_histogram_t. </div></div> +<div class="ttc" id="prom__histogram_8h_html_ad42681e59e727f9e3d43bf0cdbba9a1b"><div class="ttname"><a href="prom__histogram_8h.html#ad42681e59e727f9e3d43bf0cdbba9a1b">prom_histogram_new</a></div><div class="ttdeci">prom_histogram_t * prom_histogram_new(const char *name, const char *help, prom_histogram_buckets_t *buckets, size_t label_key_count, const char **label_keys)</div><div class="ttdoc">Construct a prom_histogram_t*. </div></div> <div class="ttc" id="prom__metric_8h_html"><div class="ttname"><a href="prom__metric_8h.html">prom_metric.h</a></div><div class="ttdoc">Functions for retrieving metric samples from metrics given an ordered set of labels. </div></div> <div class="ttc" id="prom__histogram_8h_html_a274e4b869c7d9239e9f47b3898210fbe"><div class="ttname"><a href="prom__histogram_8h.html#a274e4b869c7d9239e9f47b3898210fbe">prom_histogram_observe</a></div><div class="ttdeci">int prom_histogram_observe(prom_histogram_t *self, double value, const char **label_values)</div><div class="ttdoc">Observe the prom_histogram_t given the value and labells. </div></div> <div class="ttc" id="prom__histogram__buckets_8h_html"><div class="ttname"><a href="prom__histogram__buckets_8h.html">prom_histogram_buckets.h</a></div><div class="ttdoc">https://prometheus.io/docs/concepts/metric_types/#histogram </div></div> diff --git a/docs/prom__histogram__buckets_8h.html b/docs/prom__histogram__buckets_8h.html index 8d94bd3..92ccb6d 100644 --- a/docs/prom__histogram__buckets_8h.html +++ b/docs/prom__histogram__buckets_8h.html @@ -76,7 +76,15 @@ $(function() { <p><a href="https://prometheus.io/docs/concepts/metric_types/#histogram">https://prometheus.io/docs/concepts/metric_types/#histogram</a> <a href="#details">More...</a></p> -<div class="textblock"><div class="dynheader"> +<div class="textblock"><code>#include "stdlib.h"</code><br /> +</div><div class="textblock"><div class="dynheader"> +Include dependency graph for prom_histogram_buckets.h:</div> +<div class="dyncontent"> +<div class="center"><img src="prom__histogram__buckets_8h__incl.png" border="0" usemap="#prom_2include_2prom__histogram__buckets_8h" alt=""/></div> +<map name="prom_2include_2prom__histogram__buckets_8h" id="prom_2include_2prom__histogram__buckets_8h"> +</map> +</div> +</div><div class="textblock"><div class="dynheader"> This graph shows which files directly or indirectly include this file:</div> <div class="dyncontent"> <div class="center"><img src="prom__histogram__buckets_8h__dep__incl.png" border="0" usemap="#prom_2include_2prom__histogram__buckets_8hdep" alt=""/></div> @@ -101,22 +109,20 @@ typedef struct <a class="el" href="structprom__histogram__buckets.html">prom_his </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> -<tr class="memitem:a03736e2fac21748bbfd80100bf9546c4"><td class="memItemLeft" align="right" valign="top"><a id="a03736e2fac21748bbfd80100bf9546c4"></a> -<a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> * </td><td class="memItemRight" valign="bottom"><b>prom_histogram_buckets_new</b> (size_t count, double bucket,...)</td></tr> +<tr class="memitem:a03736e2fac21748bbfd80100bf9546c4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram__buckets_8h.html#a03736e2fac21748bbfd80100bf9546c4">prom_histogram_buckets_new</a> (size_t count, double bucket,...)</td></tr> +<tr class="memdesc:a03736e2fac21748bbfd80100bf9546c4"><td class="mdescLeft"> </td><td class="mdescRight">Construct a prom_histogram_buckets_t*. <a href="#a03736e2fac21748bbfd80100bf9546c4">More...</a><br /></td></tr> <tr class="separator:a03736e2fac21748bbfd80100bf9546c4"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:aa1adc550bf8999a27f6a26769d6bfc72"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram__buckets_8h.html#aa1adc550bf8999a27f6a26769d6bfc72">prom_histogram_buckets_linear</a> (double start, double width, size_t count)</td></tr> -<tr class="memdesc:aa1adc550bf8999a27f6a26769d6bfc72"><td class="mdescLeft"> </td><td class="mdescRight">Create linear buckets. <a href="#aa1adc550bf8999a27f6a26769d6bfc72">More...</a><br /></td></tr> +<tr class="memdesc:aa1adc550bf8999a27f6a26769d6bfc72"><td class="mdescLeft"> </td><td class="mdescRight">Construct a linearly sized prom_histogram_buckets_t*. <a href="#aa1adc550bf8999a27f6a26769d6bfc72">More...</a><br /></td></tr> <tr class="separator:aa1adc550bf8999a27f6a26769d6bfc72"><td class="memSeparator" colspan="2"> </td></tr> <tr class="memitem:a164da4101785b6fa2a292a964c232f12"><td class="memItemLeft" align="right" valign="top"><a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> * </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram__buckets_8h.html#a164da4101785b6fa2a292a964c232f12">prom_histogram_buckets_exponential</a> (double start, double factor, size_t count)</td></tr> -<tr class="memdesc:a164da4101785b6fa2a292a964c232f12"><td class="mdescLeft"> </td><td class="mdescRight">Create linear buckets. <a href="#a164da4101785b6fa2a292a964c232f12">More...</a><br /></td></tr> +<tr class="memdesc:a164da4101785b6fa2a292a964c232f12"><td class="mdescLeft"> </td><td class="mdescRight">Construct an exponentially sized prom_histogram_buckets_t*. <a href="#a164da4101785b6fa2a292a964c232f12">More...</a><br /></td></tr> <tr class="separator:a164da4101785b6fa2a292a964c232f12"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a36bc3312f8f479bbd6eb92fa3b1a5033"><td class="memItemLeft" align="right" valign="top"><a id="a36bc3312f8f479bbd6eb92fa3b1a5033"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram__buckets_8h.html#a36bc3312f8f479bbd6eb92fa3b1a5033">prom_histogram_buckets_destroy</a> (<a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *self)</td></tr> -<tr class="memdesc:a36bc3312f8f479bbd6eb92fa3b1a5033"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a prom_histogram_buckets_t. <br /></td></tr> +<tr class="memitem:a36bc3312f8f479bbd6eb92fa3b1a5033"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram__buckets_8h.html#a36bc3312f8f479bbd6eb92fa3b1a5033">prom_histogram_buckets_destroy</a> (<a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *self)</td></tr> +<tr class="memdesc:a36bc3312f8f479bbd6eb92fa3b1a5033"><td class="mdescLeft"> </td><td class="mdescRight">Destroy a prom_histogram_buckets_t*. <a href="#a36bc3312f8f479bbd6eb92fa3b1a5033">More...</a><br /></td></tr> <tr class="separator:a36bc3312f8f479bbd6eb92fa3b1a5033"><td class="memSeparator" colspan="2"> </td></tr> -<tr class="memitem:a92158192cfe9a71a98dbb1d9adc8508a"><td class="memItemLeft" align="right" valign="top"><a id="a92158192cfe9a71a98dbb1d9adc8508a"></a> -size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram__buckets_8h.html#a92158192cfe9a71a98dbb1d9adc8508a">prom_histogram_buckets_count</a> (<a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *self)</td></tr> -<tr class="memdesc:a92158192cfe9a71a98dbb1d9adc8508a"><td class="mdescLeft"> </td><td class="mdescRight">Get the count of buckets. <br /></td></tr> +<tr class="memitem:a92158192cfe9a71a98dbb1d9adc8508a"><td class="memItemLeft" align="right" valign="top">size_t </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__histogram__buckets_8h.html#a92158192cfe9a71a98dbb1d9adc8508a">prom_histogram_buckets_count</a> (<a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *self)</td></tr> +<tr class="memdesc:a92158192cfe9a71a98dbb1d9adc8508a"><td class="mdescLeft"> </td><td class="mdescRight">Get the count of buckets. <a href="#a92158192cfe9a71a98dbb1d9adc8508a">More...</a><br /></td></tr> <tr class="separator:a92158192cfe9a71a98dbb1d9adc8508a"><td class="memSeparator" colspan="2"> </td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> @@ -129,6 +135,60 @@ Variables</h2></td></tr> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p><a href="https://prometheus.io/docs/concepts/metric_types/#histogram">https://prometheus.io/docs/concepts/metric_types/#histogram</a> </p> </div><h2 class="groupheader">Function Documentation</h2> +<a id="a92158192cfe9a71a98dbb1d9adc8508a"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a92158192cfe9a71a98dbb1d9adc8508a">◆ </a></span>prom_histogram_buckets_count()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">size_t prom_histogram_buckets_count </td> + <td>(</td> + <td class="paramtype"><a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> * </td> + <td class="paramname"><em>self</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Get the count of buckets. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_histogram_buckets_t* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The count of buckets </dd></dl> + +</div> +</div> +<a id="a36bc3312f8f479bbd6eb92fa3b1a5033"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a36bc3312f8f479bbd6eb92fa3b1a5033">◆ </a></span>prom_histogram_buckets_destroy()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_histogram_buckets_destroy </td> + <td>(</td> + <td class="paramtype"><a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> * </td> + <td class="paramname"><em>self</em></td><td>)</td> + <td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Destroy a prom_histogram_buckets_t*. </p> +<p>Self MUST be set to NULL after destruction. Returns a non-zero integer value upon failure. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_histogram_buckets_t* </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Non-zero integer value upon failure </dd></dl> + +</div> +</div> <a id="a164da4101785b6fa2a292a964c232f12"></a> <h2 class="memtitle"><span class="permalink"><a href="#a164da4101785b6fa2a292a964c232f12">◆ </a></span>prom_histogram_buckets_exponential()</h2> @@ -161,17 +221,16 @@ Variables</h2></td></tr> </table> </div><div class="memdoc"> -<p>Create linear buckets. </p> +<p>Construct an exponentially sized prom_histogram_buckets_t*. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> - <tr><td class="paramname">start</td><td>The first upper bound. The value MUST be greater than 0. </td></tr> + <tr><td class="paramname">start</td><td>The first inclusive upper bound. The value MUST be greater than 0. </td></tr> <tr><td class="paramname">factor</td><td>The factor to apply to the previous upper bound to produce the next upper bound. The value MUST be greater than 1. </td></tr> - <tr><td class="paramname">count</td><td>The total number of buckets. The final +Inf bucket is not counted and not included in the returned. The value MUST be greater than or equal to 1 array </td></tr> + <tr><td class="paramname">count</td><td>The total number of buckets. The final +Inf bucket is not counted and not included. The value MUST be greater than or equal to 1 </td></tr> </table> </dd> </dl> -<dl class="section return"><dt>Returns</dt><dd>The array of upper bounds represented as double values</dd></dl> -<p>The array returned MUST be freed </p> +<dl class="section return"><dt>Returns</dt><dd>The constructed prom_histogram_buckets_t* </dd></dl> </div> </div> @@ -207,17 +266,60 @@ Variables</h2></td></tr> </table> </div><div class="memdoc"> -<p>Create linear buckets. </p> +<p>Construct a linearly sized prom_histogram_buckets_t*. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">start</td><td>The first inclusive upper bound </td></tr> + <tr><td class="paramname">width</td><td>The distance between each upper bound </td></tr> + <tr><td class="paramname">count</td><td>The total number of buckets. The final +Inf bucket is not counted and not included. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>The constructed prom_histogram_buckets_t* </dd></dl> + +</div> +</div> +<a id="a03736e2fac21748bbfd80100bf9546c4"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a03736e2fac21748bbfd80100bf9546c4">◆ </a></span>prom_histogram_buckets_new()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname"><a class="el" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a>* prom_histogram_buckets_new </td> + <td>(</td> + <td class="paramtype">size_t </td> + <td class="paramname"><em>count</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">double </td> + <td class="paramname"><em>bucket</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype"> </td> + <td class="paramname"><em>...</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Construct a prom_histogram_buckets_t*. </p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> - <tr><td class="paramname">start</td><td>The first upper bound </td></tr> - <tr><td class="paramname">width</td><td>The distance between each upper bound in buckets </td></tr> - <tr><td class="paramname">count</td><td>The total number of buckets. The final +Inf bucket is not counted and not included in the returned array </td></tr> + <tr><td class="paramname">count</td><td>The number of buckets </td></tr> + <tr><td class="paramname">bucket</td><td>The first bucket. A variable number of bucket values may be passed. This quantity MUST equal the value passed as count. </td></tr> </table> </dd> </dl> -<dl class="section return"><dt>Returns</dt><dd>The array of upper bounds represented as double values</dd></dl> -<p>The Array returned MUST be freed </p> +<dl class="section return"><dt>Returns</dt><dd>The constructed prom_histogram_buckets_t* </dd></dl> </div> </div> diff --git a/docs/prom__histogram__buckets_8h__dep__incl.md5 b/docs/prom__histogram__buckets_8h__dep__incl.md5 index 772a8f9..665c1aa 100644 --- a/docs/prom__histogram__buckets_8h__dep__incl.md5 +++ b/docs/prom__histogram__buckets_8h__dep__incl.md5 @@ -1 +1 @@ -092e96abd0d6856400714b8a73b76ecc
\ No newline at end of file +f5608aeb0c9a1fbb7fbf92120d7fc33b
\ No newline at end of file diff --git a/docs/prom__histogram__buckets_8h__incl.map b/docs/prom__histogram__buckets_8h__incl.map new file mode 100644 index 0000000..d47adf5 --- /dev/null +++ b/docs/prom__histogram__buckets_8h__incl.map @@ -0,0 +1,2 @@ +<map id="prom/include/prom_histogram_buckets.h" name="prom/include/prom_histogram_buckets.h"> +</map> diff --git a/docs/prom__histogram__buckets_8h__incl.md5 b/docs/prom__histogram__buckets_8h__incl.md5 new file mode 100644 index 0000000..8b3dec0 --- /dev/null +++ b/docs/prom__histogram__buckets_8h__incl.md5 @@ -0,0 +1 @@ +0ecfca103c369c6b616b8deceeec2b88
\ No newline at end of file diff --git a/docs/prom__histogram__buckets_8h__incl.png b/docs/prom__histogram__buckets_8h__incl.png Binary files differnew file mode 100644 index 0000000..c54bf23 --- /dev/null +++ b/docs/prom__histogram__buckets_8h__incl.png diff --git a/docs/prom__histogram__buckets_8h_source.html b/docs/prom__histogram__buckets_8h_source.html index 68c13ef..a9727a7 100644 --- a/docs/prom__histogram__buckets_8h_source.html +++ b/docs/prom__histogram__buckets_8h_source.html @@ -68,14 +68,15 @@ $(function() { <div class="title">prom_histogram_buckets.h</div> </div> </div><!--header--> <div class="contents"> -<a href="prom__histogram__buckets_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_HISTOGRAM_BUCKETS_INCLUDED</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_HISTOGRAM_BUCKETS_INCLUDED</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"><a class="line" href="structprom__histogram__buckets.html"> 25</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets</a> {</div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621"> 26</a></span>  <span class="keywordtype">int</span> <a class="code" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">count</a>; </div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="structprom__histogram__buckets.html#a8abda07c4930e15a3dff8a86e3164344"> 27</a></span>  <span class="keyword">const</span> <span class="keywordtype">double</span> *<a class="code" href="structprom__histogram__buckets.html#a8abda07c4930e15a3dff8a86e3164344">upper_bounds</a>; </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> } <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a>;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a>* prom_histogram_buckets_new(<span class="keywordtype">size_t</span> <a class="code" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">count</a>, <span class="keywordtype">double</span> bucket, ...);</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="prom__histogram__buckets_8h.html#aa8d61c1abc355eb54173b27cb1b50a5d"> 35</a></span> <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *<a class="code" href="prom__histogram__buckets_8h.html#aa8d61c1abc355eb54173b27cb1b50a5d">prom_histogram_default_buckets</a>;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a>* <a class="code" href="prom__histogram__buckets_8h.html#aa1adc550bf8999a27f6a26769d6bfc72">prom_histogram_buckets_linear</a>(<span class="keywordtype">double</span> start, <span class="keywordtype">double</span> width, <span class="keywordtype">size_t</span> <a class="code" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">count</a>);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a>* <a class="code" href="prom__histogram__buckets_8h.html#a164da4101785b6fa2a292a964c232f12">prom_histogram_buckets_exponential</a>(<span class="keywordtype">double</span> start, <span class="keywordtype">double</span> factor, <span class="keywordtype">size_t</span> <a class="code" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">count</a>);</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> </div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="keywordtype">int</span> <a class="code" href="prom__histogram__buckets_8h.html#a36bc3312f8f479bbd6eb92fa3b1a5033">prom_histogram_buckets_destroy</a>(<a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> </div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="keywordtype">size_t</span> <a class="code" href="prom__histogram__buckets_8h.html#a92158192cfe9a71a98dbb1d9adc8508a">prom_histogram_buckets_count</a>(<a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> </div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> <span class="preprocessor">#endif // PROM_HISTOGRAM_BUCKETS_INCLUDED</span></div><div class="ttc" id="prom__histogram__buckets_8h_html_aa8d61c1abc355eb54173b27cb1b50a5d"><div class="ttname"><a href="prom__histogram__buckets_8h.html#aa8d61c1abc355eb54173b27cb1b50a5d">prom_histogram_default_buckets</a></div><div class="ttdeci">prom_histogram_buckets_t * prom_histogram_default_buckets</div><div class="ttdoc">the default histogram buckets: .005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10 </div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:35</div></div> -<div class="ttc" id="structprom__histogram__buckets_html_a9da20001e02d992cee82a09372061621"><div class="ttname"><a href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">prom_histogram_buckets::count</a></div><div class="ttdeci">int count</div><div class="ttdoc">Number of buckets. </div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:26</div></div> -<div class="ttc" id="structprom__histogram__buckets_html_a8abda07c4930e15a3dff8a86e3164344"><div class="ttname"><a href="structprom__histogram__buckets.html#a8abda07c4930e15a3dff8a86e3164344">prom_histogram_buckets::upper_bounds</a></div><div class="ttdeci">const double * upper_bounds</div><div class="ttdoc">The bucket values. </div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:27</div></div> +<a href="prom__histogram__buckets_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include "stdlib.h"</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#ifndef PROM_HISTOGRAM_BUCKETS_H</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#define PROM_HISTOGRAM_BUCKETS_H</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="structprom__histogram__buckets.html"> 27</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets</a> {</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621"> 28</a></span>  <span class="keywordtype">int</span> <a class="code" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">count</a>; </div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="structprom__histogram__buckets.html#a8abda07c4930e15a3dff8a86e3164344"> 29</a></span>  <span class="keyword">const</span> <span class="keywordtype">double</span> *<a class="code" href="structprom__histogram__buckets.html#a8abda07c4930e15a3dff8a86e3164344">upper_bounds</a>; </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> } <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a>* <a class="code" href="prom__histogram__buckets_8h.html#a03736e2fac21748bbfd80100bf9546c4">prom_histogram_buckets_new</a>(<span class="keywordtype">size_t</span> <a class="code" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">count</a>, <span class="keywordtype">double</span> bucket, ...);</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> </div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="prom__histogram__buckets_8h.html#aa8d61c1abc355eb54173b27cb1b50a5d"> 44</a></span> <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *<a class="code" href="prom__histogram__buckets_8h.html#aa8d61c1abc355eb54173b27cb1b50a5d">prom_histogram_default_buckets</a>;</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> </div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span> <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a>* <a class="code" href="prom__histogram__buckets_8h.html#aa1adc550bf8999a27f6a26769d6bfc72">prom_histogram_buckets_linear</a>(<span class="keywordtype">double</span> start, <span class="keywordtype">double</span> width, <span class="keywordtype">size_t</span> <a class="code" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">count</a>);</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a>* <a class="code" href="prom__histogram__buckets_8h.html#a164da4101785b6fa2a292a964c232f12">prom_histogram_buckets_exponential</a>(<span class="keywordtype">double</span> start, <span class="keywordtype">double</span> factor, <span class="keywordtype">size_t</span> <a class="code" href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">count</a>);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> </div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <span class="keywordtype">int</span> <a class="code" href="prom__histogram__buckets_8h.html#a36bc3312f8f479bbd6eb92fa3b1a5033">prom_histogram_buckets_destroy</a>(<a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="keywordtype">size_t</span> <a class="code" href="prom__histogram__buckets_8h.html#a92158192cfe9a71a98dbb1d9adc8508a">prom_histogram_buckets_count</a>(<a class="code" href="structprom__histogram__buckets.html">prom_histogram_buckets_t</a> *<span class="keyword">self</span>);</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span> <span class="preprocessor">#endif // PROM_HISTOGRAM_BUCKETS_H</span></div><div class="ttc" id="prom__histogram__buckets_8h_html_aa8d61c1abc355eb54173b27cb1b50a5d"><div class="ttname"><a href="prom__histogram__buckets_8h.html#aa8d61c1abc355eb54173b27cb1b50a5d">prom_histogram_default_buckets</a></div><div class="ttdeci">prom_histogram_buckets_t * prom_histogram_default_buckets</div><div class="ttdoc">the default histogram buckets: .005, .01, .025, .05, .1, .25, .5, 1, 2.5, 5, 10 </div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:44</div></div> +<div class="ttc" id="structprom__histogram__buckets_html_a9da20001e02d992cee82a09372061621"><div class="ttname"><a href="structprom__histogram__buckets.html#a9da20001e02d992cee82a09372061621">prom_histogram_buckets::count</a></div><div class="ttdeci">int count</div><div class="ttdoc">Number of buckets. </div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:28</div></div> +<div class="ttc" id="prom__histogram__buckets_8h_html_a03736e2fac21748bbfd80100bf9546c4"><div class="ttname"><a href="prom__histogram__buckets_8h.html#a03736e2fac21748bbfd80100bf9546c4">prom_histogram_buckets_new</a></div><div class="ttdeci">prom_histogram_buckets_t * prom_histogram_buckets_new(size_t count, double bucket,...)</div><div class="ttdoc">Construct a prom_histogram_buckets_t*. </div></div> +<div class="ttc" id="structprom__histogram__buckets_html_a8abda07c4930e15a3dff8a86e3164344"><div class="ttname"><a href="structprom__histogram__buckets.html#a8abda07c4930e15a3dff8a86e3164344">prom_histogram_buckets::upper_bounds</a></div><div class="ttdeci">const double * upper_bounds</div><div class="ttdoc">The bucket values. </div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:29</div></div> <div class="ttc" id="prom__histogram__buckets_8h_html_a92158192cfe9a71a98dbb1d9adc8508a"><div class="ttname"><a href="prom__histogram__buckets_8h.html#a92158192cfe9a71a98dbb1d9adc8508a">prom_histogram_buckets_count</a></div><div class="ttdeci">size_t prom_histogram_buckets_count(prom_histogram_buckets_t *self)</div><div class="ttdoc">Get the count of buckets. </div></div> -<div class="ttc" id="structprom__histogram__buckets_html"><div class="ttname"><a href="structprom__histogram__buckets.html">prom_histogram_buckets</a></div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:25</div></div> -<div class="ttc" id="prom__histogram__buckets_8h_html_a36bc3312f8f479bbd6eb92fa3b1a5033"><div class="ttname"><a href="prom__histogram__buckets_8h.html#a36bc3312f8f479bbd6eb92fa3b1a5033">prom_histogram_buckets_destroy</a></div><div class="ttdeci">int prom_histogram_buckets_destroy(prom_histogram_buckets_t *self)</div><div class="ttdoc">Destroy a prom_histogram_buckets_t. </div></div> -<div class="ttc" id="prom__histogram__buckets_8h_html_aa1adc550bf8999a27f6a26769d6bfc72"><div class="ttname"><a href="prom__histogram__buckets_8h.html#aa1adc550bf8999a27f6a26769d6bfc72">prom_histogram_buckets_linear</a></div><div class="ttdeci">prom_histogram_buckets_t * prom_histogram_buckets_linear(double start, double width, size_t count)</div><div class="ttdoc">Create linear buckets. </div></div> -<div class="ttc" id="prom__histogram__buckets_8h_html_a164da4101785b6fa2a292a964c232f12"><div class="ttname"><a href="prom__histogram__buckets_8h.html#a164da4101785b6fa2a292a964c232f12">prom_histogram_buckets_exponential</a></div><div class="ttdeci">prom_histogram_buckets_t * prom_histogram_buckets_exponential(double start, double factor, size_t count)</div><div class="ttdoc">Create linear buckets. </div></div> +<div class="ttc" id="structprom__histogram__buckets_html"><div class="ttname"><a href="structprom__histogram__buckets.html">prom_histogram_buckets</a></div><div class="ttdef"><b>Definition:</b> prom_histogram_buckets.h:27</div></div> +<div class="ttc" id="prom__histogram__buckets_8h_html_a36bc3312f8f479bbd6eb92fa3b1a5033"><div class="ttname"><a href="prom__histogram__buckets_8h.html#a36bc3312f8f479bbd6eb92fa3b1a5033">prom_histogram_buckets_destroy</a></div><div class="ttdeci">int prom_histogram_buckets_destroy(prom_histogram_buckets_t *self)</div><div class="ttdoc">Destroy a prom_histogram_buckets_t*. </div></div> +<div class="ttc" id="prom__histogram__buckets_8h_html_aa1adc550bf8999a27f6a26769d6bfc72"><div class="ttname"><a href="prom__histogram__buckets_8h.html#aa1adc550bf8999a27f6a26769d6bfc72">prom_histogram_buckets_linear</a></div><div class="ttdeci">prom_histogram_buckets_t * prom_histogram_buckets_linear(double start, double width, size_t count)</div><div class="ttdoc">Construct a linearly sized prom_histogram_buckets_t*. </div></div> +<div class="ttc" id="prom__histogram__buckets_8h_html_a164da4101785b6fa2a292a964c232f12"><div class="ttname"><a href="prom__histogram__buckets_8h.html#a164da4101785b6fa2a292a964c232f12">prom_histogram_buckets_exponential</a></div><div class="ttdeci">prom_histogram_buckets_t * prom_histogram_buckets_exponential(double start, double factor, size_t count)</div><div class="ttdoc">Construct an exponentially sized prom_histogram_buckets_t*. </div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> diff --git a/docs/prom__metric_8h.html b/docs/prom__metric_8h.html index 671569a..0d373f7 100644 --- a/docs/prom__metric_8h.html +++ b/docs/prom__metric_8h.html @@ -90,12 +90,13 @@ This graph shows which files directly or indirectly include this file:</div> <div class="dyncontent"> <div class="center"><img src="prom__metric_8h__dep__incl.png" border="0" usemap="#prom_2include_2prom__metric_8hdep" alt=""/></div> <map name="prom_2include_2prom__metric_8hdep" id="prom_2include_2prom__metric_8hdep"> -<area shape="rect" id="node2" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="5,80,224,107"/> -<area shape="rect" id="node3" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="304,244,461,271"/> -<area shape="rect" id="node4" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="67,155,275,196"/> -<area shape="rect" id="node5" href="prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="349,162,561,189"/> -<area shape="rect" id="node6" href="prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="585,162,789,189"/> -<area shape="rect" id="node7" href="prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="657,80,887,107"/> +<area shape="rect" id="node2" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="70,80,289,107"/> +<area shape="rect" id="node3" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="302,244,459,271"/> +<area shape="rect" id="node4" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="6,155,214,196"/> +<area shape="rect" id="node6" href="prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="339,162,551,189"/> +<area shape="rect" id="node7" href="prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="575,162,779,189"/> +<area shape="rect" id="node8" href="prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="636,80,867,107"/> +<area shape="rect" id="node5" href="promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="5,244,215,271"/> </map> </div> </div> @@ -165,7 +166,15 @@ Functions</h2></td></tr> <p>Returns a prom_metric_sample_t*. </p> <p>The order of label_values is significant.</p> -<p>You may use this function to cache metric samples to avoid sample lookup. Metric samples are stored in a hash map with O(1) lookups in average case; nonethless, caching metric samples and updating them directly might be preferrable in performance-sensitive situations. </p> +<p>You may use this function to cache metric samples to avoid sample lookup. Metric samples are stored in a hash map with O(1) lookups in average case; nonethless, caching metric samples and updating them directly might be preferrable in performance-sensitive situations.</p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_metric_t* </td></tr> + <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the counter's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>A prom_metric_sample_t* </dd></dl> </div> </div> @@ -197,7 +206,15 @@ Functions</h2></td></tr> <p>Returns a prom_metric_sample_histogram_t*. </p> <p>The order of label_values is significant.</p> -<p>You may use this function to cache metric samples to avoid sample lookup. Metric samples are stored in a hash map with O(1) lookups in average case; nonethless, caching metric samples and updating them directly might be preferrable in performance-sensitive situations. </p> +<p>You may use this function to cache metric samples to avoid sample lookup. Metric samples are stored in a hash map with O(1) lookups in average case; nonethless, caching metric samples and updating them directly might be preferrable in performance-sensitive situations.</p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_histogram_metric_t* </td></tr> + <tr><td class="paramname">label_values</td><td>The label values associated with the metric sample being updated. The number of labels must match the value passed to label_key_count in the counter's constructor. If no label values are necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>prom_metric_sample_histogram_t* </dd></dl> </div> </div> diff --git a/docs/prom__metric_8h__dep__incl.map b/docs/prom__metric_8h__dep__incl.map index 9b9085e..2e69242 100644 --- a/docs/prom__metric_8h__dep__incl.map +++ b/docs/prom__metric_8h__dep__incl.map @@ -1,8 +1,9 @@ <map id="prom/include/prom_metric.h" name="prom/include/prom_metric.h"> -<area shape="rect" id="node2" href="$prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="5,80,224,107"/> -<area shape="rect" id="node3" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="304,244,461,271"/> -<area shape="rect" id="node4" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="67,155,275,196"/> -<area shape="rect" id="node5" href="$prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="349,162,561,189"/> -<area shape="rect" id="node6" href="$prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="585,162,789,189"/> -<area shape="rect" id="node7" href="$prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="657,80,887,107"/> +<area shape="rect" id="node2" href="$prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="70,80,289,107"/> +<area shape="rect" id="node3" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="302,244,459,271"/> +<area shape="rect" id="node4" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="6,155,214,196"/> +<area shape="rect" id="node6" href="$prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="339,162,551,189"/> +<area shape="rect" id="node7" href="$prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="575,162,779,189"/> +<area shape="rect" id="node8" href="$prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="636,80,867,107"/> +<area shape="rect" id="node5" href="$promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="5,244,215,271"/> </map> diff --git a/docs/prom__metric_8h__dep__incl.md5 b/docs/prom__metric_8h__dep__incl.md5 index 6922bea..0397f55 100644 --- a/docs/prom__metric_8h__dep__incl.md5 +++ b/docs/prom__metric_8h__dep__incl.md5 @@ -1 +1 @@ -1ddbf7dc5b59aeeb4e6354d79efcf459
\ No newline at end of file +554bf5edce3fa4f27e05188b41f3f1b8
\ No newline at end of file diff --git a/docs/prom__metric_8h__dep__incl.png b/docs/prom__metric_8h__dep__incl.png Binary files differindex e7e18fb..b5f321d 100644 --- a/docs/prom__metric_8h__dep__incl.png +++ b/docs/prom__metric_8h__dep__incl.png diff --git a/docs/prom__metric_8h_source.html b/docs/prom__metric_8h_source.html index 15fec35..b2a8b0f 100644 --- a/docs/prom__metric_8h_source.html +++ b/docs/prom__metric_8h_source.html @@ -68,7 +68,7 @@ $(function() { <div class="title">prom_metric.h</div> </div> </div><!--header--> <div class="contents"> -<a href="prom__metric_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_METRIC_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_METRIC_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="prom__metric__sample_8h.html">prom_metric_sample.h</a>"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="prom__metric__sample__histogram_8h.html">prom_metric_sample_histogram.h</a>"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">struct </span>prom_metric;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889"> 34</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_metric <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a>;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a>* <a class="code" href="prom__metric_8h.html#a2c33d7e03b430a2903bf122fbeeb89de">prom_metric_sample_from_labels</a>(<a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> </div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> <a class="code" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a>* <a class="code" href="prom__metric_8h.html#a3b76680b4a7177eebc864f3b3be1e935">prom_metric_sample_histogram_from_labels</a>(<a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *<span class="keyword">self</span>,</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="preprocessor">#endif // PROM_METRIC_H</span></div><div class="ttc" id="prom__metric_8h_html_afd1bd014c48955d6c2c36aa8a8cbb889"><div class="ttname"><a href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a></div><div class="ttdeci">struct prom_metric prom_metric_t</div><div class="ttdoc">A prometheus metric. </div><div class="ttdef"><b>Definition:</b> prom_metric.h:34</div></div> +<a href="prom__metric_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_METRIC_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_METRIC_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include "<a class="code" href="prom__metric__sample_8h.html">prom_metric_sample.h</a>"</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include "<a class="code" href="prom__metric__sample__histogram_8h.html">prom_metric_sample_histogram.h</a>"</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> </div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="keyword">struct </span>prom_metric;</div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889"> 34</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_metric <a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a>;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a>* <a class="code" href="prom__metric_8h.html#a2c33d7e03b430a2903bf122fbeeb89de">prom_metric_sample_from_labels</a>(<a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *<span class="keyword">self</span>, <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <a class="code" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a>* <a class="code" href="prom__metric_8h.html#a3b76680b4a7177eebc864f3b3be1e935">prom_metric_sample_histogram_from_labels</a>(<a class="code" href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a> *<span class="keyword">self</span>,</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keyword">const</span> <span class="keywordtype">char</span> **label_values);</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> </div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> <span class="preprocessor">#endif // PROM_METRIC_H</span></div><div class="ttc" id="prom__metric_8h_html_afd1bd014c48955d6c2c36aa8a8cbb889"><div class="ttname"><a href="prom__metric_8h.html#afd1bd014c48955d6c2c36aa8a8cbb889">prom_metric_t</a></div><div class="ttdeci">struct prom_metric prom_metric_t</div><div class="ttdoc">A prometheus metric. </div><div class="ttdef"><b>Definition:</b> prom_metric.h:34</div></div> <div class="ttc" id="prom__metric__sample_8h_html"><div class="ttname"><a href="prom__metric__sample_8h.html">prom_metric_sample.h</a></div><div class="ttdoc">Functions for interfacting with metric samples directly. </div></div> <div class="ttc" id="prom__metric__sample__histogram_8h_html_aed3455bc4eec61a3d8f01e6c1af84f9f"><div class="ttname"><a href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a></div><div class="ttdeci">struct prom_metric_sample_histogram prom_metric_sample_histogram_t</div><div class="ttdoc">A histogram metric sample. </div><div class="ttdef"><b>Definition:</b> prom_metric_sample_histogram.h:29</div></div> <div class="ttc" id="prom__metric_8h_html_a3b76680b4a7177eebc864f3b3be1e935"><div class="ttname"><a href="prom__metric_8h.html#a3b76680b4a7177eebc864f3b3be1e935">prom_metric_sample_histogram_from_labels</a></div><div class="ttdeci">prom_metric_sample_histogram_t * prom_metric_sample_histogram_from_labels(prom_metric_t *self, const char **label_values)</div><div class="ttdoc">Returns a prom_metric_sample_histogram_t*. </div></div> diff --git a/docs/prom__metric__sample_8h.html b/docs/prom__metric__sample_8h.html index ea3b0c2..6fb7623 100644 --- a/docs/prom__metric__sample_8h.html +++ b/docs/prom__metric__sample_8h.html @@ -79,13 +79,14 @@ This graph shows which files directly or indirectly include this file:</div> <div class="dyncontent"> <div class="center"><img src="prom__metric__sample_8h__dep__incl.png" border="0" usemap="#prom_2include_2prom__metric__sample_8hdep" alt=""/></div> <map name="prom_2include_2prom__metric__sample_8hdep" id="prom_2include_2prom__metric__sample_8hdep"> -<area shape="rect" id="node2" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="351,95,558,121"/> -<area shape="rect" id="node4" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="376,333,533,360"/> -<area shape="rect" id="node3" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="5,169,224,196"/> -<area shape="rect" id="node5" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="67,244,275,285"/> -<area shape="rect" id="node6" href="prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="349,251,561,278"/> -<area shape="rect" id="node7" href="prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="585,251,789,278"/> -<area shape="rect" id="node8" href="prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="593,169,823,196"/> +<area shape="rect" id="node2" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="407,95,613,121"/> +<area shape="rect" id="node4" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="547,333,705,360"/> +<area shape="rect" id="node3" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="147,169,366,196"/> +<area shape="rect" id="node5" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="6,244,214,285"/> +<area shape="rect" id="node7" href="prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="288,251,500,278"/> +<area shape="rect" id="node8" href="prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="524,251,728,278"/> +<area shape="rect" id="node9" href="prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="548,169,779,196"/> +<area shape="rect" id="node6" href="promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="5,333,215,360"/> </map> </div> </div> @@ -140,7 +141,14 @@ Functions</h2></td></tr> </div><div class="memdoc"> <p>Add the r_value to the sample. </p> -<p>The value must be greater than or equal to zero. </p> +<p>The value must be greater than or equal to zero. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_metric_sample_t* </td></tr> + <tr><td class="paramname">r_value</td><td>The double to add to prom_metric_sample_t* provided by self </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Non-zero integer value upon failure </dd></dl> </div> </div> @@ -171,7 +179,14 @@ Functions</h2></td></tr> </div><div class="memdoc"> <p>Set the r_value of the sample. </p> -<p>This operation MUST be called on a sample derived from a gauge metric. </p> +<p>This operation MUST be called on a sample derived from a gauge metric. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_metric_sample_t* </td></tr> + <tr><td class="paramname">r_value</td><td>The double which will be set to the prom_metric_sample_t* provided by self </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Non-zero integer value upon failure </dd></dl> </div> </div> @@ -202,7 +217,14 @@ Functions</h2></td></tr> </div><div class="memdoc"> <p>Subtract the r_value from the sample. </p> -<p>This operation MUST be called a sample derived from a gauge metric. </p> +<p>This operation MUST be called a sample derived from a gauge metric. </p><dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_metric_sample_t* </td></tr> + <tr><td class="paramname">r_value</td><td>The double to subtract from the prom_metric_sample_t* provided by self </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Non-zero integer value upon failure </dd></dl> </div> </div> diff --git a/docs/prom__metric__sample_8h__dep__incl.map b/docs/prom__metric__sample_8h__dep__incl.map index 920a514..6fa7770 100644 --- a/docs/prom__metric__sample_8h__dep__incl.map +++ b/docs/prom__metric__sample_8h__dep__incl.map @@ -1,9 +1,10 @@ <map id="prom/include/prom_metric_sample.h" name="prom/include/prom_metric_sample.h"> -<area shape="rect" id="node2" href="$prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="351,95,558,121"/> -<area shape="rect" id="node4" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="376,333,533,360"/> -<area shape="rect" id="node3" href="$prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="5,169,224,196"/> -<area shape="rect" id="node5" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="67,244,275,285"/> -<area shape="rect" id="node6" href="$prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="349,251,561,278"/> -<area shape="rect" id="node7" href="$prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="585,251,789,278"/> -<area shape="rect" id="node8" href="$prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="593,169,823,196"/> +<area shape="rect" id="node2" href="$prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="407,95,613,121"/> +<area shape="rect" id="node4" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="547,333,705,360"/> +<area shape="rect" id="node3" href="$prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="147,169,366,196"/> +<area shape="rect" id="node5" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="6,244,214,285"/> +<area shape="rect" id="node7" href="$prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="288,251,500,278"/> +<area shape="rect" id="node8" href="$prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="524,251,728,278"/> +<area shape="rect" id="node9" href="$prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="548,169,779,196"/> +<area shape="rect" id="node6" href="$promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="5,333,215,360"/> </map> diff --git a/docs/prom__metric__sample_8h__dep__incl.md5 b/docs/prom__metric__sample_8h__dep__incl.md5 index 85d221a..a1b96d9 100644 --- a/docs/prom__metric__sample_8h__dep__incl.md5 +++ b/docs/prom__metric__sample_8h__dep__incl.md5 @@ -1 +1 @@ -58c240ed809da30c2febdf3cba575a28
\ No newline at end of file +654edc4d34421aacaf3050ba9af6bf75
\ No newline at end of file diff --git a/docs/prom__metric__sample_8h__dep__incl.png b/docs/prom__metric__sample_8h__dep__incl.png Binary files differindex a008327..ce6a3c8 100644 --- a/docs/prom__metric__sample_8h__dep__incl.png +++ b/docs/prom__metric__sample_8h__dep__incl.png diff --git a/docs/prom__metric__sample_8h_source.html b/docs/prom__metric__sample_8h_source.html index 572158a..1650a5c 100644 --- a/docs/prom__metric__sample_8h_source.html +++ b/docs/prom__metric__sample_8h_source.html @@ -68,7 +68,7 @@ $(function() { <div class="title">prom_metric_sample.h</div> </div> </div><!--header--> <div class="contents"> -<a href="prom__metric__sample_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_METRIC_SAMPLE_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_METRIC_SAMPLE_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keyword">struct </span>prom_metric_sample;</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a"> 30</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_metric_sample <a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">int</span> <a class="code" href="prom__metric__sample_8h.html#a3f8674d6c8ee2c27eb7504d602110daa">prom_metric_sample_add</a>(<a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value);</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="keywordtype">int</span> <a class="code" href="prom__metric__sample_8h.html#a1965caa1626c308bc1cb23995e90a0a7">prom_metric_sample_sub</a>(<a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value);</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="keywordtype">int</span> <a class="code" href="prom__metric__sample_8h.html#a0c5f0c66599282c2ee2c042ae4574db3">prom_metric_sample_set</a>(<a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> </div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> <span class="preprocessor">#endif // PROM_METRIC_SAMPLE_H</span></div><div class="ttc" id="prom__metric__sample_8h_html_a0fb9ff851bf9ee126756ae826a2ce72a"><div class="ttname"><a href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a></div><div class="ttdeci">struct prom_metric_sample prom_metric_sample_t</div><div class="ttdoc">Contains the specific metric and value given the name and label set Reference: https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels. </div><div class="ttdef"><b>Definition:</b> prom_metric_sample.h:30</div></div> +<a href="prom__metric__sample_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_METRIC_SAMPLE_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_METRIC_SAMPLE_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keyword">struct </span>prom_metric_sample;</div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a"> 30</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_metric_sample <a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="keywordtype">int</span> <a class="code" href="prom__metric__sample_8h.html#a3f8674d6c8ee2c27eb7504d602110daa">prom_metric_sample_add</a>(<a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value);</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> <span class="keywordtype">int</span> <a class="code" href="prom__metric__sample_8h.html#a1965caa1626c308bc1cb23995e90a0a7">prom_metric_sample_sub</a>(<a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> </div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> <span class="keywordtype">int</span> <a class="code" href="prom__metric__sample_8h.html#a0c5f0c66599282c2ee2c042ae4574db3">prom_metric_sample_set</a>(<a class="code" href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> r_value);</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> <span class="preprocessor">#endif // PROM_METRIC_SAMPLE_H</span></div><div class="ttc" id="prom__metric__sample_8h_html_a0fb9ff851bf9ee126756ae826a2ce72a"><div class="ttname"><a href="prom__metric__sample_8h.html#a0fb9ff851bf9ee126756ae826a2ce72a">prom_metric_sample_t</a></div><div class="ttdeci">struct prom_metric_sample prom_metric_sample_t</div><div class="ttdoc">Contains the specific metric and value given the name and label set Reference: https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels. </div><div class="ttdef"><b>Definition:</b> prom_metric_sample.h:30</div></div> <div class="ttc" id="prom__metric__sample_8h_html_a3f8674d6c8ee2c27eb7504d602110daa"><div class="ttname"><a href="prom__metric__sample_8h.html#a3f8674d6c8ee2c27eb7504d602110daa">prom_metric_sample_add</a></div><div class="ttdeci">int prom_metric_sample_add(prom_metric_sample_t *self, double r_value)</div><div class="ttdoc">Add the r_value to the sample. </div></div> <div class="ttc" id="prom__metric__sample_8h_html_a1965caa1626c308bc1cb23995e90a0a7"><div class="ttname"><a href="prom__metric__sample_8h.html#a1965caa1626c308bc1cb23995e90a0a7">prom_metric_sample_sub</a></div><div class="ttdeci">int prom_metric_sample_sub(prom_metric_sample_t *self, double r_value)</div><div class="ttdoc">Subtract the r_value from the sample. </div></div> <div class="ttc" id="prom__metric__sample_8h_html_a0c5f0c66599282c2ee2c042ae4574db3"><div class="ttname"><a href="prom__metric__sample_8h.html#a0c5f0c66599282c2ee2c042ae4574db3">prom_metric_sample_set</a></div><div class="ttdeci">int prom_metric_sample_set(prom_metric_sample_t *self, double r_value)</div><div class="ttdoc">Set the r_value of the sample. </div></div> diff --git a/docs/prom__metric__sample__histogram_8h.html b/docs/prom__metric__sample__histogram_8h.html index 930c173..22d8496 100644 --- a/docs/prom__metric__sample__histogram_8h.html +++ b/docs/prom__metric__sample__histogram_8h.html @@ -79,13 +79,14 @@ This graph shows which files directly or indirectly include this file:</div> <div class="dyncontent"> <div class="center"><img src="prom__metric__sample__histogram_8h__dep__incl.png" border="0" usemap="#prom_2include_2prom__metric__sample__histogram_8hdep" alt=""/></div> <map name="prom_2include_2prom__metric__sample__histogram_8hdep" id="prom_2include_2prom__metric__sample__histogram_8hdep"> -<area shape="rect" id="node2" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="351,95,558,121"/> -<area shape="rect" id="node4" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="376,333,533,360"/> -<area shape="rect" id="node3" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="5,169,224,196"/> -<area shape="rect" id="node5" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="67,244,275,285"/> -<area shape="rect" id="node6" href="prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="349,251,561,278"/> -<area shape="rect" id="node7" href="prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="585,251,789,278"/> -<area shape="rect" id="node8" href="prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="593,169,823,196"/> +<area shape="rect" id="node2" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="407,95,613,121"/> +<area shape="rect" id="node4" href="prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="547,333,705,360"/> +<area shape="rect" id="node3" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="147,169,366,196"/> +<area shape="rect" id="node5" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="6,244,214,285"/> +<area shape="rect" id="node7" href="prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="288,251,500,278"/> +<area shape="rect" id="node8" href="prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="524,251,728,278"/> +<area shape="rect" id="node9" href="prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="548,169,779,196"/> +<area shape="rect" id="node6" href="promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="5,333,215,360"/> </map> </div> </div> @@ -100,14 +101,52 @@ typedef struct prom_metric_sample_histogram </td><td class="memItemRight" v </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> -<tr class="memitem:a20a030bf6be56211c87c9feb520a3761"><td class="memItemLeft" align="right" valign="top"><a id="a20a030bf6be56211c87c9feb520a3761"></a> -int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__metric__sample__histogram_8h.html#a20a030bf6be56211c87c9feb520a3761">prom_metric_sample_histogram_observe</a> (<a class="el" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a> *self, double value)</td></tr> -<tr class="memdesc:a20a030bf6be56211c87c9feb520a3761"><td class="mdescLeft"> </td><td class="mdescRight">Observe the double for the given prom_metric_sample_histogram_observe_t. <br /></td></tr> +<tr class="memitem:a20a030bf6be56211c87c9feb520a3761"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="prom__metric__sample__histogram_8h.html#a20a030bf6be56211c87c9feb520a3761">prom_metric_sample_histogram_observe</a> (<a class="el" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a> *self, double value)</td></tr> +<tr class="memdesc:a20a030bf6be56211c87c9feb520a3761"><td class="mdescLeft"> </td><td class="mdescRight">Observe the double for the given prom_metric_sample_histogram_observe_t. <a href="#a20a030bf6be56211c87c9feb520a3761">More...</a><br /></td></tr> <tr class="separator:a20a030bf6be56211c87c9feb520a3761"><td class="memSeparator" colspan="2"> </td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> <div class="textblock"><p>Functions for interacting with histogram metric samples directly. </p> -</div></div><!-- contents --> +</div><h2 class="groupheader">Function Documentation</h2> +<a id="a20a030bf6be56211c87c9feb520a3761"></a> +<h2 class="memtitle"><span class="permalink"><a href="#a20a030bf6be56211c87c9feb520a3761">◆ </a></span>prom_metric_sample_histogram_observe()</h2> + +<div class="memitem"> +<div class="memproto"> + <table class="memname"> + <tr> + <td class="memname">int prom_metric_sample_histogram_observe </td> + <td>(</td> + <td class="paramtype"><a class="el" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a> * </td> + <td class="paramname"><em>self</em>, </td> + </tr> + <tr> + <td class="paramkey"></td> + <td></td> + <td class="paramtype">double </td> + <td class="paramname"><em>value</em> </td> + </tr> + <tr> + <td></td> + <td>)</td> + <td></td><td></td> + </tr> + </table> +</div><div class="memdoc"> + +<p>Observe the double for the given prom_metric_sample_histogram_observe_t. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">self</td><td>The target prom_metric_sample_histogram_t* </td></tr> + <tr><td class="paramname">value</td><td>The value to observe. </td></tr> + </table> + </dd> +</dl> +<dl class="section return"><dt>Returns</dt><dd>Non-zero integer value upon failure </dd></dl> + +</div> +</div> +</div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> Generated by  <a href="http://www.doxygen.org/index.html"> diff --git a/docs/prom__metric__sample__histogram_8h__dep__incl.map b/docs/prom__metric__sample__histogram_8h__dep__incl.map index 2364309..a1cf498 100644 --- a/docs/prom__metric__sample__histogram_8h__dep__incl.map +++ b/docs/prom__metric__sample__histogram_8h__dep__incl.map @@ -1,9 +1,10 @@ <map id="prom/include/prom_metric_sample_histogram.h" name="prom/include/prom_metric_sample_histogram.h"> -<area shape="rect" id="node2" href="$prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="351,95,558,121"/> -<area shape="rect" id="node4" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="376,333,533,360"/> -<area shape="rect" id="node3" href="$prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="5,169,224,196"/> -<area shape="rect" id="node5" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="67,244,275,285"/> -<area shape="rect" id="node6" href="$prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="349,251,561,278"/> -<area shape="rect" id="node7" href="$prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="585,251,789,278"/> -<area shape="rect" id="node8" href="$prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="593,169,823,196"/> +<area shape="rect" id="node2" href="$prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="407,95,613,121"/> +<area shape="rect" id="node4" href="$prom_8h.html" title="Include prom.h to include the entire public API. " alt="" coords="547,333,705,360"/> +<area shape="rect" id="node3" href="$prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="147,169,366,196"/> +<area shape="rect" id="node5" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="6,244,214,285"/> +<area shape="rect" id="node7" href="$prom__counter_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#counter " alt="" coords="288,251,500,278"/> +<area shape="rect" id="node8" href="$prom__gauge_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#gauge " alt="" coords="524,251,728,278"/> +<area shape="rect" id="node9" href="$prom__histogram_8h.html" title="https://prometheus.io/docs/concepts/metric_types/#histogram " alt="" coords="548,169,779,196"/> +<area shape="rect" id="node6" href="$promhttp_8h.html" title="Provides a HTTP endpoint for metric exposition References: " alt="" coords="5,333,215,360"/> </map> diff --git a/docs/prom__metric__sample__histogram_8h__dep__incl.md5 b/docs/prom__metric__sample__histogram_8h__dep__incl.md5 index 380671c..aa5b038 100644 --- a/docs/prom__metric__sample__histogram_8h__dep__incl.md5 +++ b/docs/prom__metric__sample__histogram_8h__dep__incl.md5 @@ -1 +1 @@ -e71a590ac9e5f5180968f7ebb44dc8b8
\ No newline at end of file +f8d476210371a4f4553c084b6f1bd334
\ No newline at end of file diff --git a/docs/prom__metric__sample__histogram_8h__dep__incl.png b/docs/prom__metric__sample__histogram_8h__dep__incl.png Binary files differindex b6f3a1d..9a82f20 100644 --- a/docs/prom__metric__sample__histogram_8h__dep__incl.png +++ b/docs/prom__metric__sample__histogram_8h__dep__incl.png diff --git a/docs/prom__metric__sample__histogram_8h_source.html b/docs/prom__metric__sample__histogram_8h_source.html index 6db0c21..0f302ca 100644 --- a/docs/prom__metric__sample__histogram_8h_source.html +++ b/docs/prom__metric__sample__histogram_8h_source.html @@ -68,7 +68,7 @@ $(function() { <div class="title">prom_metric_sample_histogram.h</div> </div> </div><!--header--> <div class="contents"> -<a href="prom__metric__sample__histogram_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_METRIC_SAMPLE_HISOTGRAM_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_METRIC_SAMPLE_HISOTGRAM_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keyword">struct </span>prom_metric_sample_histogram;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f"> 29</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_metric_sample_histogram <a class="code" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a>;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keywordtype">int</span> <a class="code" href="prom__metric__sample__histogram_8h.html#a20a030bf6be56211c87c9feb520a3761">prom_metric_sample_histogram_observe</a>(<a class="code" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> value);</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="preprocessor">#endif // PROM_METRIC_SAMPLE_HISOTGRAM_H</span></div><div class="ttc" id="prom__metric__sample__histogram_8h_html_a20a030bf6be56211c87c9feb520a3761"><div class="ttname"><a href="prom__metric__sample__histogram_8h.html#a20a030bf6be56211c87c9feb520a3761">prom_metric_sample_histogram_observe</a></div><div class="ttdeci">int prom_metric_sample_histogram_observe(prom_metric_sample_histogram_t *self, double value)</div><div class="ttdoc">Observe the double for the given prom_metric_sample_histogram_observe_t. </div></div> +<a href="prom__metric__sample__histogram_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment">you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment">You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment">limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">*/</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#ifndef PROM_METRIC_SAMPLE_HISOTGRAM_H</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="preprocessor">#define PROM_METRIC_SAMPLE_HISOTGRAM_H</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="keyword">struct </span>prom_metric_sample_histogram;</div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f"> 29</a></span> <span class="keyword">typedef</span> <span class="keyword">struct </span>prom_metric_sample_histogram <a class="code" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a>;</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">int</span> <a class="code" href="prom__metric__sample__histogram_8h.html#a20a030bf6be56211c87c9feb520a3761">prom_metric_sample_histogram_observe</a>(<a class="code" href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a> *<span class="keyword">self</span>, <span class="keywordtype">double</span> value);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="preprocessor">#endif // PROM_METRIC_SAMPLE_HISOTGRAM_H</span></div><div class="ttc" id="prom__metric__sample__histogram_8h_html_a20a030bf6be56211c87c9feb520a3761"><div class="ttname"><a href="prom__metric__sample__histogram_8h.html#a20a030bf6be56211c87c9feb520a3761">prom_metric_sample_histogram_observe</a></div><div class="ttdeci">int prom_metric_sample_histogram_observe(prom_metric_sample_histogram_t *self, double value)</div><div class="ttdoc">Observe the double for the given prom_metric_sample_histogram_observe_t. </div></div> <div class="ttc" id="prom__metric__sample__histogram_8h_html_aed3455bc4eec61a3d8f01e6c1af84f9f"><div class="ttname"><a href="prom__metric__sample__histogram_8h.html#aed3455bc4eec61a3d8f01e6c1af84f9f">prom_metric_sample_histogram_t</a></div><div class="ttdeci">struct prom_metric_sample_histogram prom_metric_sample_histogram_t</div><div class="ttdoc">A histogram metric sample. </div><div class="ttdef"><b>Definition:</b> prom_metric_sample_histogram.h:29</div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> diff --git a/docs/promhttp_8h.html b/docs/promhttp_8h.html index 1557e3a..d576011 100644 --- a/docs/promhttp_8h.html +++ b/docs/promhttp_8h.html @@ -75,11 +75,18 @@ $(function() { <a href="#details">More...</a></p> <div class="textblock"><code>#include <string.h></code><br /> <code>#include "microhttpd.h"</code><br /> +<code>#include "<a class="el" href="prom__collector__registry_8h_source.html">prom_collector_registry.h</a>"</code><br /> </div><div class="textblock"><div class="dynheader"> Include dependency graph for promhttp.h:</div> <div class="dyncontent"> <div class="center"><img src="promhttp_8h__incl.png" border="0" usemap="#promhttp_2include_2promhttp_8h" alt=""/></div> <map name="promhttp_2include_2promhttp_8h" id="promhttp_2include_2promhttp_8h"> +<area shape="rect" id="node4" href="prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="230,80,417,107"/> +<area shape="rect" id="node5" href="prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="207,155,338,181"/> +<area shape="rect" id="node7" href="prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="317,229,434,256"/> +<area shape="rect" id="node6" href="prom__map_8h_source.html" title="prom_map.h" alt="" coords="189,229,293,256"/> +<area shape="rect" id="node8" href="prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="195,311,367,338"/> +<area shape="rect" id="node9" href="prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="391,304,551,345"/> </map> </div> </div> @@ -118,7 +125,12 @@ Functions</h2></td></tr> </div><div class="memdoc"> <p>Sets the active registry for metric scraping. </p> -<p>If null is passed, the default registry is used. The registry MUST be initialized. </p> +<dl class="params"><dt>Parameters</dt><dd> + <table class="params"> + <tr><td class="paramname">active_registery</td><td>The target prom_collector_registry_t*. If null is passed, the default registry is used. The registry MUST be initialized. </td></tr> + </table> + </dd> +</dl> </div> </div> @@ -162,8 +174,9 @@ Functions</h2></td></tr> <p>Starts a daemon in the background and returns a pointer to an HMD_Daemon. </p> <p>References:</p><ul> -<li><a href="https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#microhttpd_002dinit">https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#microhttpd_002dinit</a> </li> +<li><a href="https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#microhttpd_002dinit">https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#microhttpd_002dinit</a></li> </ul> +<dl class="section return"><dt>Returns</dt><dd>struct MHD_Daemon* </dd></dl> </div> </div> diff --git a/docs/promhttp_8h__incl.map b/docs/promhttp_8h__incl.map index 3b1713f..3f9ccf5 100644 --- a/docs/promhttp_8h__incl.map +++ b/docs/promhttp_8h__incl.map @@ -1,2 +1,8 @@ <map id="promhttp/include/promhttp.h" name="promhttp/include/promhttp.h"> +<area shape="rect" id="node4" href="$prom__collector__registry_8h.html" title="The collector registry registers collectors for metric exposition. " alt="" coords="230,80,417,107"/> +<area shape="rect" id="node5" href="$prom__collector_8h.html" title="A Prometheus collector returns a collection of metrics. " alt="" coords="207,155,338,181"/> +<area shape="rect" id="node7" href="$prom__metric_8h.html" title="Functions for retrieving metric samples from metrics given an ordered set of labels. " alt="" coords="317,229,434,256"/> +<area shape="rect" id="node6" href="$prom__map_8h_source.html" title="prom_map.h" alt="" coords="189,229,293,256"/> +<area shape="rect" id="node8" href="$prom__metric__sample_8h.html" title="Functions for interfacting with metric samples directly. " alt="" coords="195,311,367,338"/> +<area shape="rect" id="node9" href="$prom__metric__sample__histogram_8h.html" title="Functions for interacting with histogram metric samples directly. " alt="" coords="391,304,551,345"/> </map> diff --git a/docs/promhttp_8h__incl.md5 b/docs/promhttp_8h__incl.md5 index 0413787..b65965d 100644 --- a/docs/promhttp_8h__incl.md5 +++ b/docs/promhttp_8h__incl.md5 @@ -1 +1 @@ -5a38f59371d33bb776e7c896334016d4
\ No newline at end of file +f65d4556f9e2275a8aa84805ddc5422e
\ No newline at end of file diff --git a/docs/promhttp_8h__incl.png b/docs/promhttp_8h__incl.png Binary files differindex fb575c5..ceaca65 100644 --- a/docs/promhttp_8h__incl.png +++ b/docs/promhttp_8h__incl.png diff --git a/docs/promhttp_8h_source.html b/docs/promhttp_8h_source.html index 0dfab52..b35db5e 100644 --- a/docs/promhttp_8h_source.html +++ b/docs/promhttp_8h_source.html @@ -68,9 +68,10 @@ $(function() { <div class="title">promhttp.h</div> </div> </div><!--header--> <div class="contents"> -<a href="promhttp_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> */</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <string.h></span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "microhttpd.h"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="keywordtype">void</span> <a class="code" href="promhttp_8h.html#a712a45634bc22724fef9bedcb2841e00">promhttp_set_active_collector_registry</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *active_registry);</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">struct </span>MHD_Daemon* <a class="code" href="promhttp_8h.html#a699ecc3aa11ed601269722f43da2823e">promhttp_start_daemon</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> flags,</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port,</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  MHD_AcceptPolicyCallback apc,</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordtype">void</span> *apc_cls);</div><div class="ttc" id="prom__collector__registry_8h_html_a20f07748401fbbde9efc8a718f9bc202"><div class="ttname"><a href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a></div><div class="ttdeci">struct prom_collector_registry prom_collector_registry_t</div><div class="ttdoc">A prom_registry_t is responsible for registering metrics and briding them to the string exposition fo...</div><div class="ttdef"><b>Definition:</b> prom_collector_registry.h:31</div></div> +<a href="promhttp_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> Copyright 2019 DigitalOcean Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"></span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> You may obtain a copy of the License at</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"></span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"></span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> limitations under the License.</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> */</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> </div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <string.h></span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> </div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include "microhttpd.h"</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include "<a class="code" href="prom__collector__registry_8h.html">prom_collector_registry.h</a>"</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keywordtype">void</span> <a class="code" href="promhttp_8h.html#a712a45634bc22724fef9bedcb2841e00">promhttp_set_active_collector_registry</a>(<a class="code" href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a> *active_registry);</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> </div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="keyword">struct </span>MHD_Daemon* <a class="code" href="promhttp_8h.html#a699ecc3aa11ed601269722f43da2823e">promhttp_start_daemon</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> flags,</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> port,</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  MHD_AcceptPolicyCallback apc,</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordtype">void</span> *apc_cls);</div><div class="ttc" id="prom__collector__registry_8h_html_a20f07748401fbbde9efc8a718f9bc202"><div class="ttname"><a href="prom__collector__registry_8h.html#a20f07748401fbbde9efc8a718f9bc202">prom_collector_registry_t</a></div><div class="ttdeci">struct prom_collector_registry prom_collector_registry_t</div><div class="ttdoc">A prom_registry_t is responsible for registering metrics and briding them to the string exposition fo...</div><div class="ttdef"><b>Definition:</b> prom_collector_registry.h:31</div></div> <div class="ttc" id="promhttp_8h_html_a712a45634bc22724fef9bedcb2841e00"><div class="ttname"><a href="promhttp_8h.html#a712a45634bc22724fef9bedcb2841e00">promhttp_set_active_collector_registry</a></div><div class="ttdeci">void promhttp_set_active_collector_registry(prom_collector_registry_t *active_registry)</div><div class="ttdoc">Sets the active registry for metric scraping. </div></div> <div class="ttc" id="promhttp_8h_html_a699ecc3aa11ed601269722f43da2823e"><div class="ttname"><a href="promhttp_8h.html#a699ecc3aa11ed601269722f43da2823e">promhttp_start_daemon</a></div><div class="ttdeci">struct MHD_Daemon * promhttp_start_daemon(unsigned int flags, unsigned short port, MHD_AcceptPolicyCallback apc, void *apc_cls)</div><div class="ttdoc">Starts a daemon in the background and returns a pointer to an HMD_Daemon. </div></div> +<div class="ttc" id="prom__collector__registry_8h_html"><div class="ttname"><a href="prom__collector__registry_8h.html">prom_collector_registry.h</a></div><div class="ttdoc">The collector registry registers collectors for metric exposition. </div></div> </div><!-- fragment --></div><!-- contents --> <!-- start footer part --> <hr class="footer"/><address class="footer"><small> diff --git a/docs/search/all_1.js b/docs/search/all_1.js index e2dd56c..9d5d65b 100644 --- a/docs/search/all_1.js +++ b/docs/search/all_1.js @@ -7,6 +7,7 @@ var searchData= ['prom_5fcollector_5fadd_5fmetric',['prom_collector_add_metric',['../prom__collector_8h.html#abd87021bd63f759d55642685a74874ee',1,'prom_collector.h']]], ['prom_5fcollector_5fdestroy',['prom_collector_destroy',['../prom__collector_8h.html#a037b72b2edb81a477999a7dfc08758c7',1,'prom_collector.h']]], ['prom_5fcollector_5fdestroy_5fgeneric',['prom_collector_destroy_generic',['../prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337',1,'prom_collector.h']]], + ['prom_5fcollector_5ffree_5fgeneric',['prom_collector_free_generic',['../prom__collector_8h.html#a875b72940cd578ee76c71f1f4853f139',1,'prom_collector.h']]], ['prom_5fcollector_5fnew',['prom_collector_new',['../prom__collector_8h.html#a4300cf33b6f8e4457df385c3d2a51a4b',1,'prom_collector.h']]], ['prom_5fcollector_5fprocess_5fnew',['prom_collector_process_new',['../prom__collector_8h.html#af50746bb4af87eda617fa08237e3834e',1,'prom_collector.h']]], ['prom_5fcollector_5fregistry_2eh',['prom_collector_registry.h',['../prom__collector__registry_8h.html',1,'']]], @@ -46,6 +47,7 @@ var searchData= ['prom_5fhistogram_5fbuckets_5fdestroy',['prom_histogram_buckets_destroy',['../prom__histogram__buckets_8h.html#a36bc3312f8f479bbd6eb92fa3b1a5033',1,'prom_histogram_buckets.h']]], ['prom_5fhistogram_5fbuckets_5fexponential',['prom_histogram_buckets_exponential',['../prom__histogram__buckets_8h.html#a164da4101785b6fa2a292a964c232f12',1,'prom_histogram_buckets.h']]], ['prom_5fhistogram_5fbuckets_5flinear',['prom_histogram_buckets_linear',['../prom__histogram__buckets_8h.html#aa1adc550bf8999a27f6a26769d6bfc72',1,'prom_histogram_buckets.h']]], + ['prom_5fhistogram_5fbuckets_5fnew',['prom_histogram_buckets_new',['../prom__histogram__buckets_8h.html#a03736e2fac21748bbfd80100bf9546c4',1,'prom_histogram_buckets.h']]], ['prom_5fhistogram_5fdefault_5fbuckets',['prom_histogram_default_buckets',['../prom__histogram__buckets_8h.html#aa8d61c1abc355eb54173b27cb1b50a5d',1,'prom_histogram_buckets.h']]], ['prom_5fhistogram_5fdestroy',['prom_histogram_destroy',['../prom__histogram_8h.html#af9067b27e7ab2abd815af0614bb35357',1,'prom_histogram.h']]], ['prom_5fhistogram_5fnew',['prom_histogram_new',['../prom__histogram_8h.html#ad42681e59e727f9e3d43bf0cdbba9a1b',1,'prom_histogram.h']]], diff --git a/docs/search/functions_0.js b/docs/search/functions_0.js index 4844d35..2a8fcb6 100644 --- a/docs/search/functions_0.js +++ b/docs/search/functions_0.js @@ -3,6 +3,7 @@ var searchData= ['prom_5fcollector_5fadd_5fmetric',['prom_collector_add_metric',['../prom__collector_8h.html#abd87021bd63f759d55642685a74874ee',1,'prom_collector.h']]], ['prom_5fcollector_5fdestroy',['prom_collector_destroy',['../prom__collector_8h.html#a037b72b2edb81a477999a7dfc08758c7',1,'prom_collector.h']]], ['prom_5fcollector_5fdestroy_5fgeneric',['prom_collector_destroy_generic',['../prom__collector_8h.html#a12c297cce0a30ee4149f2b486d9f0337',1,'prom_collector.h']]], + ['prom_5fcollector_5ffree_5fgeneric',['prom_collector_free_generic',['../prom__collector_8h.html#a875b72940cd578ee76c71f1f4853f139',1,'prom_collector.h']]], ['prom_5fcollector_5fnew',['prom_collector_new',['../prom__collector_8h.html#a4300cf33b6f8e4457df385c3d2a51a4b',1,'prom_collector.h']]], ['prom_5fcollector_5fprocess_5fnew',['prom_collector_process_new',['../prom__collector_8h.html#af50746bb4af87eda617fa08237e3834e',1,'prom_collector.h']]], ['prom_5fcollector_5fregistry_5fbridge',['prom_collector_registry_bridge',['../prom__collector__registry_8h.html#a0149a2702ae0b3ff39d57904d613c14f',1,'prom_collector_registry.h']]], @@ -30,6 +31,7 @@ var searchData= ['prom_5fhistogram_5fbuckets_5fdestroy',['prom_histogram_buckets_destroy',['../prom__histogram__buckets_8h.html#a36bc3312f8f479bbd6eb92fa3b1a5033',1,'prom_histogram_buckets.h']]], ['prom_5fhistogram_5fbuckets_5fexponential',['prom_histogram_buckets_exponential',['../prom__histogram__buckets_8h.html#a164da4101785b6fa2a292a964c232f12',1,'prom_histogram_buckets.h']]], ['prom_5fhistogram_5fbuckets_5flinear',['prom_histogram_buckets_linear',['../prom__histogram__buckets_8h.html#aa1adc550bf8999a27f6a26769d6bfc72',1,'prom_histogram_buckets.h']]], + ['prom_5fhistogram_5fbuckets_5fnew',['prom_histogram_buckets_new',['../prom__histogram__buckets_8h.html#a03736e2fac21748bbfd80100bf9546c4',1,'prom_histogram_buckets.h']]], ['prom_5fhistogram_5fdestroy',['prom_histogram_destroy',['../prom__histogram_8h.html#af9067b27e7ab2abd815af0614bb35357',1,'prom_histogram.h']]], ['prom_5fhistogram_5fnew',['prom_histogram_new',['../prom__histogram_8h.html#ad42681e59e727f9e3d43bf0cdbba9a1b',1,'prom_histogram.h']]], ['prom_5fhistogram_5fobserve',['prom_histogram_observe',['../prom__histogram_8h.html#a274e4b869c7d9239e9f47b3898210fbe',1,'prom_histogram.h']]], diff --git a/prom/include/prom_collector.h b/prom/include/prom_collector.h index 0fc2a27..5a1e2ba 100644 --- a/prom/include/prom_collector.h +++ b/prom/include/prom_collector.h @@ -35,44 +35,65 @@ typedef struct prom_collector prom_collector_t; * @brief The function responsible for preparing metric data and returning metrics for a given collector. * * If you use the default collector registry, this should not concern you. If you are using a custom collector, you may - * which to set this function on your collector to do additional work before returning the contained metrics. + * set this function on your collector to do additional work before returning the contained metrics. + * + * @param self The target prom_collector_t* + * @return The prom_map_t* containing the collected metrics */ typedef prom_map_t* prom_collect_fn(prom_collector_t* self); /** * @brief Create a collector + * @param name The name of the collector. The name MUST NOT be default or process. + * @return The constructed prom_collector_t* */ prom_collector_t* prom_collector_new(const char *name); /** - * @brief Return a collector including the default process metrics - * @param limits_path Pass NULL to discover the path to the proc/[pid]/limits file associated with process ID assigned - * by the host environment. Otherwise, pass a string to said path. - * @param stat_path Pass NULL to discover the path to the proc/[pid]/stat file associated with process ID assigned - * by the host environment. Otherwise, pass a string to said path. + *@brief Construct a prom_collector_t* which includes the default process metrics + * @param limits_path Pass NULL to discover the path to the /proc/[pid]/limits file associated with process ID assigned + * by the host environment. Otherwise, pass a string to said path. + * @param stat_path Pass NULL to discover the path to the /proc/[pid]/stat file associated with process ID assigned + * by the host environment. Otherwise, pass a string to said path. + * @return The constructed prom_collector_t* */ prom_collector_t* prom_collector_process_new(const char *limits_path, const char *stat_path); /** - * @brief Destroy a collector + * @brief Destroy a collector. You MUST set self to NULL after destruction. + * @param self The target prom_collector_t* + * @return A non-zero integer value upon failure. */ int prom_collector_destroy(prom_collector_t *self); +/** + * @brief Frees a collector passed as a void pointer. You MUST set self to NULL after destruction. + * @param gen The target prom_collector_t* represented as a void* + */ void prom_collector_free_generic(void *gen); /** - * @brief Destroy a collector + * @brief Destroys a collector passed as a void pointer. You MUST set self to NULL after destruction. + * @param gen The target prom_collector_t* represented as a void* + * @return A non-zero integer value upon failure. */ int prom_collector_destroy_generic(void *gen); /** * @brief Add a metric to a collector + * @param self The target prom_collector_t* + * @param metric the prom_metric_t* to add to the prom_collector_t* passed as self. + * @return A non-zero integer value upon failure. */ int prom_collector_add_metric(prom_collector_t *self, prom_metric_t *metric); /** * @brief The collect function is responsible for doing any work involving a set of metrics and then returning them - * for metric exposition + * for metric exposition. + * @param self The target prom_collector_t* + * @param fn The prom_collect_fn* which will be responsible for handling any metric collection operations before + * returning the collected metrics for exposition. + * @return A non-zero integer value upon failure. */ int prom_collector_set_collect_fn(prom_collector_t *self, prom_collect_fn *fn); diff --git a/prom/include/prom_collector_registry.h b/prom/include/prom_collector_registry.h index 3952cd7..8e70c92 100644 --- a/prom/include/prom_collector_registry.h +++ b/prom/include/prom_collector_registry.h @@ -38,56 +38,84 @@ prom_collector_registry_t *PROM_COLLECTOR_REGISTRY_DEFAULT; /** * @brief Initializes the default collector registry and enables metric collection on the executing process + * @return A non-zero integer value upon failure */ int prom_collector_registry_default_init(void); /** - * @brief Return a new collector registry + * @brief Constructs a prom_collector_registry_t* + * @param name The name of the collector registry. It MUST NOT be default. + * @return The constructed prom_collector_registry_t* */ prom_collector_registry_t* prom_collector_registry_new(const char *name); /** - * @brief Destroy a collector registry + * @brief Destroy a collector registry. You MUST set self to NULL after destruction. + * @param self The target prom_collector_registry_t* + * @return A non-zero integer value upon failure */ int prom_collector_registry_destroy(prom_collector_registry_t *self); /** - * @brief Enable process metrics on the given collector registry. + * @brief Enable process metrics on the given collector registry + * @param self The target prom_collector_registry_t* + * @return A non-zero integer value upon failure */ int prom_collector_registry_enable_process_metrics(prom_collector_registry_t *self); /** * @brief Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY * - * The metric to be registered MUST NOT already be registered with the given metric. If so, the program will + * The metric to be registered MUST NOT already be registered with the given . If so, the program will * halt. It returns a prom_metric_t* to simplify metric creation and registration. Furthermore, * PROM_DEFAULT_COLLECTOR_REGISTRY must be registered via prom_collector_registry_default_init() prior to calling this * function. The metric will be added to the default registry's default collector. + * + * @param metric The metric to register on PROM_DEFAULT_COLLECTOR_REGISTRY* + * @return The registered prom_metric_t* */ prom_metric_t* prom_collector_registry_must_register_metric(prom_metric_t *metric); /** - * @brief Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. Returns an error on failure. + * @brief Registers a metric with the default collector on PROM_DEFAULT_COLLECTOR_REGISTRY. Returns an non-zero integer + * value on failure. + * * See prom_collector_registry_must_register_metric. + * + * @param metric The metric to register on PROM_DEFAULT_COLLECTOR_REGISTRY* + * @return A non-zero integer value upon failure */ int prom_collector_registry_register_metric(prom_metric_t *metric); /** - * @brief Register a collector with the given registry. Returns an error on failure. + * @brief Register a collector with the given registry. Returns a non-zero integer value on failure. + * @param self The target prom_collector_registry_t* + * @param collector The prom_collector_t* to register onto the prom_collector_registry_t* as self + * @return A non-zero integer value upon failure */ int prom_collector_registry_register_collector(prom_collector_registry_t *self, prom_collector_t *collector); /** - * @brief Returns a string in the default metric exposition format + * @brief Returns a string in the default metric exposition format. The string MUST be freed to avoid unnecessary heap + * memory growth. * * Reference: https://prometheus.io/docs/instrumenting/exposition_formats/ + * + * @param self The target prom_collector_registry_t* + * @return The string int he default metric exposition format. */ const char* prom_collector_registry_bridge(prom_collector_registry_t *self); /** - * @brief Validates that the given metric name complies with the specification: + *@brief Validates that the given metric name complies with the specification: * * Reference: https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels + * + * Returns a non-zero integer value on failure. + * + * @param self The target prom_collector_registry_t* + * @param metric_name The metric name to validate + * @return A non-zero integer value upon failure */ int prom_collector_registry_validate_metric_name(prom_collector_registry_t *self, const char *metric_name); diff --git a/prom/include/prom_counter.h b/prom/include/prom_counter.h index 0728780..cb3ca32 100644 --- a/prom/include/prom_counter.h +++ b/prom/include/prom_counter.h @@ -15,8 +15,8 @@ limitations under the License. */ -#ifndef PROM_COUNTER_INCLUDED -#define PROM_COUNTER_INCLUDED +#ifndef PROM_COUNTER_H +#define PROM_COUNTER_H #include <stdlib.h> @@ -36,7 +36,23 @@ limitations under the License. typedef prom_metric_t prom_counter_t; /** - * @brief Returns a pointer to a prom_counter + * @brief Construct a prom_counter_t* + * @param name The name of the metric + * @param help The metric description + * @param label_key_count The number of labels associated with the given metric. Pass 0 if the metric does not + * require labels. + * @param label_keys A collection of label keys. The number of keys MUST match the value passed as label_key_count. If + * no labels are required, pass NULL. Otherwise, it may be convenient to pass this value as a + * literal. + * @return The constructed prom_counter_t* + * + * *Example* + * + * // An example with labels + * prom_counter_new("foo", "foo is a counter with labels", 2, (const char**) { "one", "two" }); + * + * // An example without labels + * prom_counter_new("foo", "foo is a counter without labels", 0, NULL); */ prom_counter_t* prom_counter_new(const char *name, const char *help, @@ -44,20 +60,50 @@ prom_counter_t* prom_counter_new(const char *name, const char **label_keys); /** - * @brief Destroys a pointer to a prom_counter + * @brief Destroys a prom_counter_t*. You must set self to NULL after destruction. A non-zero integer value will be + * returned on failure. + * @param self A prom_counter_t* + * @return A non-zero integer value upon failure. */ int prom_counter_destroy(prom_counter_t *self); /** - * @brief Increment the prom_counter by 1 + * @brief Increment the prom_counter_t by 1. A non-zero integer value will be returned on failure. + * @param self The target prom_counter_t* + * @param label_values The label values associated with the metric sample being updated. The number of labels must + * match the value passed to label_key_count in the counter's constructor. If no label values are + * necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. + * @return A non-zero integer value upon failure. + * + * *Example* + * + * // An example with labels + * prom_counter_inc(foo_counter, (const char**) { "bar", "bang" }); + ** + * // An example without labels + * prom_counter_inc(foo_counter, NULL); */ int prom_counter_inc(prom_counter_t *self, const char **label_values); /** - * @brief Add the value to the prom_counter + * @brief Add the value to the prom_counter_t*. A non-zero integer value will be returned on failure. + * @param self The target prom_counter_t* + * @param r_value The double to add to the prom_counter_t passed as self. The value MUST be greater than or equal to 0. + * @param label_values The label values associated with the metric sample being updated. The number of labels must + * match the value passed to label_key_count in the counter's constructor. If no label values are + * necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. + * @return A non-zero integer value upon failure. + * + * *Example* + * + * // An example with labels + * prom_counter_add(foo_counter, 22, (const char**) { "bar", "bang" }); + * + * // An example without labels + * prom_counter_add(foo_counter, 22, NULL); */ int prom_counter_add(prom_counter_t *self, double r_value, const char **label_values); -#endif // PROM_COUNTER_INCLUDED
\ No newline at end of file +#endif // PROM_COUNTER_H
\ No newline at end of file diff --git a/prom/include/prom_gauge.h b/prom/include/prom_gauge.h index 8ff1b74..e944b72 100644 --- a/prom/include/prom_gauge.h +++ b/prom/include/prom_gauge.h @@ -19,8 +19,8 @@ limitations under the License. * @brief https://prometheus.io/docs/concepts/metric_types/#gauge */ -#ifndef PROM_GAUGE_INCLUDED -#define PROM_GAUGE_INCLUDED +#ifndef PROM_GAUGE_H +#define PROM_GAUGE_H #include <stdlib.h> @@ -35,7 +35,21 @@ limitations under the License. typedef prom_metric_t prom_gauge_t; /** - * @brief Returns a pointer to a prom_gauge + * @brief Constructs a prom_gauge_t* + * @param name The name of the metric + * @param help The metric description + * @param label_key_count The number of labels associated with the given metric. Pass 0 if the metric does not + * require labels. + * @param label_keys A collection of label keys. The number of keys MUST match the value passed as label_key_count. If + * no labels are required, pass NULL. Otherwise, it may be convenient to pass this value as a + * literal. + * @return The constructed prom_guage_t* + * + * // An example with labels + * prom_gauge_new("foo", "foo is a gauge with labels", 2, (const char**) { "one", "two" }); + * + * // An example without labels + * prom_gauge_new("foo", "foo is a gauge without labels", 0, NULL); */ prom_gauge_t* prom_gauge_new(const char *name, const char *help, @@ -43,38 +57,107 @@ prom_gauge_t* prom_gauge_new(const char *name, const char **label_keys); /** - * @brief Destroys a pointer to a prom_gauge + * @brief Destroys a prom_gauge_t*. You must set self to NULL after destruction. A non-zero integer value will be + * returned on failure. + * @param self The target prom_gauge_t* + * @return A non-zero integer value upon failure */ int prom_gauge_destroy(prom_gauge_t *self); /** - * @brief Increment the prom_gauge by 1 + * @brief Increment the prom_gauge_t* by 1. + * @param self The target prom_gauger_t* + * @param label_values The label values associated with the metric sample being updated. The number of labels must + * match the value passed to label_key_count in the gauge's constructor. If no label values are + * necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. + * @return A non-zero integer value upon failure + * *Example* + * + * // An example with labels + * prom_gauge_inc(foo_gauge, (const char**) { "bar", "bang" }); + * + * // An example without labels + * prom_gauge_inc(foo_gauge, NULL); */ int prom_gauge_inc(prom_gauge_t *self, const char **label_values); /** - * @brief Descrement the prom_gauge by 1 + * @brief Decrement the prom_gauge_t* by 1. + * @param self The target prom_gauger_t* + * @param label_values The label values associated with the metric sample being updated. The number of labels must + * match the value passed to label_key_count in the gauge's constructor. If no label values are + * necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. + * @return A non-zero integer value upon failure. + * *Example* + * + * // An example with labels + * prom_gauge_dec(foo_gauge, (const char**) { "bar", "bang" }); + * + * // An example without labels + * prom_gauge_dec(foo_gauge, NULL); */ int prom_gauge_dec(prom_gauge_t *self, const char **label_values); /** - * @brief Add the value to the prom_gauge + * @brief Add the value to the prom_gauge_t*. + * @param self The target prom_gauge_t* + * @param r_value The double to add to the prom_gauge_t passed as self. + * @param label_values The label values associated with the metric sample being updated. The number of labels must + * match the value passed to label_key_count in the gauge's constructor. If no label values are + * necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. + * @return A non-zero integer value upon failure. + * + * *Example* + * + * // An example with labels + * prom_gauge_add(foo_gauge 22, (const char**) { "bar", "bang" }); + * + * // An example without labels + * prom_gauge_add(foo_gauge, 22, NULL); */ int prom_gauge_add(prom_gauge_t *self, double r_value, const char **label_values); /** - * @brief Subtract the value from the prom_gauge + * @brief Subtract the value to the prom_gauge. A non-zero integer value will be returned on failure. + * @param self The target prom_gauge_t* + * @param r_value The double to add to the prom_gauge_t passed as self. + * @param label_values The label values associated with the metric sample being updated. The number of labels must + * match the value passed to label_key_count in the gauge's constructor. If no label values are + * necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. + * @return A non-zero integer value upon failure. + * + * *Example* + * + * // An example with labels + * prom_gauge_sub(foo_gauge 22, (const char**) { "bar", "bang" }); + * + * // An example without labels + * prom_gauge_sub(foo_gauge, 22, NULL); */ int prom_gauge_sub(prom_gauge_t *self, double r_value, const char **label_values); /** - * @brief Set the value for the prom_gauge + * @brief Set the value for the prom_gauge_t* + * @param self The target prom_gauge_t* + * @param r_value The double to which the prom_gauge_t* passed as self will be set + * @param label_values The label values associated with the metric sample being updated. The number of labels must + * match the value passed to label_key_count in the gauge's constructor. If no label values are + * necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. + * @return A non-zero integer value upon failure. + * + * *Example* + * + * // An example with labels + * prom_gauge_set(foo_gauge 22, (const char**) { "bar", "bang" }); + * + * // An example without labels + * prom_gauge_set(foo_gauge, 22, NULL); */ int prom_gauge_set(prom_gauge_t *self, double r_value, const char **label_values); -#endif // PROM_GAUGE_INCLUDED +#endif // PROM_GAUGE_H diff --git a/prom/include/prom_histogram.h b/prom/include/prom_histogram.h index 0436048..74962b3 100644 --- a/prom/include/prom_histogram.h +++ b/prom/include/prom_histogram.h @@ -36,7 +36,26 @@ limitations under the License. typedef prom_metric_t prom_histogram_t; /** - * @brief Returns a pointer to a prom_histogram_t + *@brief Construct a prom_histogram_t* + * @param name The name of the metric + * @param help The metric description + * @param buckets The prom_histogram_buckets_t*. See prom_histogram_buckets.h. + * @param label_key_count is the number of labels associated with the given metric. Pass 0 if the metric does not + * require labels. + * @param label_keys A collection of label keys. The number of keys MUST match the value passed as label_key_count. If + * no labels are required, pass NULL. Otherwise, it may be convenient to pass this value as a + * literal. + * @return The constructed prom_histogram_t* + * + * *Example* + * + * // An example with labels + * prom_histogram_buckets_t* buckets = prom_histogram_buckets_linear(5.0, 5.0, 10); + * prom_histogram_new("foo", "foo is a counter with labels", buckets, 2, (const char**) { "one", "two" }); + * + * // An example without labels + * prom_histogram_buckets_t* buckets = prom_histogram_buckets_linear(5.0, 5.0, 10); + * prom_histogram_new("foo", "foo is a counter without labels", buckets, 0, NULL); */ prom_histogram_t* prom_histogram_new(const char *name, const char *help, @@ -45,13 +64,21 @@ prom_histogram_t* prom_histogram_new(const char *name, const char **label_keys); /** - * @brief Destroys a pointer to a prom_gauge + * @brief Destroy a prom_histogram_t*. self MUSTS be set to NULL after destruction. Returns a non-zero integer value + * upon failure. + * @return Non-zero value upon failure. */ int prom_histogram_destroy(prom_histogram_t *self); /** * @brief Observe the prom_histogram_t given the value and labells + * @param self The target prom_histogram_t* + * @param value The value to observe + * @param label_keys A collection of label keys. The number of keys MUST match the value passed as label_key_count. If + * no labels are required, pass NULL. Otherwise, it may be convenient to pass this value as a + * literal. + * @return Non-zero value upon failure */ int prom_histogram_observe(prom_histogram_t *self, double value, const char **label_values); diff --git a/prom/include/prom_histogram_buckets.h b/prom/include/prom_histogram_buckets.h index 19a8824..ec850e2 100644 --- a/prom/include/prom_histogram_buckets.h +++ b/prom/include/prom_histogram_buckets.h @@ -19,14 +19,23 @@ limitations under the License. * @brief https://prometheus.io/docs/concepts/metric_types/#histogram */ -#ifndef PROM_HISTOGRAM_BUCKETS_INCLUDED -#define PROM_HISTOGRAM_BUCKETS_INCLUDED +#include "stdlib.h" + +#ifndef PROM_HISTOGRAM_BUCKETS_H +#define PROM_HISTOGRAM_BUCKETS_H typedef struct prom_histogram_buckets { int count; /**< Number of buckets */ const double *upper_bounds; /**< The bucket values */ } prom_histogram_buckets_t; +/** + * @brief Construct a prom_histogram_buckets_t* + * @param count The number of buckets + * @param bucket The first bucket. A variable number of bucket values may be passed. This quantity MUST equal the value + * passed as count. + * @return The constructed prom_histogram_buckets_t* + */ prom_histogram_buckets_t* prom_histogram_buckets_new(size_t count, double bucket, ...); /** @@ -35,40 +44,39 @@ prom_histogram_buckets_t* prom_histogram_buckets_new(size_t count, double bucket prom_histogram_buckets_t *prom_histogram_default_buckets; /** - * @brief Create linear buckets - * @param start The first upper bound - * @param width The distance between each upper bound in buckets - * @param count The total number of buckets. The final +Inf bucket is not counted and not included in the returned - * array - * @return The array of upper bounds represented as double values - * - * The Array returned MUST be freed + *@brief Construct a linearly sized prom_histogram_buckets_t* + * @param start The first inclusive upper bound + * @param width The distance between each upper bound + * @param count The total number of buckets. The final +Inf bucket is not counted and not included. + * @return The constructed prom_histogram_buckets_t* */ prom_histogram_buckets_t* prom_histogram_buckets_linear(double start, double width, size_t count); /** - * @brief Create linear buckets. - * @param start The first upper bound. The value MUST be greater than 0. + * @brief Construct an exponentially sized prom_histogram_buckets_t* + * @param start The first inclusive upper bound. The value MUST be greater than 0. * @param factor The factor to apply to the previous upper bound to produce the next upper bound. The value MUST be - * greater than 1. - * @param count The total number of buckets. The final +Inf bucket is not counted and not included in the returned. The - * value MUST be greater than or equal to 1 - * array - * @return The array of upper bounds represented as double values - * - * The array returned MUST be freed + * greater than 1. + * @param count The total number of buckets. The final +Inf bucket is not counted and not included. The value MUST be + * greater than or equal to 1 + * @return The constructed prom_histogram_buckets_t* */ prom_histogram_buckets_t* prom_histogram_buckets_exponential(double start, double factor, size_t count); /** - * @brief Destroy a prom_histogram_buckets_t + * @brief Destroy a prom_histogram_buckets_t*. Self MUST be set to NULL after destruction. Returns a non-zero integer + * value upon failure. + * @param self The target prom_histogram_buckets_t* + * @return Non-zero integer value upon failure */ int prom_histogram_buckets_destroy(prom_histogram_buckets_t *self); /** * @brief Get the count of buckets + * @param self The target prom_histogram_buckets_t* + * @return The count of buckets */ size_t prom_histogram_buckets_count(prom_histogram_buckets_t *self); -#endif // PROM_HISTOGRAM_BUCKETS_INCLUDED +#endif // PROM_HISTOGRAM_BUCKETS_H diff --git a/prom/include/prom_metric.h b/prom/include/prom_metric.h index c8a213c..ee2874a 100644 --- a/prom/include/prom_metric.h +++ b/prom/include/prom_metric.h @@ -39,6 +39,12 @@ typedef struct prom_metric prom_metric_t; * You may use this function to cache metric samples to avoid sample lookup. Metric samples are stored in a hash map * with O(1) lookups in average case; nonethless, caching metric samples and updating them directly might be * preferrable in performance-sensitive situations. + * + * @param self The target prom_metric_t* + * @param label_values The label values associated with the metric sample being updated. The number of labels must + * match the value passed to label_key_count in the counter's constructor. If no label values are + * necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. + * @return A prom_metric_sample_t* */ prom_metric_sample_t* prom_metric_sample_from_labels(prom_metric_t *self, const char **label_values); @@ -48,6 +54,12 @@ prom_metric_sample_t* prom_metric_sample_from_labels(prom_metric_t *self, const * You may use this function to cache metric samples to avoid sample lookup. Metric samples are stored in a hash map * with O(1) lookups in average case; nonethless, caching metric samples and updating them directly might be * preferrable in performance-sensitive situations. + * + * @param self The target prom_histogram_metric_t* + * @param label_values The label values associated with the metric sample being updated. The number of labels must + * match the value passed to label_key_count in the counter's constructor. If no label values are + * necessary, pass NULL. Otherwise, It may be convenient to pass this value as a literal. + * @return prom_metric_sample_histogram_t* */ prom_metric_sample_histogram_t* prom_metric_sample_histogram_from_labels(prom_metric_t *self, const char **label_values); diff --git a/prom/include/prom_metric_sample.h b/prom/include/prom_metric_sample.h index 05e27fb..21c68d2 100644 --- a/prom/include/prom_metric_sample.h +++ b/prom/include/prom_metric_sample.h @@ -31,6 +31,9 @@ typedef struct prom_metric_sample prom_metric_sample_t; /** * @brief Add the r_value to the sample. The value must be greater than or equal to zero. + * @param self The target prom_metric_sample_t* + * @param r_value The double to add to prom_metric_sample_t* provided by self + * @return Non-zero integer value upon failure */ int prom_metric_sample_add(prom_metric_sample_t *self, double r_value); @@ -38,6 +41,9 @@ int prom_metric_sample_add(prom_metric_sample_t *self, double r_value); * @brief Subtract the r_value from the sample. * * This operation MUST be called a sample derived from a gauge metric. + * @param self The target prom_metric_sample_t* + * @param r_value The double to subtract from the prom_metric_sample_t* provided by self + * @return Non-zero integer value upon failure */ int prom_metric_sample_sub(prom_metric_sample_t *self, double r_value); @@ -45,6 +51,9 @@ int prom_metric_sample_sub(prom_metric_sample_t *self, double r_value); * @brief Set the r_value of the sample. * * This operation MUST be called on a sample derived from a gauge metric. + * @param self The target prom_metric_sample_t* + * @param r_value The double which will be set to the prom_metric_sample_t* provided by self + * @return Non-zero integer value upon failure */ int prom_metric_sample_set(prom_metric_sample_t *self, double r_value); diff --git a/prom/include/prom_metric_sample_histogram.h b/prom/include/prom_metric_sample_histogram.h index b96ef22..535e69b 100644 --- a/prom/include/prom_metric_sample_histogram.h +++ b/prom/include/prom_metric_sample_histogram.h @@ -30,6 +30,9 @@ typedef struct prom_metric_sample_histogram prom_metric_sample_histogram_t; /** * @brief Observe the double for the given prom_metric_sample_histogram_observe_t + * @param self The target prom_metric_sample_histogram_t* + * @param value The value to observe. + * @return Non-zero integer value upon failure */ int prom_metric_sample_histogram_observe(prom_metric_sample_histogram_t *self, double value); diff --git a/promhttp/include/promhttp.h b/promhttp/include/promhttp.h index ab7f94f..5f6bc07 100644 --- a/promhttp/include/promhttp.h +++ b/promhttp/include/promhttp.h @@ -26,19 +26,23 @@ #include "microhttpd.h" +#include "prom_collector_registry.h" /** * @brief Sets the active registry for metric scraping. * - * If null is passed, the default registry is used. The registry MUST be initialized. + * @param active_registery The target prom_collector_registry_t*. If null is passed, the default registry is used. + * The registry MUST be initialized. */ void promhttp_set_active_collector_registry(prom_collector_registry_t *active_registry); /** - * @brief Starts a daemon in the background and returns a pointer to an HMD_Daemon. + * @brief Starts a daemon in the background and returns a pointer to an HMD_Daemon. * * References: * * https://www.gnu.org/software/libmicrohttpd/manual/libmicrohttpd.html#microhttpd_002dinit + * + * @return struct MHD_Daemon* */ struct MHD_Daemon* promhttp_start_daemon(unsigned int flags, unsigned short port, |
