@@ -0,0 +1,1365 @@
+package com.github.digital_wonderland.sling_metrics.sling;%0A%0Aimport com.codahale.metrics.Counter;%0Aimport com.github.digital_wonderland.sling_metrics.service.MetricService;%0Aimport org.apache.felix.scr.annotations.*;%0Aimport org.osgi.service.component.ComponentContext;%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0Aimport javax.servlet.http.HttpSessionEvent;%0A%0A@Component(immediate = true, metatype = false)%0A@Service%0Apublic class HttpSessionListener implements javax.servlet.http.HttpSessionListener %7B%0A%0A    private static final Logger LOG = LoggerFactory.getLogger(HttpSessionListener.class);%0A%0A    private static final String OPEN_SESSIONS_METRIC = %22sessions%22;%0A%0A    @Reference%0A    protected MetricService metricService;%0A%0A    private Counter counter;%0A%0A    @Activate%0A    protected void activate(final ComponentContext context) %7B%0A        counter = metricService.counter(OPEN_SESSIONS_METRIC);%0A    %7D%0A%0A    @Deactivate%0A    protected void deactivate() %7B%0A        metricService.remove(OPEN_SESSIONS_METRIC);%0A        counter = null;%0A    %7D%0A%0A    @Override%0A    public void sessionCreated(final HttpSessionEvent httpSessionEvent) %7B%0A        LOG.debug(%22HTTP session created%22);%0A        counter.inc();%0A    %7D%0A%0A    @Override%0A    public void sessionDestroyed(final HttpSessionEvent httpSessionEvent) %7B%0A        LOG.debug(%22HTTP session destroyed%22);%0A        counter.dec();%0A    %7D%0A%7D%0A

add HTTP session listener