dev@grizzly.java.net

GrizzlyWebServer and getStatistics doesnt return any stats

From: Survivant 00 <survivant00_at_gmail.com>
Date: Fri, 30 Jan 2009 13:53:25 -0500

I take the example : GrizzlyEmbedWebServer

created a index.html file : and I wrote "coucou" ..

when I run this code : PORT 80.. (I tried with 8080 first.. but just to be
sure that Firefox wasn't returning a page from the cache..I switched to 80)


public static void main( String args[] ) throws Exception {
        String path = args[0];
        if (args[0] == null || path == null){
            System.out.println("Invalid static resource path");
            System.exit(-1);
        }

        GrizzlyWebServer ws = new GrizzlyWebServer(80);

        final Statistics stats = ws.getStatistics();
        stats.startGatheringStatistics();

        ste.scheduleAtFixedRate(new Runnable() {
            public void run() {
                System.out.println("Current connected users: " +
                    stats.getKeepAliveStatistics().getCountConnections());
                System.out.println("How many requests since startup:" +
                    stats.getRequestStatistics().getRequestCount());
                System.out.println("How many connection we queued because of
all" +
                    "thread were busy: " +
                    stats.getThreadPoolStatistics().getCountQueued());
                System.out.println("Max Open Connection: "+
                    stats.getRequestStatistics().getMaxOpenConnections());

                System.out.println("Request Queued (15min avg): "+

stats.getThreadPoolStatistics().getCountQueued15MinuteAverage());
                System.out.println("Request Queued (total): "+
                    stats.getThreadPoolStatistics().getCountTotalQueued());
                System.out.println("Byte Sent: "+
stats.getRequestStatistics().getBytesSent());
                System.out.println("200 Count: "+
stats.getRequestStatistics().getCount200());
                System.out.println("404 Count: "+
stats.getRequestStatistics().getCount404());

                System.out.println("last URI:" +
stats.getRequestStatistics().getLastRequestURI());

                return;
            }
        }, 0, 10,TimeUnit.SECONDS);
        System.out.println("Grizzly WebServer listening on port 8080");
        ws.start();
    }


I always have theses stats :

Current connected users: 0
How many requests since startup:0
How many connection we queued because of allthread were busy: 0
Max Open Connection: 0
Request Queued (15min avg): 0
Request Queued (total): 0
Byte Sent: 0
200 Count: 0
404 Count: 0
last URI:null

and in Firefox.. I see a nice : "coucou"

what I'm missing ?

I'm using the trunk from mvn version : 1.9.5