c03b90baeaa740739e74d10860b126aac5ce4a60

Author
Ayman Bagabas <ayman.bagabas@gmail.com>
Committer
Ayman Bagabas <ayman.bagabas@gmail.com>
Date

Message

stats: more informative stats

Diff

 1diff --git a/stats/stats.go b/stats/stats.go
 2index 847cce8bba9d88ca15aec3b6dcf17ff2af8f8a11..b9eb7173603a0db1194f00a509361921a9a3e595 100644
 3--- a/stats/stats.go
 4+++ b/stats/stats.go
 5@@ -1,8 +1,28 @@
 6 package stats
 7 
 8+import "log"
 9+
10 // Stats provides an interface that can be used to collect metrics about the server.
11 type Stats interface {
12-	Tui()
13-	Push()
14-	Fetch()
15+	Tui(action string)
16+	Push(repo string)
17+	Fetch(repo string)
18+}
19+
20+type stats struct{}
21+
22+func (s *stats) Tui(action string) {
23+	log.Printf("TUI: %s", action)
24+}
25+
26+func (s *stats) Push(repo string) {
27+	log.Printf("git push: %s", repo)
28+}
29+
30+func (s *stats) Fetch(repo string) {
31+	log.Printf("git fetch: %s", repo)
32+}
33+
34+func NewStats() Stats {
35+	return &stats{}
36 }