Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add summary module for aggregating runtime information and internal metrics #365

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
3be2def
feat: add summary module for aggregating runtime information and inte…
simonsan Nov 21, 2024
5908230
feat: enhance Summary struct to use EcoString
simonsan Nov 21, 2024
9b6dcb7
refactor: remove unnecessary Deserialize derive from CondensedIssue a…
simonsan Nov 21, 2024
9611df5
feat: update Metrics type to use MetricValue enum and modify add_metr…
simonsan Nov 21, 2024
2265256
refactor: simplify Metrics type and update add_issue and add_metric m…
simonsan Nov 21, 2024
a9e89dc
Merge branch 'main' into feat/summary
simonsan Nov 24, 2024
8bbace6
feat: add IssueCategory enum and logging for issues in Summary
simonsan Nov 24, 2024
1f40182
feat: refactor issue handling to categorize by IssueCategory and impr…
simonsan Nov 25, 2024
efb345e
feat: add merge method to Summary and corresponding unit test
simonsan Nov 25, 2024
bbafe09
feat: add TODO comments for refactoring merge method in Summary
simonsan Nov 25, 2024
a437de4
feat: add methods to log errors, warnings, and info in Summary
simonsan Nov 25, 2024
8e13aa9
feat: add method to enable logging in Summary
simonsan Nov 25, 2024
f169967
feat: enhance logging functionality and update root cause handling in…
simonsan Nov 25, 2024
6d61317
feat: update merge method to use Self type and improve handling of op…
simonsan Nov 25, 2024
a27dc6e
feat: add methods to convert Summary into boxed and arc mutex types
simonsan Nov 25, 2024
ddf7828
feat: rename is_error method to contains_error and improve error chec…
simonsan Nov 25, 2024
4b3d073
feat: add method to retrieve Summary from Arc<Mutex> with error handling
simonsan Nov 25, 2024
08a66fb
feat: update retrieve_from_arc_mutex method to use Self type
simonsan Nov 25, 2024
f30bb6e
feat: add assertions to tests for contains_error method in Summary
simonsan Nov 25, 2024
68b40c9
Merge branch 'main' into feat/summary
simonsan Jan 12, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat: update merge method to use Self type and improve handling of op…
…tional fields in Summary

Signed-off-by: simonsan <14062932+simonsan@users.noreply.github.com>
simonsan committed Nov 25, 2024
commit 6d6131740b12217f63f17d985fc6896daf6826ef
18 changes: 9 additions & 9 deletions crates/core/src/error/summary.rs
Original file line number Diff line number Diff line change
@@ -288,7 +288,7 @@ impl Summary {
// ? merged summaries.
// ?
// ? How do we merge the other fields? E.g. Timing, Metrics, etc.
pub fn merge(&mut self, other: Summary) {
pub fn merge(&mut self, other: Self) {
self.issues.extend(other.issues);
self.metrics.extend(other.metrics);
}
@@ -415,7 +415,7 @@ mod tests {
IssueCategory::Error,
IssueScope::UserInput,
"Invalid input",
Some("Missing field"),
Some("Missing field".into()),
);

assert_eq!(summary.issues.len(), 1);
@@ -442,14 +442,14 @@ mod tests {
IssueCategory::Error,
IssueScope::UserInput,
"Invalid input",
Some("Missing field"),
Some("Missing field".into()),
);

summary.add_issue(
IssueCategory::Error,
IssueScope::UserInput,
"Invalid input",
Some("Missing field"),
Some("Missing field".into()),
);

assert_eq!(summary.issues.len(), 1);
@@ -485,21 +485,21 @@ mod tests {
IssueCategory::Error,
IssueScope::UserInput,
"Invalid input",
Some("Missing field"),
Some("Missing field".into()),
);

summary.add_issue(
IssueCategory::Error,
IssueScope::UserInput,
"Invalid input",
Some("Missing field"),
Some("Missing field".into()),
);

summary.add_issue(
IssueCategory::Warning,
IssueScope::Internal,
"Pack not found",
Some("Inconsistent state on disk"),
Some("Inconsistent state on disk".into()),
);

summary.add_metric("execution_time", "5s");
@@ -554,7 +554,7 @@ mod tests {
IssueCategory::Error,
IssueScope::UserInput,
"Invalid input",
Some("Missing field"),
Some("Missing field".into()),
);

summary.add_metric("execution_time", "5s");
@@ -567,7 +567,7 @@ mod tests {
IssueCategory::Error,
IssueScope::UserInput,
"Invalid input",
Some("Missing field"),
Some("Missing field".into()),
);

other_summary.add_metric("execution_time", "5s");