From 18dcf31aa67f71bce6ae7415fd2d8477ebd3dcda Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 3 Jan 2017 16:59:53 -0800 Subject: [PATCH] Polish documentation formatting --- .../src/main/asciidoc/build-tool-plugins.adoc | 2 +- spring-boot-docs/src/main/asciidoc/howto.adoc | 12 +- .../asciidoc/production-ready-features.adoc | 156 +++++++++--------- .../src/main/asciidoc/using-spring-boot.adoc | 4 +- 4 files changed, 87 insertions(+), 87 deletions(-) diff --git a/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc b/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc index ad5c3ea1bb7..999ba86e1d3 100644 --- a/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc +++ b/spring-boot-docs/src/main/asciidoc/build-tool-plugins.adoc @@ -545,7 +545,7 @@ buildscript { } springBoot { - layoutFactory = new com.example.CustomLayoutFactory() + layoutFactory = new com.example.CustomLayoutFactory() } ---- diff --git a/spring-boot-docs/src/main/asciidoc/howto.adoc b/spring-boot-docs/src/main/asciidoc/howto.adoc index d6c36eeddfe..a5ae46e926a 100644 --- a/spring-boot-docs/src/main/asciidoc/howto.adoc +++ b/spring-boot-docs/src/main/asciidoc/howto.adoc @@ -177,12 +177,12 @@ element): [source,xml,indent=0] ---- - - - src/main/resources - true - - + + + src/main/resources + true + + ---- and (inside ``): diff --git a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc index a539f049f95..3e43225282a 100644 --- a/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc +++ b/spring-boot-docs/src/main/asciidoc/production-ready-features.adoc @@ -1236,19 +1236,19 @@ Example: [source,java,indent=0] ---- -@Bean -@ExportMetricWriter -MetricWriter metricWriter(MetricExportProperties export) { - return new RedisMetricRepository(connectionFactory, - export.getRedis().getPrefix(), export.getRedis().getKey()); -} + @Bean + @ExportMetricWriter + MetricWriter metricWriter(MetricExportProperties export) { + return new RedisMetricRepository(connectionFactory, + export.getRedis().getPrefix(), export.getRedis().getKey()); + } ---- .application.properties -[source,properties] +[source,properties,indent=0] ---- -spring.metrics.export.redis.prefix: metrics.mysystem.${spring.application.name:application}.${random.value:0000} -spring.metrics.export.redis.key: keys.metrics.mysystem + spring.metrics.export.redis.prefix: metrics.mysystem.${spring.application.name:application}.${random.value:0000} + spring.metrics.export.redis.key: keys.metrics.mysystem ---- The prefix is constructed with the application name and id at the end, so it can easily be used @@ -1287,21 +1287,21 @@ Example: [source,indent=0] ---- -curl localhost:4242/api/query?start=1h-ago&m=max:counter.status.200.root -[ - { - "metric": "counter.status.200.root", - "tags": { - "domain": "org.springframework.metrics", - "process": "b968a76" - }, - "aggregateTags": [], - "dps": { - "1430492872": 2, - "1430492875": 6 + curl localhost:4242/api/query?start=1h-ago&m=max:counter.status.200.root + [ + { + "metric": "counter.status.200.root", + "tags": { + "domain": "org.springframework.metrics", + "process": "b968a76" + }, + "aggregateTags": [], + "dps": { + "1430492872": 2, + "1430492875": 6 + } } - } -] + ] ---- @@ -1320,14 +1320,14 @@ Alternatively, you can provide a `@Bean` of type `StatsdMetricWriter` and mark i [source,java,indent=0] ---- -@Value("${spring.application.name:application}.${random.value:0000}") -private String prefix = "metrics"; + @Value("${spring.application.name:application}.${random.value:0000}") + private String prefix = "metrics"; -@Bean -@ExportMetricWriter -MetricWriter metricWriter() { - return new StatsdMetricWriter(prefix, "localhost", 8125); -} + @Bean + @ExportMetricWriter + MetricWriter metricWriter() { + return new StatsdMetricWriter(prefix, "localhost", 8125); + } ---- @@ -1343,11 +1343,11 @@ Example: [source,java,indent=0] ---- -@Bean -@ExportMetricWriter -MetricWriter metricWriter(MBeanExporter exporter) { - return new JmxMetricWriter(exporter); -} + @Bean + @ExportMetricWriter + MetricWriter metricWriter(MBeanExporter exporter) { + return new JmxMetricWriter(exporter); + } ---- Each metric is exported as an individual MBean. The format for the `ObjectNames` is given @@ -1374,24 +1374,24 @@ Example: [source,java,indent=0] ---- - @Autowired - private MetricExportProperties export; + @Autowired + private MetricExportProperties export; - @Bean - public PublicMetrics metricsAggregate() { - return new MetricReaderPublicMetrics(aggregatesMetricReader()); - } + @Bean + public PublicMetrics metricsAggregate() { + return new MetricReaderPublicMetrics(aggregatesMetricReader()); + } - private MetricReader globalMetricsForAggregation() { - return new RedisMetricRepository(this.connectionFactory, - this.export.getRedis().getAggregatePrefix(), this.export.getRedis().getKey()); - } + private MetricReader globalMetricsForAggregation() { + return new RedisMetricRepository(this.connectionFactory, + this.export.getRedis().getAggregatePrefix(), this.export.getRedis().getKey()); + } - private MetricReader aggregatesMetricReader() { - AggregateMetricReader repository = new AggregateMetricReader( - globalMetricsForAggregation()); - return repository; - } + private MetricReader aggregatesMetricReader() { + AggregateMetricReader repository = new AggregateMetricReader( + globalMetricsForAggregation()); + return repository; + } ---- NOTE: The example above uses `MetricExportProperties` to inject and extract the key and @@ -1455,34 +1455,34 @@ and obtain basic information about the last 100 requests: [source,json,indent=0] ---- -[{ - "timestamp": 1394343677415, - "info": { - "method": "GET", - "path": "/trace", - "headers": { - "request": { - "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", - "Connection": "keep-alive", - "Accept-Encoding": "gzip, deflate", - "User-Agent": "Mozilla/5.0 Gecko/Firefox", - "Accept-Language": "en-US,en;q=0.5", - "Cookie": "_ga=GA1.1.827067509.1390890128; ..." - "Authorization": "Basic ...", - "Host": "localhost:8080" - }, - "response": { - "Strict-Transport-Security": "max-age=31536000 ; includeSubDomains", - "X-Application-Context": "application:8080", - "Content-Type": "application/json;charset=UTF-8", - "status": "200" - } - } - } - },{ - "timestamp": 1394343684465, - ... - }] + [{ + "timestamp": 1394343677415, + "info": { + "method": "GET", + "path": "/trace", + "headers": { + "request": { + "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", + "Connection": "keep-alive", + "Accept-Encoding": "gzip, deflate", + "User-Agent": "Mozilla/5.0 Gecko/Firefox", + "Accept-Language": "en-US,en;q=0.5", + "Cookie": "_ga=GA1.1.827067509.1390890128; ..." + "Authorization": "Basic ...", + "Host": "localhost:8080" + }, + "response": { + "Strict-Transport-Security": "max-age=31536000 ; includeSubDomains", + "X-Application-Context": "application:8080", + "Content-Type": "application/json;charset=UTF-8", + "status": "200" + } + } + } + },{ + "timestamp": 1394343684465, + ... + }] ---- diff --git a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc index 0048640e675..374f4ba891d 100644 --- a/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc +++ b/spring-boot-docs/src/main/asciidoc/using-spring-boot.adoc @@ -1123,8 +1123,8 @@ Cloud Foundry you can add the following to your `manifest.yml`: [source,yaml,indent=0] ---- --- - env: - JAVA_OPTS: "-Xdebug -Xrunjdwp:server=y,transport=dt_socket,suspend=n" + env: + JAVA_OPTS: "-Xdebug -Xrunjdwp:server=y,transport=dt_socket,suspend=n" ---- TIP: Notice that you don't need to pass an `address=NNNN` option to `-Xrunjdwp`. If