Skip to content

Commit 28a5b51

Browse files
authored
Merge pull request #8774 from loicmathieu/doc/fix-extension-guide-code-format
Fix some code format issue on the extension author guide
2 parents 3defba8 + f71162a commit 28a5b51

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

docs/src/main/asciidoc/writing-extensions.adoc

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1385,7 +1385,7 @@ The metric name of all metrics should start with a short name of the extension t
13851385

13861386
An example build step for build-time registration of metrics:
13871387

1388-
[source%nowrap.java]
1388+
[source%nowrap,java]
13891389
----
13901390
@BuildStep
13911391
void registerMetrics(BuildProducer<MetricBuildItem> metrics) {
@@ -1409,7 +1409,7 @@ In this example, there is a gauge per each data source that shows the current nu
14091409
In this example, we provide an object that implements the logic of the metric, in the case of a gauge,
14101410
it needs to implement `org.eclipse.microprofile.metrics.Gauge`. Example:
14111411

1412-
[source%nowrap.java]
1412+
[source%nowrap,java]
14131413
----
14141414
public class ActiveCountGauge implements Gauge<Long> {
14151415
@@ -1444,7 +1444,7 @@ Look into the `AgroalProcessor#registerMetrics` method for an example how this w
14441444
In this case, the dependency setup and build-time registration is the same as in case 2. The difference will be that instead of introducing
14451445
custom metric objects that bridge between library-specific metrics and MP Metrics, the extension's code will contain metric collection code like this:
14461446

1447-
[source%nowrap.java]
1447+
[source%nowrap,java]
14481448
----
14491449
public void methodThatShouldBeCounted() {
14501450
if(metricsEnabled) {
@@ -1465,6 +1465,7 @@ because that would fail. The extension itself will need to provide such check, a
14651465
The recommended way to implement this check would be to produce a specific `SystemPropertyBuildItem` during build, which will make it easy
14661466
to evaluate these two conditions, and then check back to this system property at runtime. Example:
14671467

1468+
[source%nowrap,java]
14681469
----
14691470
@BuildStep
14701471
SystemPropertyBuildItem produceMetricsEnabledProperty(AgroalBuildTimeConfig extensionSpecificConfig,

0 commit comments

Comments
 (0)