Skip to content

Commit d95e331

Browse files
committed
fix: actually do pre-processing
1 parent 8b36f91 commit d95e331

File tree

4 files changed

+2
-122
lines changed

4 files changed

+2
-122
lines changed

src/lib/log-processor/index.ts

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ export class ClassifyLogEntry extends TransformStream<
437437
}
438438
| undefined {
439439
const pattern =
440-
/^(?<property>[^\[\:]+)(?:\[(?<key>[^\[]+)\])? \(was (?<prev>[^\)]+?)\)(?:\s*\[Endpoint (?<endpoint>\d+)\])?$/;
440+
/^(?<property>[^[:]+)(?:\[(?<key>[^[]+)\])? \(was (?<prev>[^)]+?)\)(?:\s*\[Endpoint (?<endpoint>\d+)\])?$/;
441441
const match = message.match(pattern);
442442
if (!match) return undefined;
443443

@@ -774,33 +774,4 @@ export class LogTransformPipeline {
774774

775775
return entries;
776776
}
777-
778-
generateSummary(entries: SemanticLogInfo[]): TransformedLog["summary"] {
779-
const semanticBreakdown: Record<SemanticLogKind, number> = {} as any;
780-
let errorCount = 0;
781-
let warningCount = 0;
782-
783-
for (const entry of entries) {
784-
semanticBreakdown[entry.kind] = (semanticBreakdown[entry.kind] || 0) + 1;
785-
786-
// Count errors and warnings based on various conditions
787-
if (entry.kind === SemanticLogKind.IncomingCommand && entry.invalid) {
788-
errorCount++;
789-
}
790-
if (entry.kind === SemanticLogKind.SendDataResponse && !entry.success) {
791-
errorCount++;
792-
}
793-
}
794-
795-
return {
796-
totalEntries: entries.length,
797-
timeRange: {
798-
start: entries[0]?.timestamp || "",
799-
end: entries[entries.length - 1]?.timestamp || "",
800-
},
801-
semanticBreakdown,
802-
errorCount,
803-
warningCount,
804-
};
805-
}
806777
}

src/lib/log-processor/simple.ts

Lines changed: 0 additions & 79 deletions
This file was deleted.

src/lib/types.ts

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,6 @@ export type SemanticLogInfo =
109109

110110
export interface TransformedLog {
111111
entries: SemanticLogInfo[];
112-
summary: {
113-
totalEntries: number;
114-
timeRange: {
115-
start: string;
116-
end: string;
117-
};
118-
semanticBreakdown: Record<SemanticLogKind, number>;
119-
errorCount: number;
120-
warningCount: number;
121-
};
122112
}
123113

124114
export interface AnalysisRequest {

src/lib/use-app-state.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useReducer, useCallback, useEffect } from 'react';
22
import { appReducer } from './app-reducer';
33
import { initialState, selectors, type ChatMessage } from './app-state';
44
import { GeminiLogAnalyzer, GEMINI_MODEL_ID } from './ai/gemini-client';
5-
import { LogTransformPipeline } from './log-processor/simple';
5+
import { LogTransformPipeline } from './log-processor';
66
import type { TransformedLog } from './types';
77

88
export function useAppState() {
@@ -92,11 +92,9 @@ export function useAppState() {
9292
try {
9393
const pipeline = new LogTransformPipeline();
9494
const entries = await pipeline.processLogContent(content);
95-
const summary = pipeline.generateSummary(entries);
9695

9796
const transformedLog: TransformedLog = {
9897
entries,
99-
summary
10098
};
10199

102100
dispatch({ type: 'SET_PROCESSED_LOGS', payload: transformedLog });

0 commit comments

Comments
 (0)