Skip to content

Commit 0337c29

Browse files
committed
preliminary version of comparison tool
1 parent 3f05a10 commit 0337c29

File tree

7 files changed

+1055
-110
lines changed

7 files changed

+1055
-110
lines changed

lib/client/loki.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,17 @@ func (lc *LokiClient) extractRawLogEntries(lokiResp LokiResponse) []LokiLogEntry
171171

172172
for _, result := range lokiResp.Data.Result {
173173
for _, entry := range result.Values {
174-
timestamp := entry[0].(string)
174+
var timestamp string
175+
if timestampString, ok := entry[0].(string); ok {
176+
timestamp = timestampString
177+
} else if timestampInt, ok := entry[0].(int); ok {
178+
timestamp = fmt.Sprintf("%d", timestampInt)
179+
} else if timestampFloat, ok := entry[0].(float64); ok {
180+
timestamp = fmt.Sprintf("%f", timestampFloat)
181+
} else {
182+
lc.Logger.Error().Msg("Error parsing timestamp")
183+
continue
184+
}
175185
logLine := entry[1].(string)
176186
logEntries = append(logEntries, LokiLogEntry{
177187
Timestamp: timestamp,

wasp/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ bin/
22
.vscode/
33
.idea/
44
.direnv/
5-
5+
performance_reports/
66
k3dvolume/
77
.private.env
88
.envrc.ci

0 commit comments

Comments
 (0)