From: Matthias B. <mat...@sg...> - 2008-01-24 18:40:43
|
On Thu, 24 Jan 2008, Brad Nicholes wrote: > I like your plan. It is easier to review smaller patches that deal with specific parts of the overall feature, than it is to try to wrap your head around one big patch. I would suggest that you go with the smaller patches. > > Brad > Excellent. Here comes the first patch doing some minor cleanup work on gmond.c If anyone has something to add to this patch in terms of cleanup work I gladly include that. For the patch I have some design questions: I have noticed that Ganglia_collection_group_send() takes the curent time (->'now') as a param, but then defines a local var with the same name and recollects the time via apr_time_now(). However, Ganglia_collection_group_collect() sticks with the passed in 'now' parameter. Is this a bug or a feature ? Should Ganglia_collection_group_send() not recollect the time and stick with the passed in time ? The patch below resolved the time ambiguity for Ganglia_collection_group_send() in one way that seems to work. Any opnions on this ? Thanx, Matthias svn diff gmond.c Index: gmond.c =================================================================== --- gmond.c (revision 929) +++ gmond.c (working copy) @@ -1769,6 +1769,7 @@ if (strcasecmp(name, mi[k].name) == 0) { memcpy (metric_info, &(mi[k]), sizeof(Ganglia_25metric)); + break; } } @@ -1948,7 +1949,7 @@ } void -Ganglia_collection_group_send( Ganglia_collection_group *group, apr_time_t now) +Ganglia_collection_group_send( Ganglia_collection_group *group) { int i; @@ -2104,7 +2105,7 @@ Ganglia_collection_group *group = ((Ganglia_collection_group **)(collection_groups->elts))[i]; if( group->next_send <= now ) { - Ganglia_collection_group_send(group, now); + Ganglia_collection_group_send(group); } } |