diff --git a/Sources/Histogram/Histogram.swift b/Sources/Histogram/Histogram.swift index d66eff7..5bd88d6 100644 --- a/Sources/Histogram/Histogram.swift +++ b/Sources/Histogram/Histogram.swift @@ -16,7 +16,7 @@ import Numerics /** * Number of significant digits for values recorded in histogram. */ -public enum SignificantDigits: Int8 { +public enum SignificantDigits: Int8, Codable { case zero, one, two, three, four, five } @@ -51,7 +51,7 @@ public enum HistogramOutputFormat { * they are encountered. Note that recording calls that cause auto-resizing may take longer to execute, as resizing * incurs allocation and copying of internal data structures. */ -public struct Histogram { +public struct Histogram: Codable { /// The lowest value that can be discerned (distinguished from 0) by the histogram. public let lowestDiscernibleValue: UInt64 diff --git a/Tests/HistogramTests/HistogramAutosizingTests.swift b/Tests/HistogramTests/HistogramAutosizingTests.swift index 1024de6..cc9a57c 100644 --- a/Tests/HistogramTests/HistogramAutosizingTests.swift +++ b/Tests/HistogramTests/HistogramAutosizingTests.swift @@ -65,7 +65,7 @@ final class HistogramAutosizingTests: XCTestCase { func testAutoSizingAdd() throws { var histogram1 = Histogram(numberOfSignificantValueDigits: .two) - var histogram2 = Histogram(numberOfSignificantValueDigits: .two) + // let histogram2 = Histogram(numberOfSignificantValueDigits: .two) histogram1.record(1_000) histogram1.record(1_000_000_000) @@ -74,8 +74,8 @@ final class HistogramAutosizingTests: XCTestCase { throw XCTSkip("Histogram.add() is not implemented yet") //histogram2.add(histogram1) - XCTAssert(histogram2.valuesAreEquivalent(histogram2.max, 1_000_000_000), - "Max should be equivalent to 1_000_000_000") + // XCTAssert(histogram2.valuesAreEquivalent(histogram2.max, 1_000_000_000), + // "Max should be equivalent to 1_000_000_000") } func testAutoSizingAcrossContinuousRange() {