Polish documentation formatting

This commit is contained in:
Phillip Webb 2017-01-03 16:59:53 -08:00
parent b8d1fe3c84
commit 18dcf31aa6
4 changed files with 87 additions and 87 deletions

View File

@ -545,7 +545,7 @@ buildscript {
} }
springBoot { springBoot {
layoutFactory = new com.example.CustomLayoutFactory() layoutFactory = new com.example.CustomLayoutFactory()
} }
---- ----

View File

@ -177,12 +177,12 @@ element):
[source,xml,indent=0] [source,xml,indent=0]
---- ----
<resources> <resources>
<resource> <resource>
<directory>src/main/resources</directory> <directory>src/main/resources</directory>
<filtering>true</filtering> <filtering>true</filtering>
</resource> </resource>
</resources> </resources>
---- ----
and (inside `<plugins/>`): and (inside `<plugins/>`):

View File

@ -1236,19 +1236,19 @@ Example:
[source,java,indent=0] [source,java,indent=0]
---- ----
@Bean @Bean
@ExportMetricWriter @ExportMetricWriter
MetricWriter metricWriter(MetricExportProperties export) { MetricWriter metricWriter(MetricExportProperties export) {
return new RedisMetricRepository(connectionFactory, return new RedisMetricRepository(connectionFactory,
export.getRedis().getPrefix(), export.getRedis().getKey()); export.getRedis().getPrefix(), export.getRedis().getKey());
} }
---- ----
.application.properties .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.prefix: metrics.mysystem.${spring.application.name:application}.${random.value:0000}
spring.metrics.export.redis.key: keys.metrics.mysystem 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 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] [source,indent=0]
---- ----
curl localhost:4242/api/query?start=1h-ago&m=max:counter.status.200.root curl localhost:4242/api/query?start=1h-ago&m=max:counter.status.200.root
[ [
{ {
"metric": "counter.status.200.root", "metric": "counter.status.200.root",
"tags": { "tags": {
"domain": "org.springframework.metrics", "domain": "org.springframework.metrics",
"process": "b968a76" "process": "b968a76"
}, },
"aggregateTags": [], "aggregateTags": [],
"dps": { "dps": {
"1430492872": 2, "1430492872": 2,
"1430492875": 6 "1430492875": 6
}
} }
} ]
]
---- ----
@ -1320,14 +1320,14 @@ Alternatively, you can provide a `@Bean` of type `StatsdMetricWriter` and mark i
[source,java,indent=0] [source,java,indent=0]
---- ----
@Value("${spring.application.name:application}.${random.value:0000}") @Value("${spring.application.name:application}.${random.value:0000}")
private String prefix = "metrics"; private String prefix = "metrics";
@Bean @Bean
@ExportMetricWriter @ExportMetricWriter
MetricWriter metricWriter() { MetricWriter metricWriter() {
return new StatsdMetricWriter(prefix, "localhost", 8125); return new StatsdMetricWriter(prefix, "localhost", 8125);
} }
---- ----
@ -1343,11 +1343,11 @@ Example:
[source,java,indent=0] [source,java,indent=0]
---- ----
@Bean @Bean
@ExportMetricWriter @ExportMetricWriter
MetricWriter metricWriter(MBeanExporter exporter) { MetricWriter metricWriter(MBeanExporter exporter) {
return new JmxMetricWriter(exporter); return new JmxMetricWriter(exporter);
} }
---- ----
Each metric is exported as an individual MBean. The format for the `ObjectNames` is given Each metric is exported as an individual MBean. The format for the `ObjectNames` is given
@ -1374,24 +1374,24 @@ Example:
[source,java,indent=0] [source,java,indent=0]
---- ----
@Autowired @Autowired
private MetricExportProperties export; private MetricExportProperties export;
@Bean @Bean
public PublicMetrics metricsAggregate() { public PublicMetrics metricsAggregate() {
return new MetricReaderPublicMetrics(aggregatesMetricReader()); return new MetricReaderPublicMetrics(aggregatesMetricReader());
} }
private MetricReader globalMetricsForAggregation() { private MetricReader globalMetricsForAggregation() {
return new RedisMetricRepository(this.connectionFactory, return new RedisMetricRepository(this.connectionFactory,
this.export.getRedis().getAggregatePrefix(), this.export.getRedis().getKey()); this.export.getRedis().getAggregatePrefix(), this.export.getRedis().getKey());
} }
private MetricReader aggregatesMetricReader() { private MetricReader aggregatesMetricReader() {
AggregateMetricReader repository = new AggregateMetricReader( AggregateMetricReader repository = new AggregateMetricReader(
globalMetricsForAggregation()); globalMetricsForAggregation());
return repository; return repository;
} }
---- ----
NOTE: The example above uses `MetricExportProperties` to inject and extract the key and 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] [source,json,indent=0]
---- ----
[{ [{
"timestamp": 1394343677415, "timestamp": 1394343677415,
"info": { "info": {
"method": "GET", "method": "GET",
"path": "/trace", "path": "/trace",
"headers": { "headers": {
"request": { "request": {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8", "Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
"Connection": "keep-alive", "Connection": "keep-alive",
"Accept-Encoding": "gzip, deflate", "Accept-Encoding": "gzip, deflate",
"User-Agent": "Mozilla/5.0 Gecko/Firefox", "User-Agent": "Mozilla/5.0 Gecko/Firefox",
"Accept-Language": "en-US,en;q=0.5", "Accept-Language": "en-US,en;q=0.5",
"Cookie": "_ga=GA1.1.827067509.1390890128; ..." "Cookie": "_ga=GA1.1.827067509.1390890128; ..."
"Authorization": "Basic ...", "Authorization": "Basic ...",
"Host": "localhost:8080" "Host": "localhost:8080"
}, },
"response": { "response": {
"Strict-Transport-Security": "max-age=31536000 ; includeSubDomains", "Strict-Transport-Security": "max-age=31536000 ; includeSubDomains",
"X-Application-Context": "application:8080", "X-Application-Context": "application:8080",
"Content-Type": "application/json;charset=UTF-8", "Content-Type": "application/json;charset=UTF-8",
"status": "200" "status": "200"
} }
} }
} }
},{ },{
"timestamp": 1394343684465, "timestamp": 1394343684465,
... ...
}] }]
---- ----

View File

@ -1123,8 +1123,8 @@ Cloud Foundry you can add the following to your `manifest.yml`:
[source,yaml,indent=0] [source,yaml,indent=0]
---- ----
--- ---
env: env:
JAVA_OPTS: "-Xdebug -Xrunjdwp:server=y,transport=dt_socket,suspend=n" 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 TIP: Notice that you don't need to pass an `address=NNNN` option to `-Xrunjdwp`. If