-
Notifications
You must be signed in to change notification settings - Fork 664
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 stats option to analyze command for performance insights #1237
base: main
Are you sure you want to change the base?
feat: add stats option to analyze command for performance insights #1237
Conversation
Introduced a new feature to the analyze command that enables users to print detailed performance statistics of each analyzer. This enhancement aids in debugging and understanding the time taken by various components during analysis, providing valuable insights for performance optimization. Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Linked to this issue #1236 |
If we do |
The current implementation does not support json as an output. |
When this option is selected, the results are not displayed. Only the statistics are shown. If we try to display both, in the case of an analysis with many results, it becomes very difficult to visualize the statistics. |
defer mutex.Unlock() | ||
|
||
if err != nil { | ||
a.Stats = append(a.Stats, stat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to make it optional, shouldn't make sense to gather stats only when the user wants to enable stats reporting ?
Might be worth considering if we want to show the results and time taken |
@AlexsJones stats implementation is global to analyzer. The results display the errors reported by an analyzer. In my opinion, these are two different notions. We could also display the stats in json format, if that's useful. |
_Print analysis stats_ | ||
|
||
``` | ||
k8sgpt analyze -s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't see a world where you'd want to run this without capturing the output in some format.
But for those that do, perhaps... k8sgpt analyze --stats --no-output
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This simply makes the result of the analysis unreadable with the stats.
Closes #
📑 Description
Introduced a new feature to the analyze command that enables users to print detailed performance statistics of each analyzer. This enhancement aids in debugging and understanding the time taken by various components during analysis, providing valuable insights for performance optimization.
✅ Checks
ℹ Additional Information