diff --git a/Sources/Clairvoyant/Metric/GenericMetric.swift b/Sources/Clairvoyant/Metric/GenericMetric.swift index ee868c4..38a4366 100644 --- a/Sources/Clairvoyant/Metric/GenericMetric.swift +++ b/Sources/Clairvoyant/Metric/GenericMetric.swift @@ -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] diff --git a/Sources/Clairvoyant/Metric/Metric.swift b/Sources/Clairvoyant/Metric/Metric.swift index b5e5744..9036b73 100644 --- a/Sources/Clairvoyant/Metric/Metric.swift +++ b/Sources/Clairvoyant/Metric/Metric.swift @@ -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]