This Question is Not Answered

1 "correct" answer available (10 pts) 2 "helpful" answers available (5 pts)
1,295 Views 0 Replies Last post: Feb 10, 2009 8:59 AM by jons RSS
jons Bronze 15 posts since
Feb 6, 2007
Currently Being Moderated

Feb 10, 2009 8:59 AM

Adding a Statistic to Monitoring Plugin

Hi,

 

I am somewhat mystified by this.  I want to add my own statistic to the monitoring plugin page.

In this case, I want to monitor the number of times the word "widget" is said in conversations.

 

So, I add a plugin which has a packet interceptor.  In the packet interceptor, I keep a counter tracking "widget".

 

In that plugin I define a local class that extends i18nStatistic that defines a Statistic.

 

private void addWidgetStatistic() {
        // Register a statistic.
        Statistic widgetStatistic = new i18nStatistic(WIDGETS_KEY, Statistic.Type.count)
        {
            public double sample() {
               return nwidgets;
            }

 

            public boolean isPartialSample() {
                return false;
            }
        };

 

        // Add to StatisticsManager
        statisticsManager.addStatistic(WIDGETS_KEY, widgetStatistic);
    }

 

 

So far, so good.. the sample method is called every 5 seconds and seems to be working just fine.

 

I add definitions of the resource strings for the name,description,type in the resource files.

 

However, I never see the Statistic show up in the monitoring "All Reports" list.

If I display the StatisticsManager list of Statistics, it is NOT there.

 

The following line in stats-reporter.jsp implies that the jsp file should be showing this because the same call is used to generate a list of calls to get statistics.

 

List<String> statList = Arrays.asList(getStatsViewer().getAllHighLevelStatKeys());

 

What have I missed?

 

thanks,

jon

Tags: plugins, monitoring

More Like This

  • Retrieving data ...

Bookmarked By (0)