A idea to speed up access times to service records

Ian Holsman lists at holsman.net
Wed Mar 31 07:38:46 CEST 2004


Hi.

I was looking through the code while I was attempting to patch the glib 
hash functions into the 1.x codebase, and was thinking that the services
hash table wasn't ideal.


wouldn't it be better if there was a linked list of services for each 
host (instead of either a global linked list/hash on host/service name)


ie.. in the host structure you would have something like

host_struct {
...
service *service_head;
..
}

and in the service_struct something like

service_struct {
..
service *service_next;
host*host
}

this was you could navigate around instead of having to go through all 
the lists the matching host/service.
I think the above would work better than having a hash on the combined 
service/host names. and you could use this in a lot of places in the 
nagios code.

oh.. a humble request..
can someone please run indent on the code in CVS and check that in.


Regards
Ian.

--
Ian Holsman
blog: http://blog.holsman.net
PH:  03-9857-3742 (oz)



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click




More information about the Developers mailing list