From c03b90baeaa740739e74d10860b126aac5ce4a60 Mon Sep 17 00:00:00 2001 From: Ayman Bagabas Date: Wed, 13 Oct 2021 11:52:47 -0400 Subject: [PATCH] stats: more informative stats --- stats/stats.go | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/stats/stats.go b/stats/stats.go index 847cce8bb..b9eb71736 100644 --- a/stats/stats.go +++ b/stats/stats.go @@ -1,8 +1,28 @@ package stats +import "log" + // Stats provides an interface that can be used to collect metrics about the server. type Stats interface { - Tui() - Push() - Fetch() + Tui(action string) + Push(repo string) + Fetch(repo string) +} + +type stats struct{} + +func (s *stats) Tui(action string) { + log.Printf("TUI: %s", action) +} + +func (s *stats) Push(repo string) { + log.Printf("git push: %s", repo) +} + +func (s *stats) Fetch(repo string) { + log.Printf("git fetch: %s", repo) +} + +func NewStats() Stats { + return &stats{} }