Skip to content

Commit 616df33

Browse files
committed
remove unused code
1 parent e09ece1 commit 616df33

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

stats/sources.go

-29
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
package stats
22

33
import (
4-
"fmt"
5-
"sort"
6-
"strings"
74
"time"
85
)
96

@@ -25,29 +22,3 @@ func (s Sources) IsRunning(source int) bool {
2522
}
2623
return stats.State == Running
2724
}
28-
29-
func (s Sources) String() string {
30-
b := []string{}
31-
header := fmt.Sprintf(
32-
"%16s\t->S\t->N\t->P\tGOOD\t *F\t *T\t *B\t *I\tUPDATED\n",
33-
"SOURCE")
34-
var found, timeouts, blacklisted, ignored int
35-
for k, v := range s {
36-
success := int(100 * float32(v.Found) / float32(v.Processed()))
37-
if v.Found == 0 {
38-
success = 0
39-
}
40-
info := fmt.Sprintf("%16d\t%3d\t%3d\t%3d\t%3d%%\t%4d\t%4d\t%4d\t%5d\t%s",
41-
k, v.Scheduled, v.New, v.Probing, success, v.Found, v.Timeouts,
42-
v.Blacklisted, v.Ignored, time.Since(v.Updated).Round(time.Second))
43-
b = append(b, info)
44-
found += v.Found
45-
timeouts += v.Timeouts
46-
blacklisted += v.Blacklisted
47-
ignored += v.Ignored
48-
}
49-
sort.Strings(b)
50-
other := fmt.Sprintf("\n%52s\t%4d\t%4d\t%4d\t%5d", "total",
51-
found, timeouts, blacklisted, ignored)
52-
return header + strings.Join(b, "\n") + other
53-
}

0 commit comments

Comments
 (0)