-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Support tags/fields in Influx exporter
- Loading branch information
1 parent
0d5da64
commit b354858
Showing
3 changed files
with
76 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
Sources/Benchmark/BenchmarkExportConfigurations/InfluxExportConfiguration.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
public struct InfluxExportConfiguration: BenchmarkExportConfiguration { | ||
/// The set of benchmark tags to interpret as Influx fields. | ||
/// The default is to treat benchmark tags as Influx tags. | ||
public let fields: [String: InfluxDataType] | ||
|
||
public enum InfluxDataType: String, Codable { | ||
// References: https://docs.influxdata.com/influxdb/cloud/reference/syntax/annotated-csv/#data-types | ||
|
||
case boolean | ||
/// Unsigned 64-bit integer | ||
case unsignedLong | ||
/// Signed 64-bit integer | ||
case long | ||
/// IEEE-754 64-bit floating-point number | ||
case double | ||
/// UTF-8 encoded string | ||
case string | ||
/// Base64 encoded sequence of bytes as defined in RFC 4648 | ||
case base64Binary | ||
/// Instant in time, may be followed with a colon : and a description of the format (number, RFC3339, RFC3339Nano) | ||
case dateTime | ||
/// Length of time represented as an unsigned 64-bit integer number of nanoseconds | ||
case duration | ||
} | ||
|
||
public init(fields: [String: InfluxDataType]) { | ||
self.fields = fields | ||
} | ||
Check warning on line 28 in Sources/Benchmark/BenchmarkExportConfigurations/InfluxExportConfiguration.swift Codecov / codecov/patchSources/Benchmark/BenchmarkExportConfigurations/InfluxExportConfiguration.swift#L26-L28
|
||
} |