blob: 1f010fcc7edfefd2ae555dc61743f14079df5e48 [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>SimpleTimer</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="SimpleTimer";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
</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><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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/metrics/Sampling.html" title="interface in org.eclipse.microprofile.metrics"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/microprofile/metrics/SimpleTimer.html" target="_top">Frames</a></li>
<li><a href="SimpleTimer.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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">org.eclipse.microprofile.metrics</div>
<h2 title="Interface SimpleTimer" class="title">Interface SimpleTimer</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Superinterfaces:</dt>
<dd><a href="../../../../org/eclipse/microprofile/metrics/Counting.html" title="interface in org.eclipse.microprofile.metrics">Counting</a>, <a href="../../../../org/eclipse/microprofile/metrics/Metric.html" title="interface in org.eclipse.microprofile.metrics">Metric</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">SimpleTimer</span>
extends <a href="../../../../org/eclipse/microprofile/metrics/Metric.html" title="interface in org.eclipse.microprofile.metrics">Metric</a>, <a href="../../../../org/eclipse/microprofile/metrics/Counting.html" title="interface in org.eclipse.microprofile.metrics">Counting</a></pre>
<div class="block">A simple timer metric which tracks elapsed time durations and count.
This is a lightweight alternative to (@link Timer).
The simple timer measures duration in nanoseconds.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Interface and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static interface&nbsp;</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics">SimpleTimer.Context</a></span></code>
<div class="block">A timing context.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>long</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#getCount--">getCount</a></span>()</code>
<div class="block">Returns the current count.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>java.time.Duration</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#getElapsedTime--">getElapsedTime</a></span>()</code>
<div class="block">Returns the total elapsed timing durations of all completed timing events that are recorded with <a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#update-java.time.Duration-"><code>update(Duration)</code></a>.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>java.time.Duration</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#getMaxTimeDuration--">getMaxTimeDuration</a></span>()</code>
<div class="block">Get the maximum recorded time duration of the SimpleTimer for the previously completed full minute.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>java.time.Duration</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#getMinTimeDuration--">getMinTimeDuration</a></span>()</code>
<div class="block">Get the minimum recorded time duration of the SimpleTimer for the previously completed full minute.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics">SimpleTimer.Context</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#time--">time</a></span>()</code>
<div class="block">Returns a new <a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics"><code>SimpleTimer.Context</code></a>.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#time-java.util.concurrent.Callable-">time</a></span>(java.util.concurrent.Callable&lt;T&gt;&nbsp;event)</code>
<div class="block">Times and records the duration of event.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#time-java.lang.Runnable-">time</a></span>(java.lang.Runnable&nbsp;event)</code>
<div class="block">Times and records the duration of event.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#update-java.time.Duration-">update</a></span>(java.time.Duration&nbsp;duration)</code>
<div class="block">Adds a recorded duration.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="update-java.time.Duration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update</h4>
<pre>void&nbsp;update(java.time.Duration&nbsp;duration)</pre>
<div class="block">Adds a recorded duration.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>duration</code> - the length of the <code>duration</code></dd>
</dl>
</li>
</ul>
<a name="time-java.util.concurrent.Callable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>time</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;time(java.util.concurrent.Callable&lt;T&gt;&nbsp;event)
throws java.lang.Exception</pre>
<div class="block">Times and records the duration of event.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - the type of the value returned by <code>event</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>event</code> - a <code>Callable</code> whose <code>Callable.call()</code> method implements a process
whose duration should be timed</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the value returned by <code>event</code></dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code> - if <code>event</code> throws an <code>Exception</code></dd>
</dl>
</li>
</ul>
<a name="time-java.lang.Runnable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>time</h4>
<pre>void&nbsp;time(java.lang.Runnable&nbsp;event)</pre>
<div class="block">Times and records the duration of event.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>event</code> - a <code>Runnable</code> whose <code>Runnable.run()</code> method implements a process
whose duration should be timed</dd>
</dl>
</li>
</ul>
<a name="time--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>time</h4>
<pre><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics">SimpleTimer.Context</a>&nbsp;time()</pre>
<div class="block">Returns a new <a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics"><code>SimpleTimer.Context</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>a new <a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics"><code>SimpleTimer.Context</code></a></dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics"><code>SimpleTimer.Context</code></a></dd>
</dl>
</li>
</ul>
<a name="getElapsedTime--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getElapsedTime</h4>
<pre>java.time.Duration&nbsp;getElapsedTime()</pre>
<div class="block">Returns the total elapsed timing durations of all completed timing events that are recorded with <a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#update-java.time.Duration-"><code>update(Duration)</code></a>.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the elapsed time <code>duration</code></dd>
</dl>
</li>
</ul>
<a name="getCount--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getCount</h4>
<pre>long&nbsp;getCount()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface:&nbsp;<code><a href="../../../../org/eclipse/microprofile/metrics/Counting.html#getCount--">Counting</a></code></span></div>
<div class="block">Returns the current count.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="../../../../org/eclipse/microprofile/metrics/Counting.html#getCount--">getCount</a></code>&nbsp;in interface&nbsp;<code><a href="../../../../org/eclipse/microprofile/metrics/Counting.html" title="interface in org.eclipse.microprofile.metrics">Counting</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the current count</dd>
</dl>
</li>
</ul>
<a name="getMaxTimeDuration--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxTimeDuration</h4>
<pre>java.time.Duration&nbsp;getMaxTimeDuration()</pre>
<div class="block">Get the maximum recorded time duration of the SimpleTimer for the previously completed full minute.
<p>
This represents the highest timed duration in the last completed full minute. For example if the last completed
full minute recorded durations of 12 seconds, 9 seconds and 1 second the largest value is 12 seconds.
If no time duration has been recorded in the last completed full minute then a null is returned.
If there has only been one time duration recorded in the last completed full minute then this value will be returned
by both <a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#getMaxTimeDuration--"><code>getMaxTimeDuration()</code></a> and <a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#getMinTimeDuration--"><code>getMinTimeDuration()</code></a></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The maximum recorded time duration in the previously completed full minute or null if no values were recorded</dd>
</dl>
</li>
</ul>
<a name="getMinTimeDuration--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getMinTimeDuration</h4>
<pre>java.time.Duration&nbsp;getMinTimeDuration()</pre>
<div class="block">Get the minimum recorded time duration of the SimpleTimer for the previously completed full minute.
<p>
This represents the lowest timed duration in the last completed full minute. For example if the last completed
full minute recorded durations of 12 seconds, 9 seconds and 1 second the lowest value is 1 second.
If no time duration has been recorded in the last completed full minute then a null is returned.
If there has only been one time duration recorded in the last completed full minute then this value will be returned
by both <a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#getMaxTimeDuration--"><code>getMaxTimeDuration()</code></a> and <a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.html#getMinTimeDuration--"><code>getMinTimeDuration()</code></a></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The minimum recorded time duration in the previously completed full minute or null if no values were recorded</dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= 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><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">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/metrics/Sampling.html" title="interface in org.eclipse.microprofile.metrics"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/eclipse/microprofile/metrics/SimpleTimer.Context.html" title="interface in org.eclipse.microprofile.metrics"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/eclipse/microprofile/metrics/SimpleTimer.html" target="_top">Frames</a></li>
<li><a href="SimpleTimer.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>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>