Homework/05 advanced - #129
Open
gbx-cyber2 wants to merge 5 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR is a 05-advanced homework submission that extends the log analyzer system across the parser, analyzer, gRPC API/server, CLI tools, and Avalonia GUI to support richer analysis workflows (querying/sorting, table view, and statistics), with accompanying chapter reports.
Changes:
- Implemented parsing/visiting for
requestandinternallog events and completed multithreaded analysis pipeline TODOs. - Extended the gRPC contract and agent session to support querying log entries and fetching per-file statistics.
- Enhanced the Avalonia client UI/VM to analyze all logs, query/sort results, show statistics, and display results in a table with severity highlighting.
Reviewed changes
Copilot reviewed 21 out of 29 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| src/RemoteCli/Program.cs | Completed remote CLI flows for listing/analyzing logs and fetching analysis results. |
| src/LogParser/Visitors/KeyValueVisitor.cs | Added visitor output for Request/Internal entries. |
| src/LogParser/Parser/LineParser.cs | Implemented parsing for request/internal messages. |
| src/LogParser/Models/LogEntries.cs | Completed visitor dispatch for Request/Internal entry types. |
| src/LogAnalyzerRpc/Protos/log_analyzer.proto | Added QueryLogEntries and GetStatistics RPCs and related messages. |
| src/LogAnalyzerRpc/GrpcTypeConverter.cs | Implemented enum + Request/Internal entry conversions. |
| src/LogAnalyzerRpc/GrpcLogEntryVisitor.cs | Implemented Request/Internal conversions to protobuf messages. |
| src/LogAnalyzerClient/LogAnalyzerClient/Views/MainView.axaml | Added Analyze All, query panel, statistics button, and results table UI. |
| src/LogAnalyzerClient/LogAnalyzerClient/ViewModels/MainViewModel.cs | Implemented refresh/analyze/query/statistics commands and result population. |
| src/LogAnalyzerClient/LogAnalyzerClient/Styles/Controls.axaml | Added severity badge style for highlighted severity display. |
| src/LogAnalyzerClient/LogAnalyzerClient/Models/RemoteModels.cs | Introduced LogEntryRow for table binding and severity styling. |
| src/LogAnalyzerAgent/Services/AgentService.cs | Wired gRPC service methods through to AgentSession, including new RPCs. |
| src/LogAnalyzerAgent/Applications/AgentSession.cs | Implemented directory/analyze/result/query/statistics logic with status mapping. |
| src/LogAnalyzer/WorkQueue.cs | Implemented thread-safe producer/consumer queue. |
| src/LogAnalyzer/LogFileAnalyzer.cs | Completed multithreaded worker pipeline and result storage with locking. |
| src/LocalCli/Program.cs | Completed local CLI flows for listing/analyzing logs and printing results. |
| docs/05-advanced/report.md | Added 05-advanced report documenting query/table/statistics features and usage. |
| docs/04-avalonia/report.md | Added 04-avalonia report describing the GUI implementation. |
| docs/03-async-grpc/report.md | Added 03-async-grpc report describing gRPC implementation. |
| docs/02-multithreading/report.md | Added 02-multithreading report describing queue/analyzer design. |
| docs/01-basic/report.md | Added 01-basic report describing parsing/visitor basics. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+54
to
+60
| return ex switch | ||
| { | ||
| ArgumentOutOfRangeException => CreateErrorOperationStatus(AgentErrorCode.InvalidArgument, ex.Message), | ||
| InvalidOperationException => CreateErrorOperationStatus(AgentErrorCode.InvalidOperation, ex.Message), | ||
| ArgumentException => CreateErrorOperationStatus(AgentErrorCode.FileNotFound, ex.Message), | ||
| _ => CreateErrorOperationStatus(AgentErrorCode.InternalError, ex.Message), | ||
| }; |
| } | ||
| catch (Exception ex) | ||
| { | ||
| response.Status = CreateInternalErrorOperationStatus(ex); |
Comment on lines
+37
to
+43
| SeverityBrush = entry.Severity switch | ||
| { | ||
| LogSeverity.Info => new SolidColorBrush(Color.Parse("#2E8BFF")), | ||
| LogSeverity.Warning => new SolidColorBrush(Color.Parse("#F5A623")), | ||
| LogSeverity.Error => new SolidColorBrush(Color.Parse("#E5484D")), | ||
| _ => Brushes.Transparent, | ||
| }, |
Comment on lines
+182
to
+186
| <ItemsControl ItemsSource="{Binding ResultEntries}"> | ||
| <ItemsControl.ItemTemplate> | ||
| <DataTemplate x:DataType="models:LogEntryRow"> | ||
| <Grid ColumnDefinitions="50,180,120,76,76,300,110,80,70,170,80,200,220"> | ||
| <TextBlock Grid.Column="0" Text="{Binding LineNo}" /> |
Comment on lines
+287
to
+289
| using var call = _client!.GetAnalysisResult(request); | ||
| var responses = await call.ResponseStream.ReadAllAsync().ToListAsync(); | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
暑培:队式作业提交
基本信息
提交说明
05-advanced作业提交通道 #36