The logs can be shown as chart by kibana.
Signed-off-by: Li Yuanchao <lyc163mail(a)163.com>
---
lib/git_mirror.rb | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/lib/git_mirror.rb b/lib/git_mirror.rb
index bb0c9f9..92a3830 100644
--- a/lib/git_mirror.rb
+++ b/lib/git_mirror.rb
@@ -192,6 +192,7 @@ class MirrorMain
feedback_info[:new_refs] = new_refs
send_message(feedback_info)
+ new_refs_log(git_repo, new_refs)
end
def do_push(fork_key)
@@ -509,4 +510,15 @@ class MirrorMain
traverse_repodir(repodir, belong)
end
end
+
+ def new_refs_log(git_repo, new_refs)
+ log = {
+ msg: 'new refs',
+ date: Date.today,
+ time: Time.now,
+ repo: git_repo,
+ nr_new_branch: new_refs[:heads].length
+ }.to_json
+ puts log
+ end
end
--
2.23.0