Skip to content

Commit 80fd0d6

Browse files
committed
Fix up javadoc for java 1.8, as it's stricter.
1 parent 408e23c commit 80fd0d6

10 files changed

Lines changed: 33 additions & 34 deletions

File tree

client/src/main/java/io/prometheus/client/Prometheus.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
*
4848
* <p>
4949
* You can apply the patterns from examples in the following classes' Javadocs:
50+
* </p>
5051
* <ul>
5152
* <li>
5253
* {@link Counter}</li>
@@ -55,7 +56,6 @@
5556
* <li>
5657
* {@link Summary}</li>
5758
* </ul>
58-
* </p>
5959
*
6060
* <em>Important:</em> To initialize the whole stack, call
6161
* {@link Prometheus#defaultInitialize()} <em>once</em> somewhere in your main
@@ -259,6 +259,7 @@ private void runPreexpositionHooks() {
259259
*
260260
* <p>
261261
* Important Usage Notes:
262+
* </p>
262263
*
263264
* <ul>
264265
* <li>Calling this is a <em>prerequisite</em> for successful Prometheus
@@ -267,7 +268,6 @@ private void runPreexpositionHooks() {
267268
* class' main block.</li>
268269
* <li>While idempotent, it should be called only once.</li>
269270
* </ul>
270-
* </p>
271271
*
272272
*/
273273
public static void defaultInitialize() {

client/src/main/java/io/prometheus/client/metrics/Counter.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,12 @@ public static Builder newBuilder() {
153153
* </p>
154154
* <p>
155155
* Implementation-Specific Behaviors:
156+
* </p>
156157
* <ul>
157158
* <li>
158159
* If the metric and its children are reset, a default value of {@code 0} is
159160
* used.</li>
160161
* </ul>
161-
* </p>
162162
* <p>
163163
* For all other behaviors, see {@link Metric.BaseBuilder}.
164164
* </p>
@@ -413,7 +413,7 @@ public void reset() {
413413

414414
/**
415415
* <p>
416-
* Used to serialize {@link Counter} instances for {@link Gson}.
416+
* Used to serialize {@link Counter} instances for Gson.
417417
* </p>
418418
*/
419419
@Deprecated

client/src/main/java/io/prometheus/client/metrics/Gauge.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ public static Builder newBuilder() {
163163
* </p>
164164
* <p>
165165
* Implementation-Specific Behaviors:
166+
* </p>
166167
* <ul>
167168
* <li>
168169
* If the metric and its children are reset, a default value of {@code 0} is
169170
* used.</li>
170171
* </ul>
171-
* </p>
172172
* <p>
173173
* For all other behaviors, see {@link Metric.BaseBuilder}.
174174
* </p>

client/src/main/java/io/prometheus/client/metrics/Metric.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ public static interface Builder<B, M> {
144144
* <p>
145145
* For example, you have provided {@link Metric}'s
146146
* {@link Metric.BaseBuilder} with the following parameters:
147+
* </p>
147148
*
148149
* <ul>
149150
* <li>
@@ -155,6 +156,7 @@ public static interface Builder<B, M> {
155156
* {@code name = "efficiency_percentage"}</li>
156157
* </ul>
157158
*
159+
* <p>
158160
* The {@link Metric}'s naming system generates the following composite
159161
* metric name: {@code seaworld_water_heaters_efficiency_percentage}. The
160162
* namespace is <em>seaworld</em>.
@@ -188,6 +190,7 @@ public static interface Builder<B, M> {
188190
* {@code name = "efficiency_percentage"}</li>
189191
* </ul>
190192
*
193+
* <p>
191194
* The {@link Metric}'s naming system generates the following composite
192195
* metric name: {@code seaworld_water_heaters_efficiency_percentage} . The
193196
* subsystem is <em>water_heaters</em>.
@@ -210,6 +213,7 @@ public static interface Builder<B, M> {
210213
* <p>
211214
* For example, you have provided {@link Metric}'s
212215
* {@link Metric.BaseBuilder} with the following parameters:
216+
* </p>
213217
*
214218
* <ul>
215219
* <li>
@@ -220,6 +224,7 @@ public static interface Builder<B, M> {
220224
* {@code name = "efficiency_percentage"}</li>
221225
* </ul>
222226
*
227+
* <p>
223228
* The {@link Metric}'s naming system generates the following composite
224229
* metric name: {@code seaworld_water_heaters_efficiency_percentage} . The
225230
* name is <em>efficiency_percentage</em>.
@@ -276,23 +281,23 @@ public static interface Builder<B, M> {
276281
*
277282
* <p>
278283
* The following are use cases for setting this to {@code true}:
284+
* </p>
279285
* <ul>
280286
* <li>
281287
* Runtimes where <em>runtime-retained annotations neither respected
282288
* nor supported</em>, meaning {@link io.prometheus.client.Register} cannot
283289
* be used and you wish to not explicitly register the metrics yourself.</li>
284290
* </ul>
285-
* </p>
286291
* <p>
287292
* The following are use cases for setting this to {@code false}:
293+
* </p>
288294
* <ul>
289295
* <li>
290296
* Preventing static side-effects from tests.</li>
291297
* <li>
292298
* Respecting dependency injection paradigms. Be sure to explicitly use
293299
* {@link Prometheus#defaultRegister(Metric)}.</li>
294300
* </ul>
295-
* </p>
296301
*
297302
* @return A <em>copy</em> of the original {@link Builder} with the new
298303
* target value.
@@ -428,7 +433,6 @@ List<String> buildLabelNames() {
428433
* An example follows:
429434
* </p>
430435
*
431-
* <code>
432436
* <pre>
433437
* public class InvitationHandler {
434438
* public static Summary latencies =
@@ -494,13 +498,11 @@ List<String> buildLabelNames() {
494498
* public static class DeleteReq {}
495499
* }
496500
* </pre>
497-
* </code>
498501
*
499502
* <p>
500503
* Assuming each code path is hit twice, {@code latencies} could yield the
501504
* following child metrics:
502505
* </p>
503-
* <code>
504506
* <pre>
505507
* request_latency_ms{operation="create", result="success", shard="a", quantile="0.5"} = ?
506508
* request_latency_ms{operation="create", result="success", shard="a", quantile="0.99"} = ?
@@ -527,12 +529,10 @@ List<String> buildLabelNames() {
527529
* request_latency_ms{operation="delete", result="unknown_error", shard="b", quantile="0.5"} = ?
528530
* request_latency_ms{operation="delete", result="unknown_error", shard="b", quantile="0.99"} = ?
529531
* </pre>
530-
* </code>
531532
*
532533
* <p>
533534
* {@code latencies} also yields supplemental synthetic children:
534535
* </p>
535-
* <code>
536536
* <pre>
537537
* request_latency_ms_count{operation="create", result="success", shard="a"} = 1
538538
* request_latency_ms_count{operation="create", result="success", shard="b"} = 1
@@ -560,17 +560,16 @@ List<String> buildLabelNames() {
560560
* request_latency_ms_sum{operation="delete", result="unknown_error", shard="a"} = ?
561561
* request_latency_ms_sum{operation="delete", result="unknown_error", shard="b"} = ?
562562
* </pre>
563-
* </code>
564563
* <p>
565564
* <em>Important</em>:
565+
* </p>
566566
* <ul>
567567
* <li>
568568
* If there is a mismatch between the number of labels that have been
569569
* accumulated with {@link #labelPair(String, String)} and those defined in
570570
* the underlying {@code Builder#labelNames}, a runtime exception will
571571
* occur, signifying illegal use.</li>
572572
* </ul>
573-
* </p>
574573
*/
575574
@NotThreadSafe
576575
public abstract class Partial {

examples/jvmstat/src/main/java/io/prometheus/client/examples/jvmstat/Main.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
*
2727
* <p>
2828
* This example builds strongly on the one found in the <em>guice</em> workflow in that it adds
29-
* an extra {@link Prometheus.ExpositionHook} through the use of a {@link
29+
* an extra {@link io.prometheus.client.Prometheus.ExpositionHook} through the use of a {@link
3030
* com.google.inject.multibindings.Multibinder} found in {@link
3131
* io.prometheus.client.examples.jvmstat.Module}.
3232
* </p>

simpleclient/src/main/java/io/prometheus/client/CollectorRegistry.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class CollectorRegistry {
2929

3030
/**
3131
* Register a Collector.
32-
* </p>
32+
* <p>
3333
* A collector can be registered to multiple CollectorRegistries.
3434
*/
3535
public void register(Collector m) {
@@ -96,7 +96,7 @@ public boolean hasMoreElements() {
9696

9797
/**
9898
* Returns the given value, or null if it doesn't exist.
99-
* </p>
99+
* <p>
100100
* This is inefficient, and intended only for use in unittests.
101101
*/
102102
public Double getSampleValue(String name) {
@@ -105,7 +105,7 @@ public Double getSampleValue(String name) {
105105

106106
/**
107107
* Returns the given value, or null if it doesn't exist.
108-
* </p>
108+
* <p>
109109
* This is inefficient, and intended only for use in unittests.
110110
*/
111111
public Double getSampleValue(String name, String[] labelNames, String[] labelValues) {

simpleclient/src/main/java/io/prometheus/client/Gauge.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,9 @@
5656
* }
5757
* }
5858
* </pre>
59+
* <p>
5960
* These can be aggregated and processed together much more easily in the Prometheus
6061
* server than individual metrics for each labelset.
61-
* </p>
6262
*/
6363
public class Gauge extends SimpleCollector<Gauge.Child, Gauge> {
6464

@@ -221,7 +221,7 @@ public void setToCurrentTime() {
221221
* Start a timer to track a duration, for the gauge with no labels.
222222
* <p>
223223
* This is primarily useful for tracking the durations of major steps of batch jobs,
224-
* which are then pushed with {@link PushGateway}.
224+
* which are then pushed with {@link io.prometheus.client.exporter.PushGateway}.
225225
* For tracking other durations/latencies you should usually use a {@link Summary}.
226226
* <p>
227227
* Call {@link Timer#setDuration} at the end of what you want to measure the duration of.

simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
* <em>Warning #2:</em> While labels are very powerful, avoid overly granular metric labels.
3939
* The combinatorial explosion of breaking out a metric in many dimensions can produce huge numberts
4040
* of timeseries, which will then take longer and more resources to process.
41-
* <br/>
41+
* <p>
4242
* As a rule of thumb aim to keep the cardinality of metrics below ten, and limit where the
4343
* cardinality exceeds that value. For example rather than breaking out latency
4444
* by customer and endpoint in one metric, you might have two metrics with one breaking out

utility/hotspot/src/main/java/io/prometheus/client/utility/hotspot/Hotspot.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
*
2929
* <p>
3030
* TODO(matt): There is a lot that can be added here with a day's work:
31+
* </p>
3132
* <ul>
3233
* <li>Managed Memory by Generation</li>
3334
* <li>Which Garbage Collector is Used by What Generation</li>
@@ -36,7 +37,6 @@
3637
* <li>Thread Statistics</li>
3738
* <li>Lock Statistics</li>
3839
* </ul>
39-
* </p>
4040
*
4141
* @author Matt T. Proud (matt.proud@gmail.com)
4242
* @see Prometheus#addPreexpositionHook(io.prometheus.client.Prometheus.ExpositionHook)

utility/jvmstat/src/main/java/io/prometheus/client/utility/jvmstat/JvmstatMonitor.java

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,11 @@
4646
* I/O (nio).
4747
* </p>
4848
*
49-
* <p>
5049
* <h1>Important Notes</h1>
50+
* <p>
5151
* Due to inconsistencies of virtual machine packages and vendoring, the following remarks should
5252
* be carefully observed:
53+
* </p>
5354
* <ul>
5455
* <li>
5556
* Users may need to explicitly add {@code ${JAVA_HOME}/lib/tools.jar} to the <em>CLASSPATH</em>
@@ -63,7 +64,6 @@
6364
* low-level telemetric export.
6465
* </li>
6566
* </ul>
66-
* </p>
6767
*
6868
* <p>
6969
* The metrics that this class exposes are dependent upon the release of HotSpot, including even
@@ -93,10 +93,10 @@ public class JvmstatMonitor implements Prometheus.ExpositionHook {
9393
private final ConcurrentHashMap<String, Monitor> monitors = new ConcurrentHashMap<String, Monitor>(400);
9494

9595
/**
96-
* <p>Create a {@link JvmstatMonitor} for the local virtual machine associated with this
97-
* specific Java server.</p>
96+
* Create a {@link JvmstatMonitor} for the local virtual machine associated with this
97+
* specific Java server.
9898
*
99-
* @throws {@link AttachmentError} if the VM cannot be attached to.
99+
* @throws AttachmentError if the VM cannot be attached to.
100100
*/
101101
public JvmstatMonitor() throws AttachmentError {
102102
this(getLocalVM());
@@ -425,7 +425,7 @@ private boolean visitClassEvents(final String name, final Monitor monitor) {
425425
* <li>
426426
* {@code thread}: The thread ID associated with the work.
427427
* </li>
428-
* <ul>
428+
* </ul>
429429
*
430430
* <h2>{@code jvmstat_jit_compilation_count}</h2>
431431
* This metric tracks the number of classes the JIT has compiled and potentially recompiled after
@@ -436,7 +436,7 @@ private boolean visitClassEvents(final String name, final Monitor monitor) {
436436
* <li>
437437
* {@code thread}: The thread ID associated with the work.
438438
* </li>
439-
* <ul>
439+
* </ul>
440440
*/
441441
public static class NativeCodeCompilerInstrumentation implements MonitorVisitor {
442442
// This class has public visibility solely for Javadoc production.
@@ -572,7 +572,7 @@ private boolean visitCompilations(final String name, final Monitor monitor) {
572572
* <li>
573573
* {@code generation}: The managed memory region name.
574574
* </li>
575-
* <ul>
575+
* </ul>
576576
*
577577
* <h2>{@code jvmstat_garbage_collection_duration_ms_total}</h2>
578578
* This metric tracks the amount of time spent spent collecting the respective generation.
@@ -581,7 +581,7 @@ private boolean visitCompilations(final String name, final Monitor monitor) {
581581
* <li>
582582
* {@code generation}: The managed memory region name.
583583
* </li>
584-
* <ul>
584+
* </ul>
585585
*/
586586
public static class GarbageCollectionInstrumentation implements MonitorVisitor {
587587
// This class has public visibility solely for Javadoc production.
@@ -688,23 +688,23 @@ private boolean visitDurations(final String name, final Monitor monitor) {
688688
* <li>
689689
* {@code generation}: The managed memory region name.
690690
* </li>
691-
* <ul>
691+
* </ul>
692692
*
693693
* <h2>{@code jvmstat_managed_memory_generation_usage_bytes}</h2>
694694
* <h3>Metric Dimensions</h3>
695695
* <ul>
696696
* <li>
697697
* {@code generation}: The managed memory region name.
698698
* </li>
699-
* <ul>
699+
* </ul>
700700
*
701701
* <h2>{@code jvmstat_managed_memory_survivor_space_agetable_size_bytes}</h2>
702702
* <h3>Metric Dimensions</h3>
703703
* <ul>
704704
* <li>
705705
* {@code cohort}: The agetable cohort. (TODO: Discuss the agetable design.)
706706
* </li>
707-
* <ul>
707+
* </ul>
708708
*
709709
* <h2>{@code jvmstat_managed_memory_survivor_space_agetable_count}</h2>
710710
*(TODO: Discuss the agetable design.)

0 commit comments

Comments
 (0)