]> git.scottworley.com Git - reliable-chat/commitdiff
Count drops due to reaching the message limit
authorScott Worley <sworley@chkno.net>
Sun, 19 Aug 2012 05:15:18 +0000 (22:15 -0700)
committerScott Worley <sworley@chkno.net>
Sun, 19 Aug 2012 05:21:53 +0000 (22:21 -0700)
server/server.go

index 74a1da2cfc483488cbd94fb696712db8dfb1ae89..74e116f610d5b5fbe8f620d68be3149bb188308f 100644 (file)
@@ -34,6 +34,7 @@ var speak_count = expvar.NewInt("speak_count")
 var fetch_count = expvar.NewInt("fetch_count")
 var fetch_wait_count = expvar.NewInt("fetch_wait_count")
 var fetch_wake_count = expvar.NewInt("fetch_wake_count")
 var fetch_count = expvar.NewInt("fetch_count")
 var fetch_wait_count = expvar.NewInt("fetch_wait_count")
 var fetch_wake_count = expvar.NewInt("fetch_wake_count")
+var drop_due_to_limit_count = expvar.NewInt("drop_due_to_limit_count")
 
 type Message struct {
        Time time.Time
 
 type Message struct {
        Time time.Time
@@ -76,6 +77,7 @@ main:
                                message_count++
                        } else {
                                messages.Remove(messages.Front())
                                message_count++
                        } else {
                                messages.Remove(messages.Front())
+                               drop_due_to_limit_count.Add(1)
                        }
                case request, ok := <-store.Get:
                        if !ok {
                        }
                case request, ok := <-store.Get:
                        if !ok {