Skip to content

Commit c574e5a

Browse files
authored
feat: add initializer for PersistencePerformancePreset (#925)
1 parent b890498 commit c574e5a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

Sources/Exporters/Persistence/PersistencePerformancePreset.swift

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,37 @@ public struct PersistencePerformancePreset: Equatable, StoragePerformancePreset,
6969
let maxExportDelay: TimeInterval
7070
let exportDelayChangeRate: Double
7171

72+
/// Public initializer to allow custom presets
73+
public init(
74+
maxFileSize: UInt64,
75+
maxDirectorySize: UInt64,
76+
maxFileAgeForWrite: TimeInterval,
77+
minFileAgeForRead: TimeInterval,
78+
maxFileAgeForRead: TimeInterval,
79+
maxObjectsInFile: Int,
80+
maxObjectSize: UInt64,
81+
synchronousWrite: Bool,
82+
initialExportDelay: TimeInterval,
83+
defaultExportDelay: TimeInterval,
84+
minExportDelay: TimeInterval,
85+
maxExportDelay: TimeInterval,
86+
exportDelayChangeRate: Double
87+
) {
88+
self.maxFileSize = maxFileSize
89+
self.maxDirectorySize = maxDirectorySize
90+
self.maxFileAgeForWrite = maxFileAgeForWrite
91+
self.minFileAgeForRead = minFileAgeForRead
92+
self.maxFileAgeForRead = maxFileAgeForRead
93+
self.maxObjectsInFile = maxObjectsInFile
94+
self.maxObjectSize = maxObjectSize
95+
self.synchronousWrite = synchronousWrite
96+
self.initialExportDelay = initialExportDelay
97+
self.defaultExportDelay = defaultExportDelay
98+
self.minExportDelay = minExportDelay
99+
self.maxExportDelay = maxExportDelay
100+
self.exportDelayChangeRate = exportDelayChangeRate
101+
}
102+
72103
// MARK: - Predefined presets
73104

74105
/// Default performance preset.

0 commit comments

Comments
 (0)