package com.bugsnag;

import java.util.Date;
import java.util.UUID;

class SessionTracker {

    private final Configuration configuration;
    private final ThreadLocal<Session> session = new ThreadLocal<Session>();

    SessionTracker(Configuration configuration) {
        this.configuration = configuration;
    }

    void startNewSession(Date date, boolean autoCaptured) {
        if ((!configuration.shouldAutoCaptureSessions() && autoCaptured) || !configuration.shouldNotifyForReleaseStage()) {
            return;
        }

        Session newSession = new Session(UUID.randomUUID().toString(), date);


        // TODO increment count/report!
        session.set(newSession);
    }

    Session getSession() {
        return session.get();
    }

}
@@ -60,16 +60,63 @@
 il.UUID;
+%0Aimport java.util.concurrent.atomic.AtomicLong;
 %0A%0Aclass 
@@ -258,16 +258,79 @@
 on%3E();%0A%0A
+    private final AtomicLong sessionCount = new AtomicLong();%0A%0A
     Sess
@@ -649,119 +649,101 @@
     
-Session newSession = new Session(UUID.randomUUID().toString(), date);%0A%0A%0A        // TODO increment count/report!
+// TODO store date against count and deliver sessions%0A        sessionCount.incrementAndGet();
 %0A   
@@ -762,23 +762,60 @@
 .set(new
+ 
 Session
+(UUID.randomUUID().toString(), date)
 );%0A    %7D

increment count for sessions in tracker