You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by bu...@apache.org on 2016/01/08 23:30:56 UTC

svn commit: r977332 - in /websites/staging/sling/trunk/content: ./ documentation/bundles/metrics.html

Author: buildbot
Date: Fri Jan  8 22:30:56 2016
New Revision: 977332

Log:
Staging update by buildbot for sling

Modified:
    websites/staging/sling/trunk/content/   (props changed)
    websites/staging/sling/trunk/content/documentation/bundles/metrics.html

Propchange: websites/staging/sling/trunk/content/
------------------------------------------------------------------------------
--- cms:source-revision (original)
+++ cms:source-revision Fri Jan  8 22:30:56 2016
@@ -1 +1 @@
-1723758
+1723811

Modified: websites/staging/sling/trunk/content/documentation/bundles/metrics.html
==============================================================================
--- websites/staging/sling/trunk/content/documentation/bundles/metrics.html (original)
+++ websites/staging/sling/trunk/content/documentation/bundles/metrics.html Fri Jan  8 22:30:56 2016
@@ -148,7 +148,7 @@ application. </p>
 </pre></div>
 
 
-<p>To make use of <code>MetricService</code></p>
+<p>To make use of <code>MetricsService</code></p>
 <ol>
 <li>Get a reference to <code>org.apache.sling.metrics.MetricsService</code></li>
 <li>Initialize the metric e.g. Counter in above case. This avoids 
@@ -156,43 +156,43 @@ application. </p>
 <li>Make use of metric instance to capture require stats</li>
 </ol>
 <p>Refer to <a href="https://dropwizard.github.io/metrics/3.1.0/getting-started/#counters">Metric Getting Started</a> guide to see how various types
-of Metric instances can be used. Note that when using Sling Commons Metric 
+of Metric instances can be used. Note that when using Sling Commons Metrics
 bundle class names belong to <code>org.apache.sling.commons.metrics</code> package</p>
 <h2 id="api">API<a class="headerlink" href="#api" title="Permanent link">&para;</a></h2>
-<p>Sling Metric bundle provides its own Metric classes which are modelled on 
+<p>Sling Metrics bundle provides its own Metric classes which are modelled on 
 <a href="http://metrics.dropwizard.io/">Dropwizard Metrics</a> library. The metric interfaces defined by Sling bundle
 only provides methods related to data collection. </p>
 <ul>
 <li><a href="https://github.com/apache/sling/blob/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/Meter.java">org.apache.sling.commons.metrics.Meter</a> - Similar to <a href="https://dropwizard.github.io/metrics/3.1.0/manual/core/#meters">Dropwizard Meter</a></li>
 <li><a href="https://github.com/apache/sling/blob/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/Timer.java">org.apache.sling.commons.metrics.Timer</a> - Similar to <a href="https://dropwizard.github.io/metrics/3.1.0/manual/core/#timers">Dropwizard Timer</a></li>
-<li><a href="https://github.com/apache/sling/blob/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/Counter.java">org.apache.sling.commons.metrics.Counter</a> - Similar to <a href="https://dropwizard.github.io/metrics/3.1.0/manual/core/#counters">Dropwizard Timer</a></li>
-<li><a href="https://github.com/apache/sling/blob/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/Histogram.java">org.apache.sling.commons.metrics.Histogram</a> - Similar to <a href="https://dropwizard.github.io/metrics/3.1.0/manual/core/#histograms">Dropwizard Timer</a></li>
+<li><a href="https://github.com/apache/sling/blob/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/Counter.java">org.apache.sling.commons.metrics.Counter</a> - Similar to <a href="https://dropwizard.github.io/metrics/3.1.0/manual/core/#counters">Dropwizard Counter</a></li>
+<li><a href="https://github.com/apache/sling/blob/trunk/bundles/commons/metrics/src/main/java/org/apache/sling/commons/metrics/Histogram.java">org.apache.sling.commons.metrics.Histogram</a> - Similar to <a href="https://dropwizard.github.io/metrics/3.1.0/manual/core/#histograms">Dropwizard Histogram</a></li>
 </ul>
-<p>Further it provides a <code>MetricService</code> which enables creation of different
-type of Metrics like Meter, Timer, Counter and Histogram</p>
+<p>Further it provides a <code>MetricsService</code> which enables creation of different
+type of Metrics like Meter, Timer, Counter and Histogram.</p>
 <h3 id="requirement-of-wrapper-interfaces">Requirement of wrapper interfaces<a class="headerlink" href="#requirement-of-wrapper-interfaces" title="Permanent link">&para;</a></h3>
 <ul>
 <li>Abstraction - Provides an abstraction around how metrics are collected and how
   they are reported and consumed. Most of the code would only be concerned with
   collecting interesting data. How it gets consumed or reported is implementation 
-  detail</li>
+  detail.</li>
 <li>Ability to turnoff stats collection - We can easily turn off data collection
-  by switching to NOOP variant of <code>MetricService</code> in case it starts adding appreciable
-  overhead. Turning on and off can also be done on individual metric basis</li>
+  by switching to NOOP variant of <code>MetricsService</code> in case it starts adding appreciable
+  overhead. Turning on and off can also be done on individual metric basis.</li>
 </ul>
 <p>It also allows us to later extend the type of data collected. For e.g. we can also collect
-<a href="https://jackrabbit.apache.org/api/2.6/org/apache/jackrabbit/api/stats/TimeSeries.html">TimerSeries</a> type of data for each metric without modifying the caller logic</p>
+<a href="https://jackrabbit.apache.org/api/2.6/org/apache/jackrabbit/api/stats/TimeSeries.html">TimerSeries</a> type of data for each metric without modifying the caller logic.</p>
 <h3 id="access-to-dropwizard-metrics-api">Access to Dropwizard Metrics API<a class="headerlink" href="#access-to-dropwizard-metrics-api" title="Permanent link">&para;</a></h3>
 <p>Sling Metrics bundle also registers the <code>MetricRegistry</code> instance with OSGi service registry. 
-The instances registered has a service property <code>name</code> set to <code>sling</code> (so as allow distinguishing 
+The instance registered has a service property <code>name</code> set to <code>sling</code> (so as allow distinguishing 
 from any other registered <code>MetricRegistry</code> instance). It can be used to get direct access to Dropwizard 
-Metric API if required</p>
+Metric API if required.</p>
 <div class="codehilite"><pre><span class="nd">@Reference</span><span class="o">(</span><span class="n">target</span> <span class="o">=</span> <span class="s">&quot;(name=sling)&quot;</span><span class="o">)</span>
 <span class="kd">private</span> <span class="kd">volatile</span> <span class="n">MetricRegistry</span> <span class="n">dataSource</span><span class="o">;</span>
 </pre></div>
 
 
-<p>Also the wrapper Metric instance can be converted to actual instance via <code>adaptTo</code> calls</p>
+<p>Also the wrapper Metric instance can be converted to actual instance via <code>adaptTo</code> calls.</p>
 <div class="codehilite"><pre><span class="kn">import</span> <span class="nn">org.apache.sling.commons.metrics.Counter</span>
 
 <span class="n">Counter</span> <span class="n">counter</span> <span class="o">=</span> <span class="n">metricService</span><span class="o">.</span><span class="na">counter</span><span class="o">(</span><span class="s">&quot;login&quot;</span><span class="o">);</span>
@@ -203,10 +203,10 @@ Metric API if required</p>
 <h2 id="webconsole-plugin">WebConsole Plugin<a class="headerlink" href="#webconsole-plugin" title="Permanent link">&para;</a></h2>
 <p>A Web Console plugin is also provided which is accessible at 
 http://localhost:8080/system/console/slingmetrics. It lists down all registered
-metric instances and there state. </p>
+Metric instances and their state. </p>
 <p><img alt="Metric Plugin" src="/documentation/bundles/metric-web-console.png" /></p>
 <p>The plugin lists all Metric instances from any <code>MetricRegistry</code> instance found in 
-the service registry. If the <code>MetricRegistry</code> service has a <code>name</code> property defined
+the OSGi service registry. If the <code>MetricRegistry</code> service has a <code>name</code> property defined
 then that would be prefixed to the Metric names from that registry. This allows 
 use of same name in different registry instances.</p>
 <h2 id="installation">Installation<a class="headerlink" href="#installation" title="Permanent link">&para;</a></h2>
@@ -218,7 +218,7 @@ use of same name in different registry i
 <span class="nt">&lt;/dependency&gt;</span>
 </pre></div>
       <div class="timestamp" style="margin-top: 30px; font-size: 80%; text-align: right;">
-        Rev. 1723492 by chetanm on Thu, 7 Jan 2016 09:28:42 +0000
+        Rev. 1723811 by olli on Fri, 8 Jan 2016 22:30:37 +0000
       </div>
       <div class="trademarkFooter"> 
         Apache Sling, Sling, Apache, the Apache feather logo, and the Apache Sling project