From 91f2ad4c4fe48e5e5de0bffd4a3b58775d5add3d Mon Sep 17 00:00:00 2001 From: "stu126940@mail.uni-kiel.de" <stu126940@mail.uni-kiel.de> Date: Thu, 15 Apr 2021 09:48:02 +0200 Subject: [PATCH] Enhance KDoc --- .../src/main/kotlin/theodolite/util/Parser.kt | 1 + .../theodolite/util/PrometheusResponse.kt | 29 ++++++++++++++----- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/Parser.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/Parser.kt index a5734b5ed..e435b1cbb 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/Parser.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/Parser.kt @@ -2,6 +2,7 @@ package theodolite.util /** * Interface for parsers. + * A parser allows the reading of files and creates a corresponding object from them. */ interface Parser { /** diff --git a/theodolite-quarkus/src/main/kotlin/theodolite/util/PrometheusResponse.kt b/theodolite-quarkus/src/main/kotlin/theodolite/util/PrometheusResponse.kt index 1a9032d9b..d1d59c482 100644 --- a/theodolite-quarkus/src/main/kotlin/theodolite/util/PrometheusResponse.kt +++ b/theodolite-quarkus/src/main/kotlin/theodolite/util/PrometheusResponse.kt @@ -3,13 +3,18 @@ package theodolite.util import io.quarkus.runtime.annotations.RegisterForReflection /** - * Description of a Prometheus response. - * - * Based on [PromData] + * This class corresponds to the JSON response format of a Prometheus + * [range-query](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-queries) */ @RegisterForReflection data class PrometheusResponse( + /** + * Indicates whether the query was successful. + */ var status: String? = null, + /** + * The data section of the query result contains the information about the resultType and the values itself. + */ var data: PromData? = null ) @@ -20,23 +25,33 @@ data class PrometheusResponse( */ @RegisterForReflection data class PromData( + /** + * Type of the result, either "matrix" | "vector" | "scalar" | "string" + */ var resultType: String? = null, + /** + * Result of the range-query. In the case of range-query this corresponds to the [range-vectors result format](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-vectors) + */ var result: List<PromResult>? = null ) /** - * Description of a Prometheus result. - * - * Based on [PromMetric] + * PromResult corresponds to the [range-vectors result format](https://www.prometheus.io/docs/prometheus/latest/querying/api/#range-vectors) */ @RegisterForReflection data class PromResult( + /** + * Label of the metric + */ var metric: PromMetric? = null, + /** + * Values of the metric (e.g. [ [ <unix_time>, "<sample_value>" ], ... ]) + */ var values: List<Any>? = null ) /** - * Description of a query in PromQL. + * Corresponds to the metric field in the range-vector result format of a Prometheus range-query response. */ @RegisterForReflection data class PromMetric( -- GitLab