diff --git a/asink/client.go b/asink/client.go index 94d6249..9a9b44c 100644 --- a/asink/client.go +++ b/asink/client.go @@ -209,7 +209,9 @@ func ProcessLocalEvent(globals AsinkGlobals, event *asink.Event) { } //finally, send it off to the server + StatStartSending() err = SendEvent(globals, event) + StatStopSending() if err != nil { panic(err) //TODO handle sensibly } diff --git a/asink/status.go b/asink/status.go index 7dbb5a4..b20bb67 100644 --- a/asink/status.go +++ b/asink/status.go @@ -13,6 +13,7 @@ var localUpdates int32 = 0 var remoteUpdates int32 = 0 var fileUploads int32 = 0 var fileDownloads int32 = 0 +var sendingUpdates int32 = 0 func GetStats() string { local := atomic.LoadInt32(&localUpdates) @@ -23,7 +24,8 @@ func GetStats() string { return fmt.Sprintf(`Asink client statistics: Processing %d file updates (%d local, %d remote) Uploading %d files - Downloading %d files`, local + remote, local, remote, uploads, downloads) + Downloading %d files + Sending %d updates`, local+remote, local, remote, uploads, downloads, sendingUpdates) } func StatStartLocalUpdate() { @@ -50,3 +52,9 @@ func StatStartDownload() { func StatStopDownload() { atomic.AddInt32(&fileDownloads, -1) } +func StatStartSending() { + atomic.AddInt32(&sendingUpdates, 1) +} +func StatStopSending() { + atomic.AddInt32(&sendingUpdates, -1) +}