Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
*** empty log message ***
  • Loading branch information
massie committed Jan 25, 2005
1 parent e095460 commit aae8df4
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 11 deletions.
33 changes: 23 additions & 10 deletions monitor-core/gmond/gmond.c
Expand Up @@ -1641,22 +1641,30 @@ main ( int argc, char *argv[] )
/* Create the host hash table */
hosts = apr_hash_make( global_context );

next_collection =0;
last_cleanup =0;
/* Initialize time variables */
last_cleanup = next_collection = now = apr_time_now();

/* Loop */
for(;;)
{
if(!deaf)
{
/* Pull in incoming data */
poll_listen_channels(next_collection - now, now);
}
else
{
/* Sleep until next collection */
apr_sleep( next_collection - now );
}

/* only continue if it's time to process our collection groups */
now = apr_time_now();
if(now < next_collection)
continue;

/* Read data until we need to collect/write data */
if(!deaf)
{
/* collect data from listen channels */
for(; mute || now < next_collection;)
{
poll_listen_channels(mute? 60 * APR_USEC_PER_SEC: next_collection - now, now);
now = apr_time_now();
}

/* cleanup the data if the cleanup threshold has been met */
if( (now - last_cleanup) > cleanup_threshold )
{
Expand All @@ -1670,6 +1678,11 @@ main ( int argc, char *argv[] )
/* collect data from collection_groups */
next_collection = process_collection_groups( now );
}
else
{
/* we're mute. nothing to collect and send. */
next_collection = now + 60 * APR_USEC_PER_SEC;
}
}

return 0;
Expand Down
2 changes: 2 additions & 0 deletions monitor-core/lib/ganglia.h
Expand Up @@ -61,6 +61,8 @@ int Ganglia_gmetric_set( Ganglia_gmetric gmetric, char *name, char *value, char
int Ganglia_gmetric_send( Ganglia_gmetric gmetric, Ganglia_udp_send_channels send_channels );
void Ganglia_gmetric_destroy( Ganglia_gmetric gmetric );

void build_default_gmond_configuration(Ganglia_pool context);


extern int gexec_errno;

Expand Down
7 changes: 6 additions & 1 deletion monitor-core/lib/libgmond.c
Expand Up @@ -206,7 +206,7 @@ collection_group { \n\
} \n\
} \n\
\n\
/* This collection group will collect the CPU and load status info every 20 secs. \n\
/* This collection group will collect the CPU status info every 20 secs. \n\
The time threshold is set to 90 seconds. In honesty, this time_threshold could be \n\
set significantly higher to reduce unneccessary network chatter. */ \n\
collection_group { \n\
Expand Down Expand Up @@ -245,6 +245,11 @@ collection_group { \n\
name = \"cpu_sintr\" \n\
value_threshold = \"1.0\" \n\
} \n\
} \n\
\n\
collection_group { \n\
collect_every = 20 \n\
time_threshold = 90 \n\
/* Load Averages */ \n\
metric { \n\
name = \"load_one\" \n\
Expand Down

0 comments on commit aae8df4

Please sign in to comment.