Skip to content

Commit 9b980ac

Browse files
Merge pull request #2227 from DataDog/bplasovska/fix/logs-benchmark-mem
2 parents 7d89675 + 3ff3f1c commit 9b980ac

File tree

1 file changed

+0
-19
lines changed

1 file changed

+0
-19
lines changed

BenchmarkTests/Runner/Scenarios/Logs/UI/LogsCustomContentView.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ struct LogsCustomContentView: View {
1414
@State private var interval: Double
1515
@State private var isRepeating: Bool
1616
@State private var payloadSize: String
17-
@State private var logs: [String]
1817
@State private var isLogging: Bool
1918

2019
private let logger: LoggerProtocol
@@ -26,7 +25,6 @@ struct LogsCustomContentView: View {
2625
interval = 5
2726
isRepeating = false
2827
payloadSize = "Small"
29-
logs = []
3028
isLogging = false
3129

3230
logger = Logger.create()
@@ -86,14 +84,6 @@ struct LogsCustomContentView: View {
8684
}
8785
.listRowBackground(EmptyView())
8886
.listRowInsets(EdgeInsets())
89-
90-
Section(header: Text("Console output:")) {
91-
ForEach(logs, id: \.self) { log in
92-
Text(log)
93-
.lineLimit(nil)
94-
.font(.footnote)
95-
}
96-
}
9787
}
9888
.listSectionSpacing(10)
9989
}
@@ -105,18 +95,9 @@ struct LogsCustomContentView: View {
10595
/// - attributes: The payload attributes corresponding to the selected payload size.
10696
func logBatch(selectedLogLevel: LogLevel, attributes: [String: Encodable]) {
10797
DispatchQueue.global(qos: .userInitiated).async {
108-
var newLogEntries: [String] = []
109-
11098
for _ in 1...self.logsPerBatch {
111-
let logEntry = "\(Date()) [\(self.logLevel)] \(self.logMessage) - \(self.payloadSize)"
112-
newLogEntries.append(logEntry)
113-
11499
self.logger.log(level: selectedLogLevel, message: self.logMessage, error: nil, attributes: attributes)
115100
}
116-
117-
DispatchQueue.main.async {
118-
self.logs.insert(contentsOf: newLogEntries, at: 0)
119-
}
120101
}
121102
}
122103

0 commit comments

Comments
 (0)