Skip to content

Commit

Permalink
Remove unnecessary function
Browse files Browse the repository at this point in the history
  • Loading branch information
christophhagen committed Oct 3, 2023
1 parent 932994d commit cc3c73c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 18 deletions.
8 changes: 0 additions & 8 deletions Sources/Clairvoyant/Metric/GenericMetric.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,6 @@ public protocol GenericMetric {
*/
func lastUpdate() async -> Date?

/**
Update a metric with data received from a remote
- Note: This function is only called if the remote is marked to track a remote metric
- Parameter data: The encoded data points, as an array of timestamped values
- Returns: A tuple with the number of data points in the provided data, and the timestamp of the current last value
*/
func addDataFromRemote(_ data: Data) async throws -> (added: Int, lastUpdate: Date?)

/**
The history of a metric in a specific range.
- Returns: The encoded data points, i.e. [Timestamped<T>]
Expand Down
10 changes: 0 additions & 10 deletions Sources/Clairvoyant/Metric/Metric.swift
Original file line number Diff line number Diff line change
Expand Up @@ -358,16 +358,6 @@ extension Metric: GenericMetric {
return await fileWriter.lastValueData()
}

public func addDataFromRemote(_ dataPoint: Data) async throws -> (added: Int, lastUpdate: Date?) {
let values = try fileWriter.decodeTimestampedValues(from: dataPoint)
try await update(values)
if let lastUpdate = values.last?.timestamp {
return (added: values.count, lastUpdate: lastUpdate)
} else {
return (added: values.count, lastUpdate: await lastUpdate())
}
}

/**
The history of a metric in a specific range.
- Returns: The encoded data points, i.e. [Timestamped<T>]
Expand Down

0 comments on commit cc3c73c

Please sign in to comment.