]> git.proxmox.com Git - proxmox.git/commitdiff
metrics: more doc fixups
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 2 Feb 2022 13:30:14 +0000 (14:30 +0100)
committerWolfgang Bumiller <w.bumiller@proxmox.com>
Wed, 2 Feb 2022 13:30:14 +0000 (14:30 +0100)
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
proxmox-metrics/src/influxdb/http.rs
proxmox-metrics/src/influxdb/udp.rs
proxmox-metrics/src/lib.rs

index 51a4181ad53a24255ea6e4f0246b25e448ff4820..c10c55d381affafc16d32a2af6a031ee6061ef78 100644 (file)
@@ -36,8 +36,7 @@ pub async fn test_influxdb_http(
     this.test_connection().await
 }
 
-/// Returns a [Metrics] handle that connects and sends data to the
-/// given influxdb server at the given https url
+/// Get a [`Metrics`] handle for an influxdb server accessed via HTTPS.
 pub fn influxdb_http(
     uri: &str,
     organization: &str,
index b73eb594c8daff051bc81d77256f592b7fcc09b9..1c6cd6d5862d483ac5e35cd1b41d55a79690d9fa 100644 (file)
@@ -22,8 +22,7 @@ pub async fn test_influxdb_udp(address: &str) -> Result<(), Error> {
     Ok(())
 }
 
-/// Returns a [`Metrics`] handle that connects and sends data to the
-/// given influxdb server at the given udp address/port
+/// Get a [`Metrics`] handle for an influxdb server accessed via UDP.
 ///
 /// `address` must be in the format of `ip_or_hostname:port`
 pub fn influxdb_udp(address: &str, mtu: Option<u16>) -> Metrics {
index 9fb098ee3929d2e4b9975ed3b744cea275dc8da5..75c22e395c2e487f3782a85c93d2b65ab120b2a2 100644 (file)
@@ -11,20 +11,23 @@ mod influxdb;
 pub use influxdb::{influxdb_http, influxdb_udp, test_influxdb_http, test_influxdb_udp};
 
 #[derive(Clone)]
-/// Structured data for the metric server
+/// Structured data for the metric server.
 pub struct MetricsData {
-    /// The category of measurements
+    /// The category of measurements.
     pub measurement: String,
-    /// A list of to attach to the measurements
+
+    /// A list of to attach to the measurements.
     pub tags: HashMap<String, String>,
+
     /// The actual values to send. Only plain (not-nested) objects are supported at the moment.
     pub values: Value,
-    /// The time of the measurement
+
+    /// The time of the measurement.
     pub ctime: i64,
 }
 
 impl MetricsData {
-    /// Convenient helper to create from references
+    /// Convenient helper to create from references.
     pub fn new<V: Serialize>(
         measurement: &str,
         tags: &[(&str, &str)],
@@ -45,7 +48,7 @@ impl MetricsData {
     }
 }
 
-/// Helper to send a list of [MetricsData] to a list of [Metrics]
+/// Helper to send a list of [`MetricsData`] to a list of [`Metrics`].
 pub async fn send_data_to_channels(
     values: &[Arc<MetricsData>],
     connections: &[Metrics],
@@ -65,7 +68,7 @@ pub async fn send_data_to_channels(
 
 /// Represents connection to the metric server which can be used to send data
 ///
-/// You can send [MetricsData] by using [`Self::send_data()`], and to flush and
+/// You can send [`MetricsData`] by using [`Self::send_data()`], and to flush and
 /// finish the connection use [`Self::join`].
 ///
 /// If dropped, it will abort the connection and not flush out buffered data.