+1 for having a monitoring interface for pluggability.

Also, Jamon ( http://jamonapi.sourceforge.net/) is a pretty lightweight and
production quality monitoring framework.

Thanks
Chak


On 1/21/08 1:17 PM, "Kevin Brown" <[EMAIL PROTECTED]> wrote:

> Could you open up a JIRA ticket for this patch (
> http://issues.apache.org/jira/browse/SHINDIG)? Otherwise it might never get
> committed :)
> 
> Ideally we should have a monitoring interface to allow for various existing
> infrastructure to plug in, but I think this is a great start.
> 
> ~Kevin
> 
> On Jan 20, 2008 9:06 PM, Rodrigo Damazio <[EMAIL PROTECTED]> wrote:
> 
>>    Hi all. I have written a somewhat simple infrastructure for monitoring
>> the java version of shindig. It assumes there's a monitoring client
>> application which can read and parse the variable values and if necessary
>> send out any alerts or extract relevant statistics - all variables are
>> counters, which at first may sound limiting, but with fancier counters it
>> allows gathering information like "how many times a certain gadget URL has
>> been fetched", "what's the average time spent in substitutions" (by having a
>> counter which stores both the total time sum and a count of increments),
>> "how many times have we failed serving a gadget in the last 30 minutes" (by
>> having that in time buckets), etc. Any other aggregation is left to
>> monitoring clients.
>>    I'm attaching the source code for your appreciation - let me know if
>> you have any comments. (I think attachment is better than a diff since this
>> doesn't touch any existing files - I'm leaving up to the files' owners to
>> add their own calls to this code where they think it's more appropriate).
>>    There are some TODOs for the future:
>>    - a pretty HTML status page for manual examination
>>    - some sort of eviction for certain variables, so that for instance we
>> don't keep counters for gadget URLs that were used only once - I intend to
>> use isEmpty() to determine deletable counters
>>    - Implement XML output type (any suggestions for a schema that would be
>> more plug-and-play with some popular monitoring system?)
>>    - Add tests
>>    - PHP version? Not sure if this is possible, perhaps only with SRM or
>> memcached?
>> 
>> Btw, I added the servlet as:
>> 
>>   <!--  Monitoring -->
>> 
>>   <servlet>
>>     <servlet-name>monitoring</servlet-name>
>>     <servlet-class>
>>       org.apache.shindig.monitoring.MonitorReportingServlet
>>     </servlet-class>
>>   </servlet>
>> 
>>   <servlet-mapping>
>>     <servlet-name>monitoring</servlet-name>
>>     <url-pattern>/monitor</url-pattern>
>>   </servlet-mapping>
>> 
>> 
>> Example usage:
>> 
>>     MonitoringManager monitorManager =
>> MonitoringManagerFactory.getInstance();
>>     SectionMonitor monitor =
>> monitorManager.getSectionMonitor("processGadget",
>> CounterType.HISTORY);
>>     monitor.start();
>>     try {
>>        // Do some stuff
>>     } catch(Something e) {
>>        monitor.abort();
>>        return;
>>     }
>>     monitor.stop();
>> 
>> Thanks
>> Rodrigo
>> 
>> 


Reply via email to