* feat: add stats option to analyze command for performance insights
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>
* feat: enhance analysis command with statistics option
Refactored the analysis command to support an enhanced statistics option, enabling users to opt-in for detailed performance metrics of the analysis process. This change introduces a more flexible approach to handling statistics, allowing for a clearer separation between the analysis output and performance metrics, thereby improving the usability and insights provided to the user.
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
---------
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
Co-authored-by: Aris Boutselis <arisboutselis08@gmail.com>
* chore: initial custom analysis
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: saving the missing stuff
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: removed redundant error handling
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: missing piece of the custom analysis response
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Signed-off-by: AlexsJones <alexsimonjones@gmail.com>
This commit bumps the code coverage of the `pkg/analysis` package to
60.8%
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
Co-authored-by: JuHyung Son <sonju0427@gmail.com>
Signed-off-by: Peter Pan <Peter.Pan@daocloud.io>
Co-authored-by: Aris Boutselis <arisboutselis08@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
Now, the default value of the `backend` flag for the analyze command
will be an empty string. And the `NewAnalysis` function has been
modified to use the default backend set by the user if the backend flag
is not provided and the `defaultprovider` is set in the config file.
Otherwise, backend will be set to "openai".
Fixes: https://github.com/k8sgpt-ai/k8sgpt/issues/902
Signed-off-by: VaibhavMalik4187 <vaibhavmalik2018@gmail.com>
Co-authored-by: JuHyung Son <sonju0427@gmail.com>
* feat: enables remote custom analyzers
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: fixed test that was broken
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: hiding custom analysis behind a flag
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: resolved govet issue
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: updated
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: updated
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: updated deps
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: updated deps
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: wip interactive mode
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: tidied up a bit
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: updated go mod
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: const prompt
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: updated based on comments feedback
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: updated enum
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: updated enum
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* refactor: Simplified IAI; made caching and processing consisent.
Signed-off-by: bwplotka <bwplotka@gmail.com>
* feat: Added Google AI API e.g. for Gemini models.
Signed-off-by: bwplotka <bwplotka@gmail.com>
---------
Signed-off-by: bwplotka <bwplotka@gmail.com>
Co-authored-by: Alex Jones <alexsimonjones@gmail.com>
Co-authored-by: Thomas Schuetz <38893055+thschue@users.noreply.github.com>
* feat: added the ability to set a user default AI provider
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* feat: added the ability to set a user default AI provider
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* feat: s3 based caching
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* feat: s3 based caching
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* updated README.md
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* update README.md
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* updated README.md
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: region is a must have
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: clarified remove command
* updated remove.go
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: test fmt causing issues will open another pr
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* feat: added the ability to set a user default AI provider
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* feat: added the ability to set a user default AI provider
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* chore: added provider to json output
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* fix: stop execution after matching condition in RunAnalysis()
The commit fixes the issue where the RunAnalysis() function continues execution even after matching a condition. The fix ensures that the execution stops at the end of the corresponding if statement, improving the control flow and preventing unnecessary processing.
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
* feat: include filters parameter in AnalyzeRequest initialization
The commit introduces a new feature where the filters parameter is included in the initialization of the AnalyzeRequest. This enhancement allows for more specific analysis by specifying filters during the analysis process.
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
---------
Signed-off-by: Matthis Holleville <matthish29@gmail.com>
Before the filter inside the func literal was capturing the value from
the outer loop. This is a subtle mistake, since in combination with
running the function literal as go routine, the value of filter could
have already changed at invocation time.
To fix this, the filter is now passed in as an argument to the func
literal.
Signed-off-by: Patrick Pichler <git@patrickpichler.dev>
Co-authored-by: Patrick Pichler <git@patrickpichler.dev>
Instead of storing cached values in the config yaml, they are now stored
under these OS specific locations:
* Linux: `~/.cache/k8sgpt`
* MacOS: `~/Library/Caches`
* Windows: `%LocalAppData%\cache`
Additionally a `Cache` package and interface has been introduced.
Currently there are two implementations:
* Noop - Doesn't do anything
* FileBased - Stores data in files under the locations listed above
fixes#323
Signed-off-by: Patrick Pichler <git@patrickpichler.dev>
* feat: async calls
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* feat: added concurrency settings
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
* feat: added in ability to set max concurrency
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
---------
Signed-off-by: Alex Jones <alexsimonjones@gmail.com>
Co-authored-by: Matthis <99146727+matthisholleville@users.noreply.github.com>