Skip to content

Commit

Permalink
Expose the PerformancePreset struct initializer to allow creation of …
Browse files Browse the repository at this point in the history
…custom presets
  • Loading branch information
n-ravichandran committed Oct 23, 2024
1 parent 726b343 commit b9e225c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import OpenTelemetrySdk
import FoundationNetworking
#endif

/// Simple Otlp Http log exporter that exports logs synchrously. Exports the given log records and returns export status after the network call is complete.
public class SimpleHttpLogExporter: OtlpHttpExporterBase, LogRecordExporter {
override public init(endpoint: URL = defaultOltpHttpLoggingEndpoint(),
config: OtlpConfiguration = OtlpConfiguration(),
Expand Down
30 changes: 30 additions & 0 deletions Sources/Exporters/Persistence/PersistencePerformancePreset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,36 @@ public struct PersistencePerformancePreset: Equatable, StoragePerformancePreset,
let maxExportDelay: TimeInterval
let exportDelayChangeRate: Double

public init(
maxFileSize: UInt64,
maxDirectorySize: UInt64,
maxFileAgeForWrite: TimeInterval,
minFileAgeForRead: TimeInterval,
maxFileAgeForRead: TimeInterval,
maxObjectsInFile: Int,
maxObjectSize: UInt64,
synchronousWrite: Bool,
initialExportDelay: TimeInterval,
defaultExportDelay: TimeInterval,
minExportDelay: TimeInterval,
maxExportDelay: TimeInterval,
exportDelayChangeRate: Double
) {
self.maxFileSize = maxFileSize
self.maxDirectorySize = maxDirectorySize
self.maxFileAgeForWrite = maxFileAgeForWrite
self.minFileAgeForRead = minFileAgeForRead
self.maxFileAgeForRead = maxFileAgeForRead
self.maxObjectsInFile = maxObjectsInFile
self.maxObjectSize = maxObjectSize
self.synchronousWrite = synchronousWrite
self.initialExportDelay = initialExportDelay
self.defaultExportDelay = defaultExportDelay
self.minExportDelay = minExportDelay
self.maxExportDelay = maxExportDelay
self.exportDelayChangeRate = exportDelayChangeRate
}

// MARK: - Predefined presets

/// Default performance preset.
Expand Down

0 comments on commit b9e225c

Please sign in to comment.