Skip to content

Homework/05 advanced - #129

Open
gbx-cyber2 wants to merge 5 commits into
eesast:homework/05-advancedfrom
gbx-cyber2:homework/05-advanced
Open

Homework/05 advanced#129
gbx-cyber2 wants to merge 5 commits into
eesast:homework/05-advancedfrom
gbx-cyber2:homework/05-advanced

Conversation

@gbx-cyber2

Copy link
Copy Markdown

暑培:队式作业提交

基本信息

  • 姓名:龚伯熙
  • 班级:笃实56
  • 学号:2025013077

提交说明

Copilot AI lite review requested due to automatic review settings August 28, 2026 08:15
@mergify mergify Bot added the homework Homework PR, will not be merged label Aug 28, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 request and internal log 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();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

homework Homework PR, will not be merged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants