blob: 6ff1dead2fafa223864d9c6006240644d3cb154b [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>
<!-- Generated by javadoc -->
<title>Timer</title>
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Timer";
}
}
catch(err) {
}
//-->
var methods = {"i0":6,"i1":18,"i2":6,"i3":6,"i4":18,"i5":6,"i6":6,"i7":6,"i8":6,"i9":18};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],16:["t5","Default 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/apache/iceberg/metrics/ScanReportParser.html" title="class in org.apache.iceberg.metrics"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/iceberg/metrics/Timer.Timed.html" title="interface in org.apache.iceberg.metrics"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/iceberg/metrics/Timer.html" target="_top">Frames</a></li>
<li><a href="Timer.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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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.apache.iceberg.metrics</div>
<h2 title="Interface Timer" class="title">Interface Timer</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><a href="../../../../org/apache/iceberg/metrics/DefaultTimer.html" title="class in org.apache.iceberg.metrics">DefaultTimer</a></dd>
</dl>
<hr>
<br>
<pre>public interface <span class="typeNameLabel">Timer</span></pre>
<div class="block">Generalized Timer interface for creating telemetry related instances for measuring duration of
operations.</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/apache/iceberg/metrics/Timer.Timed.html" title="interface in org.apache.iceberg.metrics">Timer.Timed</a></span></code>
<div class="block">A timing sample that carries internal state about the Timer's start position.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Field and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../org/apache/iceberg/metrics/Timer.html" title="interface in org.apache.iceberg.metrics">Timer</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#NOOP">NOOP</a></span></code>&nbsp;</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><span id="t5" class="tableTab"><span><a href="javascript:show(16);">Default 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/apache/iceberg/metrics/Timer.html#count--">count</a></span>()</code>
<div class="block">The number of times <a href="../../../../org/apache/iceberg/metrics/Timer.html#time-java.time.Duration-"><code>time(Duration)</code></a> was called.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>default boolean</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#isNoop--">isNoop</a></span>()</code>
<div class="block">Determines whether this timer is a NOOP timer.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#record-long-java.util.concurrent.TimeUnit-">record</a></span>(long&nbsp;amount,
java.util.concurrent.TimeUnit&nbsp;unit)</code>
<div class="block">Records a custom amount in the given time unit.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code><a href="../../../../org/apache/iceberg/metrics/Timer.Timed.html" title="interface in org.apache.iceberg.metrics">Timer.Timed</a></code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#start--">start</a></span>()</code>
<div class="block">Starts the timer and returns a <a href="../../../../org/apache/iceberg/metrics/Timer.Timed.html" title="interface in org.apache.iceberg.metrics"><code>Timer.Timed</code></a> instance.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>default void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#time-java.time.Duration-">time</a></span>(java.time.Duration&nbsp;duration)</code>
<div class="block">The duration to record</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#time-java.lang.Runnable-">time</a></span>(java.lang.Runnable&nbsp;runnable)</code>
<div class="block">Executes and measures the given <code>Runnable</code> instance.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#time-java.util.function.Supplier-">time</a></span>(java.util.function.Supplier&lt;T&gt;&nbsp;supplier)</code>
<div class="block">Gets the result from the given <code>Supplier</code> and measures its execution time.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>&lt;T&gt;&nbsp;T</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#timeCallable-java.util.concurrent.Callable-">timeCallable</a></span>(java.util.concurrent.Callable&lt;T&gt;&nbsp;callable)</code>
<div class="block">Executes and measures the given <code>Callable</code> and returns its result.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>java.time.Duration</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#totalDuration--">totalDuration</a></span>()</code>
<div class="block">The total duration that was recorded.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>default java.util.concurrent.TimeUnit</code></td>
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../org/apache/iceberg/metrics/Timer.html#unit--">unit</a></span>()</code>
<div class="block">The <code>TimeUnit</code> of the timer.</div>
</td>
</tr>
</table>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="NOOP">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>NOOP</h4>
<pre>static final&nbsp;<a href="../../../../org/apache/iceberg/metrics/Timer.html" title="interface in org.apache.iceberg.metrics">Timer</a> NOOP</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="count--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>count</h4>
<pre>long&nbsp;count()</pre>
<div class="block">The number of times <a href="../../../../org/apache/iceberg/metrics/Timer.html#time-java.time.Duration-"><code>time(Duration)</code></a> was called.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The number of times <a href="../../../../org/apache/iceberg/metrics/Timer.html#time-java.time.Duration-"><code>time(Duration)</code></a> was called.</dd>
</dl>
</li>
</ul>
<a name="totalDuration--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>totalDuration</h4>
<pre>java.time.Duration&nbsp;totalDuration()</pre>
<div class="block">The total duration that was recorded.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The total duration that was recorded.</dd>
</dl>
</li>
</ul>
<a name="start--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>start</h4>
<pre><a href="../../../../org/apache/iceberg/metrics/Timer.Timed.html" title="interface in org.apache.iceberg.metrics">Timer.Timed</a>&nbsp;start()</pre>
<div class="block">Starts the timer and returns a <a href="../../../../org/apache/iceberg/metrics/Timer.Timed.html" title="interface in org.apache.iceberg.metrics"><code>Timer.Timed</code></a> instance. Call <a href="../../../../org/apache/iceberg/metrics/Timer.Timed.html#stop--"><code>Timer.Timed.stop()</code></a> to complete
the timing.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>A <a href="../../../../org/apache/iceberg/metrics/Timer.Timed.html" title="interface in org.apache.iceberg.metrics"><code>Timer.Timed</code></a> instance with the start time recorded.</dd>
</dl>
</li>
</ul>
<a name="unit--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unit</h4>
<pre>default&nbsp;java.util.concurrent.TimeUnit&nbsp;unit()</pre>
<div class="block">The <code>TimeUnit</code> of the timer.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The <code>TimeUnit</code> of the timer.</dd>
</dl>
</li>
</ul>
<a name="record-long-java.util.concurrent.TimeUnit-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>record</h4>
<pre>void&nbsp;record(long&nbsp;amount,
java.util.concurrent.TimeUnit&nbsp;unit)</pre>
<div class="block">Records a custom amount in the given time unit.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>amount</code> - The amount to record</dd>
<dd><code>unit</code> - The time unit of the amount</dd>
</dl>
</li>
</ul>
<a name="time-java.time.Duration-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>time</h4>
<pre>default&nbsp;void&nbsp;time(java.time.Duration&nbsp;duration)</pre>
<div class="block">The duration to record</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>duration</code> - The duration to record</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;runnable)</pre>
<div class="block">Executes and measures the given <code>Runnable</code> instance.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>runnable</code> - The <code>Runnable</code> to execute and measure.</dd>
</dl>
</li>
</ul>
<a name="timeCallable-java.util.concurrent.Callable-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>timeCallable</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;timeCallable(java.util.concurrent.Callable&lt;T&gt;&nbsp;callable)
throws java.lang.Exception</pre>
<div class="block">Executes and measures the given <code>Callable</code> and returns its result.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - The type of the <code>Callable</code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>callable</code> - The <code>Callable</code> to execute and measure.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The result of the underlying <code>Callable</code>.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code>java.lang.Exception</code> - In case the <code>Callable</code> fails.</dd>
</dl>
</li>
</ul>
<a name="time-java.util.function.Supplier-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>time</h4>
<pre>&lt;T&gt;&nbsp;T&nbsp;time(java.util.function.Supplier&lt;T&gt;&nbsp;supplier)</pre>
<div class="block">Gets the result from the given <code>Supplier</code> and measures its execution time.</div>
<dl>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>T</code> - The type of the <code>Supplier</code>.</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>supplier</code> - The <code>Supplier</code> to execute and measure.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The result of the underlying <code>Supplier</code>.</dd>
</dl>
</li>
</ul>
<a name="isNoop--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>isNoop</h4>
<pre>default&nbsp;boolean&nbsp;isNoop()</pre>
<div class="block">Determines whether this timer is a NOOP timer.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether this timer is a NOOP timer.</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/apache/iceberg/metrics/ScanReportParser.html" title="class in org.apache.iceberg.metrics"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../org/apache/iceberg/metrics/Timer.Timed.html" title="interface in org.apache.iceberg.metrics"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?org/apache/iceberg/metrics/Timer.html" target="_top">Frames</a></li>
<li><a href="Timer.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><a href="#field.summary">Field</a>&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><a href="#field.detail">Field</a>&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>