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.Debug = runner.options.Debug
opts.NoColor = runner.options.NoColor

View File

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