# DefaultMetrics

<div class="jsdoc-content"><header>
    
        <h2><span class="attribs"><span class="type-signature"></span></span>
            <span class="ancestors"><a href="index.html">metrics</a>~</span>DefaultMetrics<span class="signature">()</span><span class="type-signature"></span></h2>
        
            <div class="class-description"><p>A default implementation of <a href="ClientMetrics.html">ClientMetrics</a> that exposes the driver events as
Node.js events.</p>
<p>An instance of <a href="DefaultMetrics.html">DefaultMetrics</a> is configured by default in the client,
you can access this instance using <a href="../Client.html#metrics">Client#metrics</a> property.</p></div>
        
    
</header>


    
        

    
    </div>

## Constructor

<div class="jsdoc-content">
    

    
    <h4 class="name" id="DefaultMetrics"><span class="type-signature"></span>new DefaultMetrics<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Creates a new instance of <a href="DefaultMetrics.html">DefaultMetrics</a>.</p>
</div>













<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html">module:metrics~ClientMetrics</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L21" target="_blank" rel="noopener">metrics/default-metrics.js, line 21</a></p></div>



















    <h5>Example</h5>
    
        <p class="code-caption">Listening to events emitted</p>
    
    <div class="highlight-javascript notranslate"><div class="highlight"><pre>defaultMetrics.errors.on('increment', err => totalErrors++);
defaultMetrics.errors.clientTimeout.on('increment', () => clientTimeoutErrors++);
defaultMetrics.speculativeRetries.on('increment', () => specExecsCount++);
defaultMetrics.responses.on('increment', latency => myHistogram.record(latency));</pre></div></div>



    
    

    

    

    

    

    

    

    
        </div>

## Members

<div class="jsdoc-content">

        
            
<h4 class="name" id="errors"><span class="type-signature"></span>errors<span class="type-signature"> :EventEmitter</span></h4>




<div class="description">
    <p>Emits all the error events.</p>
<p>Use each of the properties to measure events of specific errors.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">EventEmitter</span>


        </li>
    </ul>





    <h5 class="subsection-title">Properties:</h5>

    

<table class="props docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>authentication</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits the authentication timeout error events.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>clientTimeout</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits the client timeout error events.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>connection</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits the connection error events.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>readTimeout</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits the read timeout error events obtained from the server.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>other</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits the error events, that are not part of the other categories.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>unavailable</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits the unavailable error events obtained from the server.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>writeTimeout</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits the write timeout error events obtained from the server</p></td>
        </tr>

    
    </tbody>
</table>




<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L41" target="_blank" rel="noopener">metrics/default-metrics.js, line 41</a></p></div>






        
            
<h4 class="name" id="ignoredErrors"><span class="type-signature"></span>ignoredErrors<span class="type-signature"> :EventEmitter</span></h4>




<div class="description">
    <p>Emits events when an error is ignored by the retry policy.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">EventEmitter</span>


        </li>
    </ul>





<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L81" target="_blank" rel="noopener">metrics/default-metrics.js, line 81</a></p></div>






        
            
<h4 class="name" id="responses"><span class="type-signature"></span>responses<span class="type-signature"> :EventEmitter</span></h4>




<div class="description">
    <p>Emits events when a response message is obtained.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">EventEmitter</span>


        </li>
    </ul>





    <h5 class="subsection-title">Properties:</h5>

    

<table class="props docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>success</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits when a response was obtained as the result of a successful execution.</p></td>
        </tr>

    
    </tbody>
</table>




<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L88" target="_blank" rel="noopener">metrics/default-metrics.js, line 88</a></p></div>






        
            
<h4 class="name" id="retries"><span class="type-signature"></span>retries<span class="type-signature"> :EventEmitter</span></h4>




<div class="description">
    <p>Emits all the retry events.</p>
<p>Use each of the properties to measure events of specific retries.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">EventEmitter</span>


        </li>
    </ul>





    <h5 class="subsection-title">Properties:</h5>

    

<table class="props docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>clientTimeout</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits when an execution is retried as a result of an client timeout.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>other</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits the error events, that are not part of the other categories.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>readTimeout</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits an execution is retried as a result of an read timeout error from the
server (coordinator to replica).</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>unavailable</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits an execution is retried as a result of an unavailable error from the
server.</p></td>
        </tr>

    

        <tr>
            
                <td class="name"><code>writeTimeout</code></td>
            

            <td class="type">
            
                
<span class="param-type">EventEmitter</span>


            
            </td>

            

            

            <td class="description last"><p>Emits an execution is retried as a result of a write timeout error from the
server (coordinator to replica).</p></td>
        </tr>

    
    </tbody>
</table>




<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L64" target="_blank" rel="noopener">metrics/default-metrics.js, line 64</a></p></div>






        
            
<h4 class="name" id="speculativeExecutions"><span class="type-signature"></span>speculativeExecutions<span class="type-signature"> :EventEmitter</span></h4>




<div class="description">
    <p>Emits events when a speculative execution is started.</p>
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">EventEmitter</span>


        </li>
    </ul>





<div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L75" target="_blank" rel="noopener">metrics/default-metrics.js, line 75</a></p></div>






        
    

    
        </div>

## Methods

<div class="jsdoc-content">

        
            

    

    
    <h4 class="name" id="onAuthenticationError"><span class="type-signature"></span>onAuthenticationError<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an authentication error is obtained from the server.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">AuthenticationError</span>
|

<span class="param-type">Error</span>


            
            </td>

            

            

            <td class="description last"><p>The error encountered.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onAuthenticationError">module:metrics~ClientMetrics#onAuthenticationError</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L93" target="_blank" rel="noopener">metrics/default-metrics.js, line 93</a></p></div>




















        
            

    

    
    <h4 class="name" id="onClientTimeoutError"><span class="type-signature"></span>onClientTimeoutError<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an error (different than a server or client timeout, authentication or connection error) is
encountered when executing a request.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">OperationTimedOutError</span>


            
            </td>

            

            

            <td class="description last"><p>The timeout error.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onClientTimeoutError">module:metrics~ClientMetrics#onClientTimeoutError</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L123" target="_blank" rel="noopener">metrics/default-metrics.js, line 123</a></p></div>




















        
            

    

    
    <h4 class="name" id="onClientTimeoutRetry"><span class="type-signature"></span>onClientTimeoutRetry<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an execution is retried as a result of a client-level timeout.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            

            

            <td class="description last"><p>The error that caused the retry.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onClientTimeoutRetry">module:metrics~ClientMetrics#onClientTimeoutRetry</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L135" target="_blank" rel="noopener">metrics/default-metrics.js, line 135</a></p></div>




















        
            

    

    
    <h4 class="name" id="onConnectionError"><span class="type-signature"></span>onConnectionError<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when there is a connection error.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            

            

            <td class="description last"><p>The error encountered.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onConnectionError">module:metrics~ClientMetrics#onConnectionError</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L99" target="_blank" rel="noopener">metrics/default-metrics.js, line 99</a></p></div>




















        
            

    

    
    <h4 class="name" id="onIgnoreError"><span class="type-signature"></span>onIgnoreError<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an error is marked as ignored by the retry policy.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            

            

            <td class="description last"><p>The error that was ignored by the retry policy.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onIgnoreError">module:metrics~ClientMetrics#onIgnoreError</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L165" target="_blank" rel="noopener">metrics/default-metrics.js, line 165</a></p></div>




















        
            

    

    
    <h4 class="name" id="onOtherError"><span class="type-signature"></span>onOtherError<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an error (different than a server or client timeout, authentication or connection error) is
encountered when executing a request.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            

            

            <td class="description last"><p>The error encountered.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onOtherError">module:metrics~ClientMetrics#onOtherError</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L129" target="_blank" rel="noopener">metrics/default-metrics.js, line 129</a></p></div>




















        
            

    

    
    <h4 class="name" id="onOtherErrorRetry"><span class="type-signature"></span>onOtherErrorRetry<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an error (other than a server or client timeout) is retried.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            

            

            <td class="description last"><p>The error that caused the retry.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onOtherErrorRetry">module:metrics~ClientMetrics#onOtherErrorRetry</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L141" target="_blank" rel="noopener">metrics/default-metrics.js, line 141</a></p></div>




















        
            

    

    
    <h4 class="name" id="onReadTimeoutError"><span class="type-signature"></span>onReadTimeoutError<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when a read timeout error is obtained from the server.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">ResponseError</span>


            
            </td>

            

            

            <td class="description last"><p>The error encountered.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onReadTimeoutError">module:metrics~ClientMetrics#onReadTimeoutError</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L105" target="_blank" rel="noopener">metrics/default-metrics.js, line 105</a></p></div>




















        
            

    

    
    <h4 class="name" id="onReadTimeoutRetry"><span class="type-signature"></span>onReadTimeoutRetry<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an execution is retried as a result of a read timeout from the server (coordinator to replica).</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            

            

            <td class="description last"><p>The error that caused the retry.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onReadTimeoutRetry">module:metrics~ClientMetrics#onReadTimeoutRetry</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L147" target="_blank" rel="noopener">metrics/default-metrics.js, line 147</a></p></div>




















        
            

    

    
    <h4 class="name" id="onResponse"><span class="type-signature"></span>onResponse<span class="signature">(latency)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when any response is obtained, the response can be the result of a successful execution or a
server-side error.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latency</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array&lt;Number></span>


            
            </td>

            

            

            <td class="description last"><p>The latency represented in a <code>[seconds, nanoseconds]</code> tuple
Array, where nanoseconds is the remaining part of the real time that can't be represented in second precision.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onResponse">module:metrics~ClientMetrics#onResponse</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L180" target="_blank" rel="noopener">metrics/default-metrics.js, line 180</a></p></div>




















        
            

    

    
    <h4 class="name" id="onSpeculativeExecution"><span class="type-signature"></span>onSpeculativeExecution<span class="signature">()</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when a speculative execution is started.</p>
</div>













<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onSpeculativeExecution">module:metrics~ClientMetrics#onSpeculativeExecution</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L170" target="_blank" rel="noopener">metrics/default-metrics.js, line 170</a></p></div>




















        
            

    

    
    <h4 class="name" id="onSuccessfulResponse"><span class="type-signature"></span>onSuccessfulResponse<span class="signature">(latency)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when a response is obtained successfully.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>latency</code></td>
            

            <td class="type">
            
                
<span class="param-type">Array&lt;Number></span>


            
            </td>

            

            

            <td class="description last"><p>The latency represented in a <code>[seconds, nanoseconds]</code> tuple
Array, where nanoseconds is the remaining part of the real time that can't be represented in second precision.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onSuccessfulResponse">module:metrics~ClientMetrics#onSuccessfulResponse</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L175" target="_blank" rel="noopener">metrics/default-metrics.js, line 175</a></p></div>




















        
            

    

    
    <h4 class="name" id="onUnavailableError"><span class="type-signature"></span>onUnavailableError<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an unavailable error is obtained from the server.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">ResponseError</span>


            
            </td>

            

            

            <td class="description last"><p>The error encountered.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onUnavailableError">module:metrics~ClientMetrics#onUnavailableError</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L117" target="_blank" rel="noopener">metrics/default-metrics.js, line 117</a></p></div>




















        
            

    

    
    <h4 class="name" id="onUnavailableRetry"><span class="type-signature"></span>onUnavailableRetry<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an execution is retried as a result of an unavailable error from the server.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            

            

            <td class="description last"><p>The error that caused the retry.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onUnavailableRetry">module:metrics~ClientMetrics#onUnavailableRetry</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L153" target="_blank" rel="noopener">metrics/default-metrics.js, line 153</a></p></div>




















        
            

    

    
    <h4 class="name" id="onWriteTimeoutError"><span class="type-signature"></span>onWriteTimeoutError<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when a write timeout error is obtained from the server.</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">ResponseError</span>


            
            </td>

            

            

            <td class="description last"><p>The error encountered.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onWriteTimeoutError">module:metrics~ClientMetrics#onWriteTimeoutError</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L111" target="_blank" rel="noopener">metrics/default-metrics.js, line 111</a></p></div>




















        
            

    

    
    <h4 class="name" id="onWriteTimeoutRetry"><span class="type-signature"></span>onWriteTimeoutRetry<span class="signature">(e)</span><span class="type-signature"></span></h4>
    

    



<div class="description">
    <p>Method invoked when an execution is retried as a result of a write timeout from the server (coordinator to
replica).</p>
</div>









    <h5>Parameters:</h5>
    

<table class="params docutils align-default">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>e</code></td>
            

            <td class="type">
            
                
<span class="param-type">Error</span>


            
            </td>

            

            

            <td class="description last"><p>The error that caused the retry.</p></td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    
    <dt class="implements">Implements:</dt>
    <dd class="implements"><ul>
        
            <li><a href="ClientMetrics.html#onWriteTimeoutRetry">module:metrics~ClientMetrics#onWriteTimeoutRetry</a></li>
        
    </ul></dd>
    

    

    

    

    

    

    

    
    
    

    

    

    
</dl><div class="admonition note"><p class="admonition-title">Source</p><p><a href="https://github.com/scylladb/nodejs-rs-driver/blob/v0.6.1/lib/metrics/default-metrics.js#L159" target="_blank" rel="noopener">metrics/default-metrics.js, line 159</a></p></div></div>
