This is an automated email from the ASF dual-hosted git repository.
dblevins pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomee.git
The following commit(s) were added to refs/heads/master by this push:
new 72cea85 [TOMEE-2682] Translate MicroProfile Metrics Timed Example to
Spanish
new a376731 Merge pull request #573 from cchacin/TOMEE-2682
72cea85 is described below
commit 72cea8598b7a42c4870f0d0947d51cefc6be2dc1
Author: Carlos Chacin <[email protected]>
AuthorDate: Sat Sep 14 11:01:15 2019 -0700
[TOMEE-2682] Translate MicroProfile Metrics Timed Example to Spanish
---
examples/mp-metrics-timed/README.adoc | 65 +++++-----
.../{README.adoc => README_es.adoc} | 132 ++++++++++++---------
2 files changed, 110 insertions(+), 87 deletions(-)
diff --git a/examples/mp-metrics-timed/README.adoc
b/examples/mp-metrics-timed/README.adoc
index 29576ea..51b4af2 100644
--- a/examples/mp-metrics-timed/README.adoc
+++ b/examples/mp-metrics-timed/README.adoc
@@ -7,33 +7,37 @@ This is an example on how to use MicroProfile metrics in
TomEE.
== Run the application:
-....
-mvn clean install tomee:run
-....
+[source,bash]
+----
+$ mvn clean install tomee:run
+----
Within the application there is an endpoint that will give you the
weather status for the day.
== For the day status call:
-....
-GET http://localhost:8080/mp-metrics-timed/weather/day/status
-....
+[source,bash]
+----
+$ curl -X GET http://localhost:8080/mp-metrics-timed/weather/day/status
+----
== Response:
-....
+[source,text]
+----
Hi, today is a sunny day!
-....
+----
== Timed Feature
MicroProfile Metrics has a feature that tracks the time of an event.
To use this feature you need to annotate the JAX-RS resource method with
-@Timed.
+`@Timed`.
-....
+[source,java]
+----
@Path("/weather")
@ApplicationScoped
public class WeatherService {
@@ -49,9 +53,9 @@ public class WeatherService {
}
...
}
-....
+----
-There are some configurations, as part of @Timed, that you need to know:
+There are some configurations, as part of `@Timed`, that you need to know:
*String name* Optional. Sets the name of the metric. If not explicitly
given the name of the annotated object is used.
@@ -68,7 +72,7 @@ metadata.
*String[] tags* Optional. Array of Strings in the = format to supply
special tags to a metric.
-*String unit* Unit of the metric. Default for @Timed is nanoseconds.
+*String unit* Unit of the metric. Default for `@Timed` is nanoseconds.
== Metric data
@@ -76,13 +80,15 @@ Check the timed metric doing a _GET_ request:
=== Prometheus format:
-....
-GET
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_status
-....
+[source,bash]
+----
+$curl -X GET
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_status
+----
=== Response:
-....
+[source,text]
+----
# TYPE application:weather_day_status_seconds summary timer
# TYPE application:weather_day_status_seconds_count timer
application:weather_day_status_seconds_count 1.0
@@ -114,13 +120,14 @@ application:weather_day_status_seconds{quantile="0.98"}
48352.0
application:weather_day_status_seconds{quantile="0.99"} 48352.0
# TYPE application:weather_day_status_seconds timer
application:weather_day_status_seconds{quantile="0.999"} 48352.0
-....
+----
=== JSON Format:
-For json format add the header _Accept=application/json_ to the request.
+For json format add the header `Accept: application/json` to the request.
-....
+[source,javascript]
+----
{
"weather_day_status": {
"count": 1,
@@ -140,24 +147,26 @@ For json format add the header _Accept=application/json_
to the request.
"stddev": 0
}
}
-....
+----
== Metric metadata
A metric will have metadata so you can know more about it, like
-displayName, description, tags e etc.
+`displayName`, `description`, `tags`, etc.
Check the metric metadata doing a _OPTIONS_ request:
=== Request
-....
-OPTIONS
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_status
-....
+[source,bash]
+----
+$ curl -X OPTIONS
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_status
+----
=== Response:
-....
+[source,javascript]
+----
{
"weather_day_status": {
"description": "This metric shows the weather status of the day.",
@@ -170,7 +179,7 @@ OPTIONS
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_s
"unit": "nanoseconds"
}
}
-....
+----
-You can also try it out using the WeatherServiceTest.java available in
+You can also try it out using the `WeatherServiceTest.java` available in
the project.
diff --git a/examples/mp-metrics-timed/README.adoc
b/examples/mp-metrics-timed/README_es.adoc
similarity index 55%
copy from examples/mp-metrics-timed/README.adoc
copy to examples/mp-metrics-timed/README_es.adoc
index 29576ea..7141445 100644
--- a/examples/mp-metrics-timed/README.adoc
+++ b/examples/mp-metrics-timed/README_es.adoc
@@ -1,39 +1,44 @@
-= MicroProfile Metrics Timed
+= Métricas con MicroProfile `@Timed`
:index-group: MicroProfile
:jbake-type: page
:jbake-status: published
-This is an example on how to use MicroProfile metrics in TomEE.
+Este es un ejemplo sobre cómo utilizar las métricas de microperfil en TomEE.
-== Run the application:
+== Ejecute la aplicación:
-....
-mvn clean install tomee:run
-....
+[source,bash]
+----
+$ mvn clean install tomee:run
+----
-Within the application there is an endpoint that will give you the
-weather status for the day.
+Dentro de la aplicación, hay un endpoint que te dará el estado del clima para
+el día.
-== For the day status call:
+== Obtenga el clima para la día:
-....
-GET http://localhost:8080/mp-metrics-timed/weather/day/status
-....
+[source,bash]
+----
+$ curl -X GET http://localhost:8080/mp-metrics-timed/weather/day/status
+----
-== Response:
+== Respuesta:
-....
+[source,text]
+----
Hi, today is a sunny day!
-....
+----
-== Timed Feature
+== Usando `@Timed`
-MicroProfile Metrics has a feature that tracks the time of an event.
+Las métricas de MicroProfile tienen una función que se puede usar para tracker
+el tiempo de un evento.
-To use this feature you need to annotate the JAX-RS resource method with
-@Timed.
+Para utilizar esta función, debe anotar los métodos de los recursos JAX-RS con
+`@Timed`.
-....
+[source,java]
+----
@Path("/weather")
@ApplicationScoped
public class WeatherService {
@@ -49,40 +54,43 @@ public class WeatherService {
}
...
}
-....
+----
-There are some configurations, as part of @Timed, that you need to know:
+Hay algunas configuraciones, como parte de `@Timed`, que necesita saber:
-*String name* Optional. Sets the name of the metric. If not explicitly
-given the name of the annotated object is used.
+*String name* Opcional. Establece el nombre de la métrica. Si no se proporciona
+explícitamente, se utiliza el nombre del objeto anotado.
-*boolean absolute* If true, uses the given name as the absolute name of
-the metric. If false, prepends the package name and class name before
-the given name. Default value is false.
+*boolean absolute* Si es verdadero, usa el nombre dado como el nombre absoluto
+de la métrica. Si es falso, antepone el nombre del paquete y el nombre de la
+clase antes del nombre dado. El valor predeterminado es falso.
-*String displayName* Optional. A human readable display name for
-metadata.
+*String displayName* Opcional. Un nombre para mostrar legible para los
+metadatos.
-*String description* Optional. A description of the metric.
+*String description* Opcional. Una descripción de la métrica.
-*String[] tags* Optional. Array of Strings in the = format to supply
-special tags to a metric.
+*String[] tags* Opcional. Matriz de cadenas en el formato = para suministrar
+etiquetas especiales a una métrica.
-*String unit* Unit of the metric. Default for @Timed is nanoseconds.
+*String unit* Unidad de la métrica. El valor por defecto para `@Timed` es
+nanosegundos.
-== Metric data
+== Datos de la Métrica
-Check the timed metric doing a _GET_ request:
+Verifique la métrica del contador haciendo una solicitud _GET_:
-=== Prometheus format:
+=== Formato Prometheus:
-....
-GET
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_status
-....
+[source,bash]
+----
+$curl -X GET
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_status
+----
-=== Response:
+=== Respuesta Prometheus:
-....
+[source,text]
+----
# TYPE application:weather_day_status_seconds summary timer
# TYPE application:weather_day_status_seconds_count timer
application:weather_day_status_seconds_count 1.0
@@ -114,13 +122,17 @@ application:weather_day_status_seconds{quantile="0.98"}
48352.0
application:weather_day_status_seconds{quantile="0.99"} 48352.0
# TYPE application:weather_day_status_seconds timer
application:weather_day_status_seconds{quantile="0.999"} 48352.0
-....
+----
-=== JSON Format:
+=== Formato JSON:
-For json format add the header _Accept=application/json_ to the request.
+Para el formato json, agregue el encabezado `Accept: application/json` a la
+solicitud HTTP.
-....
+=== Respuesta JSON:
+
+[source,javascript]
+----
{
"weather_day_status": {
"count": 1,
@@ -140,24 +152,26 @@ For json format add the header _Accept=application/json_
to the request.
"stddev": 0
}
}
-....
+----
-== Metric metadata
+== Metadatos Métrica
-A metric will have metadata so you can know more about it, like
-displayName, description, tags e etc.
+Una métrica tendrá metadatos para que pueda conocer más información al
+respecto, como `displayName`,`description`, `tags`, etc.
-Check the metric metadata doing a _OPTIONS_ request:
+Verifique los metadatos de la métrica haciendo una solicitud HTTP _OPTIONS_:
-=== Request
+=== Solicitud HTTP _OPTIONS_
-....
-OPTIONS
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_status
-....
+[source,bash]
+----
+$ curl -X OPTIONS
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_status
+----
-=== Response:
+=== Respuesta:
-....
+[source,javascript]
+----
{
"weather_day_status": {
"description": "This metric shows the weather status of the day.",
@@ -170,7 +184,7 @@ OPTIONS
http://localhost:8080/mp-metrics-timed/metrics/application/weather_day_s
"unit": "nanoseconds"
}
}
-....
+----
-You can also try it out using the WeatherServiceTest.java available in
-the project.
+También puede probarlo utilizando `WeatherServiceTest.java` disponible en el
+proyecto.