blob: aede58bce69b005f21d1a36daf35f852fabc140d [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<title>org.eclipse.microprofile.metrics</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<link rel="shortcut icon" href="/img/microprofile-favicon.png">
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="org.eclipse.microprofile.metrics";
}
}
catch(err) {
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/eclipse/microprofile/maven/pdf/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../org/eclipse/microprofile/metrics/annotation/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/microprofile/metrics/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<div class="header">
<h1 title="Package" class="title">Package&nbsp;org.eclipse.microprofile.metrics</h1>
<div class="docSummary">
<div class="block">MicroProfile Metrics</div>
</div>
<p>See:&nbsp;<a href="#package.description">Description</a></p>
</div>
<div class="contentContainer">
<ul class="blockList">
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Interface Summary table, listing interfaces, and an explanation">
<caption><span>Interface Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Interface</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/ConcurrentGauge.html" title="interface in org.eclipse.microprofile.metrics">ConcurrentGauge</a></td>
<td class="colLast">
<div class="block">A concurrent gauge is a gauge that measures parallel invocations of a method.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Counter.html" title="interface in org.eclipse.microprofile.metrics">Counter</a></td>
<td class="colLast">
<div class="block">An incrementing counter metric.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Counting.html" title="interface in org.eclipse.microprofile.metrics">Counting</a></td>
<td class="colLast">
<div class="block">An interface for metric types which have counts.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Gauge.html" title="interface in org.eclipse.microprofile.metrics">Gauge</a>&lt;T&gt;</td>
<td class="colLast">
<div class="block">A gauge metric is an instantaneous reading of a particular value.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Histogram.html" title="interface in org.eclipse.microprofile.metrics">Histogram</a></td>
<td class="colLast">
<div class="block">A metric which calculates the distribution of a value.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Metadata.html" title="interface in org.eclipse.microprofile.metrics">Metadata</a></td>
<td class="colLast">
<div class="block">Bean holding the metadata of one single metric.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Meter.html" title="interface in org.eclipse.microprofile.metrics">Meter</a></td>
<td class="colLast">
<div class="block">A meter metric which measures mean throughput and one-, five-, and fifteen-minute exponentially-weighted moving
average throughputs.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Metered.html" title="interface in org.eclipse.microprofile.metrics">Metered</a></td>
<td class="colLast">
<div class="block">An object which maintains mean and exponentially-weighted rate.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Metric.html" title="interface in org.eclipse.microprofile.metrics">Metric</a></td>
<td class="colLast">
<div class="block">A tag interface to indicate that a class is a metric.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/MetricFilter.html" title="interface in org.eclipse.microprofile.metrics">MetricFilter</a></td>
<td class="colLast">
<div class="block">A filter used to determine whether or not a metric should be reported, among other things.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/MetricRegistry.html" title="interface in org.eclipse.microprofile.metrics">MetricRegistry</a></td>
<td class="colLast">
<div class="block">The registry that stores metrics and their metadata.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Sampling.html" title="interface in org.eclipse.microprofile.metrics">Sampling</a></td>
<td class="colLast">
<div class="block">An object which samples values.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html" title="interface in org.eclipse.microprofile.metrics">SimpleTimer</a></td>
<td class="colLast">
<div class="block">A simple timer metric which tracks elapsed time durations and count.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics">SimpleTimer.Context</a></td>
<td class="colLast">
<div class="block">A timing context.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Timer.html" title="interface in org.eclipse.microprofile.metrics">Timer</a></td>
<td class="colLast">
<div class="block">A timer metric which aggregates timing durations and provides duration statistics, plus throughput statistics via
<a href="../../../../org/eclipse/microprofile/metrics/Meter.html" title="interface in org.eclipse.microprofile.metrics"><code>Meter</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Timer.Context.html" title="interface in org.eclipse.microprofile.metrics">Timer.Context</a></td>
<td class="colLast">
<div class="block">A timing context.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Class Summary table, listing classes, and an explanation">
<caption><span>Class Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/DefaultMetadata.html" title="class in org.eclipse.microprofile.metrics">DefaultMetadata</a></td>
<td class="colLast">
<div class="block">The default implementation of <a href="../../../../org/eclipse/microprofile/metrics/Metadata.html" title="interface in org.eclipse.microprofile.metrics"><code>Metadata</code></a></div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/MetadataBuilder.html" title="class in org.eclipse.microprofile.metrics">MetadataBuilder</a></td>
<td class="colLast">
<div class="block">The <a href="../../../../org/eclipse/microprofile/metrics/Metadata.html" title="interface in org.eclipse.microprofile.metrics"><code>Metadata</code></a> builder.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/MetricID.html" title="class in org.eclipse.microprofile.metrics">MetricID</a></td>
<td class="colLast">
<div class="block">A unique identifier for <a href="../../../../org/eclipse/microprofile/metrics/Metric.html" title="interface in org.eclipse.microprofile.metrics"><code>Metric</code></a> and <a href="../../../../org/eclipse/microprofile/metrics/Metadata.html" title="interface in org.eclipse.microprofile.metrics"><code>Metadata</code></a> that are registered in the <a href="../../../../org/eclipse/microprofile/metrics/MetricRegistry.html" title="interface in org.eclipse.microprofile.metrics"><code>MetricRegistry</code></a>
The MetricID contains:
<code>Name</code>: (Required) The name of the metric.
<code>Tags</code>: (Optional) The tags (represented by <a href="../../../../org/eclipse/microprofile/metrics/Tag.html" title="class in org.eclipse.microprofile.metrics"><code>Tag</code></a> objects) of the metric.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/MetricUnits.html" title="class in org.eclipse.microprofile.metrics">MetricUnits</a></td>
<td class="colLast">
<div class="block">Standard units constants for metric's <a href="../../../../org/eclipse/microprofile/metrics/Metadata.html" title="interface in org.eclipse.microprofile.metrics"><code>Metadata</code></a>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Snapshot.html" title="class in org.eclipse.microprofile.metrics">Snapshot</a></td>
<td class="colLast">
<div class="block">A statistical snapshot of a <a href="../../../../org/eclipse/microprofile/metrics/Snapshot.html" title="class in org.eclipse.microprofile.metrics"><code>Snapshot</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/Tag.html" title="class in org.eclipse.microprofile.metrics">Tag</a></td>
<td class="colLast">
<div class="block">Tag represents a singular metric tag key and value pair.</div>
</td>
</tr>
</tbody>
</table>
</li>
<li class="blockList">
<table class="typeSummary" border="0" cellpadding="3" cellspacing="0" summary="Enum Summary table, listing enums, and an explanation">
<caption><span>Enum Summary</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Enum</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/MetricRegistry.Type.html" title="enum in org.eclipse.microprofile.metrics">MetricRegistry.Type</a></td>
<td class="colLast">
<div class="block">An enumeration representing the scopes of the MetricRegistry</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><a href="../../../../org/eclipse/microprofile/metrics/MetricType.html" title="enum in org.eclipse.microprofile.metrics">MetricType</a></td>
<td class="colLast">
<div class="block">An enumeration representing the different types of metrics.</div>
</td>
</tr>
</tbody>
</table>
</li>
</ul>
<a name="package.description">
<!-- -->
</a>
<h2 title="Package org.eclipse.microprofile.metrics Description">Package org.eclipse.microprofile.metrics Description</h2>
<div class="block">MicroProfile Metrics
<h2>Rational</h2>
<p>
To ensure reliable operation of software it is necessary to monitor essential system parameters. There is already JMX
as standard to expose metrics, but remote-JMX is not easy to deal with and especially does not fit well in a polyglot
environment where other services are not running on the JVM. To enable monitoring in an easy fashion, the
MicroProfile Metrics specification provides a standard to instrument an application with metrics and provides a
simple REST endpoint for integration with monitoring services.
<h2>Adding Metrics</h2>
<p>
MicroProfile Metrics provides 6 different metric types that can be used to instrument an application. Developers can
create an accompanying <a href="../../../../org/eclipse/microprofile/metrics/Metadata.html" title="interface in org.eclipse.microprofile.metrics"><code>Metadata</code></a> object to supply the metric's name,
description, display name, and units. Once the metric and the metadata are registered against the application
<a href="../../../../org/eclipse/microprofile/metrics/MetricRegistry.html" title="interface in org.eclipse.microprofile.metrics"><code>MetricRegistry</code></a>, the metrics will be available in the REST
endpoints.
<h2>Metric Types</h2>
<p>
<a href="../../../../org/eclipse/microprofile/metrics/Counter.html" title="interface in org.eclipse.microprofile.metrics"><code>Counter</code></a> is used to measure an increasing value.
<p>
Example usage:
<pre>
<code>
Counter count = metricRegistry.counter(metadata);
count.inc();
</code>
</pre>
<p>
<a href="../../../../org/eclipse/microprofile/metrics/ConcurrentGauge.html" title="interface in org.eclipse.microprofile.metrics"><code>ConcurrentGauge</code></a> is used to monitor the number of concurrent
invocations of a component.
<p>
Example usage:
<pre>
<code>
ConcurrentGauge cgauge = metricRegistry.concurrentGauge(metadata);
cgauge.inc();
// .. a block of code that can be executed by multiple threads at the same time
cgauge.dec();
</code>
</pre>
<a href="../../../../org/eclipse/microprofile/metrics/Gauge.html" title="interface in org.eclipse.microprofile.metrics"><code>Gauge</code></a> is used to provide the immediate measurement of a value.
<p>
Example usage:
<pre>
<code>
Gauge&lt;Double&gt; temperature = new Gauge&lt;Double&gt;() {
public Double getValue() {
return getTemperature();
}
};
metricRegistry.register(metadata, temperature);
</code>
</pre>
<a href="../../../../org/eclipse/microprofile/metrics/Meter.html" title="interface in org.eclipse.microprofile.metrics"><code>Meter</code></a> is used to measure the frequency of an event.
<p>
Example usage:
<pre>
<code>
Meter meter = metricRegistry.meter(metadata);
meter.mark();
</code>
</pre>
<a href="../../../../org/eclipse/microprofile/metrics/Histogram.html" title="interface in org.eclipse.microprofile.metrics"><code>Histogram</code></a> is used to sample and compute the distribution of values
<p>
Example usage:
<pre>
<code>
Histogram histogram = metricRegistry.histogram(metadata);
histogram.update(score);
</code>
</pre>
<a href="../../../../org/eclipse/microprofile/metrics/Timer.html" title="interface in org.eclipse.microprofile.metrics"><code>Timer</code></a> is used to measure the duration of an event as well as the
frequency of occurrence.
<p>
Example usage:
<pre>
<code>
Timer timer = metricRegistry.timer(metadata);
Timer.Context context = timer.time();
... // code that will be timed
context.close();
</code>
</pre>
<a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html" title="interface in org.eclipse.microprofile.metrics"><code>SimpleTimer</code></a> is used to measure the duration of an event.
<p>
Example usage:
<pre>
<code>
SimpleTimer simpleTimer = metricRegistry.simpleTimer(metadata);
SimpleTimer.Context context = simpleTimer.time();
... // code that will be timed
context.close();
</code>
</pre></div>
</div>
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li class="navBarCell1Rev">Package</li>
<li>Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../org/eclipse/microprofile/maven/pdf/package-summary.html">Prev&nbsp;Package</a></li>
<li><a href="../../../../org/eclipse/microprofile/metrics/annotation/package-summary.html">Next&nbsp;Package</a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/microprofile/metrics/package-summary.html" target="_top">Frames</a></li>
<li><a href="package-summary.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>