feat: fixed stats not working + misc changes

This commit is contained in:
Ice3man 2025-02-14 00:53:23 +05:30
parent 8cb0087e99
commit dabcce865e
2 changed files with 10 additions and 11 deletions

View File

@ -325,9 +325,6 @@ func New(options *types.Options) (*Runner, error) {
} }
} }
// setup a proxy writer to automatically upload results to PDCP
runner.output = runner.setupPDCPUpload(outputWriter)
opts := interactsh.DefaultOptions(runner.output, runner.issuesClient, runner.progress) opts := interactsh.DefaultOptions(runner.output, runner.issuesClient, runner.progress)
opts.Debug = runner.options.Debug opts.Debug = runner.options.Debug
opts.NoColor = runner.options.NoColor opts.NoColor = runner.options.NoColor

View File

@ -105,6 +105,7 @@ func (t *Tracker) GetStats() *StatsOutput {
func (t *Tracker) DisplayTopStats(noColor bool) { func (t *Tracker) DisplayTopStats(noColor bool) {
stats := t.GetStats() stats := t.GetStats()
if len(stats.StatusCodeStats) > 0 {
fmt.Printf("\n%s\n", aurora.Bold(aurora.Blue("Top Status Codes:"))) fmt.Printf("\n%s\n", aurora.Bold(aurora.Blue("Top Status Codes:")))
topStatusCodes := getTopN(stats.StatusCodeStats, 6) topStatusCodes := getTopN(stats.StatusCodeStats, 6)
for _, item := range topStatusCodes { for _, item := range topStatusCodes {
@ -115,6 +116,7 @@ func (t *Tracker) DisplayTopStats(noColor bool) {
fmt.Printf(" %s: %d\n", aurora.Colorize(item.Key, color), item.Value) fmt.Printf(" %s: %d\n", aurora.Colorize(item.Key, color), item.Value)
} }
} }
}
if len(stats.ErrorStats) > 0 { if len(stats.ErrorStats) > 0 {
fmt.Printf("\n%s\n", aurora.Bold(aurora.Red("Top Errors:"))) fmt.Printf("\n%s\n", aurora.Bold(aurora.Red("Top Errors:")))