mosche commented on code in PR #22260:
URL: https://github.com/apache/beam/pull/22260#discussion_r957092728


##########
sdks/java/testing/test-utils/src/main/java/org/apache/beam/sdk/testutils/NamedTestResult.java:
##########
@@ -85,4 +85,17 @@ public String getMetric() {
   public double getValue() {
     return value;
   }
+
+  public Map<String, String> tags() {
+    return ImmutableMap.of("test_id", testId, "metric", metric);
+  }
+
+  public Map<String, Number> fields() {
+    return ImmutableMap.of("value", value);
+  }
+
+  /** Convert this result to InfluxDB data point. */
+  public InfluxDBPublisher.DataPoint toInfluxDBDataPoint(String measurement) {
+    return InfluxDBPublisher.dataPoint(measurement, tags(), fields(), null);

Review Comment:
   At the moment `timestamp` of `NamedTestResult` is ignored when writing to 
InfluxDB. TBH I'm not sure why, maybe it's incompatible with InfluxDB? For now 
I'd prefer to keep that as is to not introduce any potential problems.
   
   > timestamp: Time at which this result was sampled. Should be in a BigQuery 
supported timestamp format.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to