equilibrium-data_monitor.h File Reference

Relating to server monitoring. More...

Go to the source code of this file.

Functions

status_t init_monitor (evContext ctx, int cpu)
void shutdown_monitor (void)
void monitor_add_server (uint16_t ss_id, in_addr_t app_addr, uint16_t app_port, in_addr_t server_addr, eq_smon_t *monitor)
void monitor_remove_server (uint16_t ss_id, in_addr_t app_addr, uint16_t app_port, in_addr_t server_addr)
void monitor_remove_all_servers_in_app (uint16_t ss_id, in_addr_t app_addr, uint16_t app_port)
void monitor_remove_all_servers_in_service_set (uint16_t ss_id)
void change_monitoring_config (uint16_t ss_id, in_addr_t app_addr, uint16_t app_port, eq_smon_t *monitor)
in_addr_t monitor_get_server_for (uint16_t ss_id, in_addr_t app_addr, uint16_t app_port)
void monitor_remove_session_for_server (uint16_t ss_id, in_addr_t app_addr, uint16_t app_port, in_addr_t server_addr)
void monitor_send_stats (void)


Detailed Description

Relating to server monitoring.

Relating to server monitoring / probing

Definition in file equilibrium-data_monitor.h.


Function Documentation

void change_monitoring_config ( uint16_t  ss_id,
in_addr_t  app_addr,
uint16_t  app_port,
eq_smon_t monitor 
)

Change the monitoring parameters for all servers. Does not free the pointer to the old monitor.

Parameters:
[in] ss_id service-set id
[in] app_addr Application address, used to identify the application
[in] app_port Application port
[in] monitor The server monitoring parameters (all servers in the same application use the same monitor). If NULL, then server is not monitored and assumed UP.

Definition at line 1265 of file equilibrium-data_monitor.c.

References mon_server_info_s::app, mon_app_info_s::app_lock, apps, apps_big_lock, mon_app_info_s::down_servers, INSIST_ERR, LOG, mon_app_key_t, mon_ctx, probe_server(), mon_app_info_s::server_mon_params, stop_server_probes(), and mon_app_info_s::up_servers.

Referenced by update_application().

status_t init_monitor ( evContext  ctx,
int  cpu 
)

Init the data structures that will store configuration info

Parameters:
[in] ctx event context
[in] cpu cpu to use or MSP_NEXT_END run on current event context and cpu
Returns:
SUCCESS if successful; otherwise EFAIL with an error message.

Definition at line 704 of file equilibrium-data_monitor.c.

References apps, apps_big_lock, doShutdown, LOG, mon_app_key_t, mon_ctx, and start_monitor().

Referenced by equilibrium_init().

void monitor_add_server ( uint16_t  ss_id,
in_addr_t  app_addr,
uint16_t  app_port,
in_addr_t  server_addr,
eq_smon_t monitor 
)

Add a server to monitor.

Parameters:
[in] ss_id service-set id
[in] app_addr Application address, used to identify the application
[in] app_port Application port
[in] server_addr The server address, of the server within that application
[in] monitor The server monitoring parameters (all servers in the same application must have the same monitor). If NULL, then server is not monitored and assumed UP.

Definition at line 826 of file equilibrium-data_monitor.c.

References mon_server_info_s::app, mon_app_info_s::app_lock, apps, apps_big_lock, mon_app_info_s::down_servers, INSIST_ERR, mon_server_info_s::is_up, mon_app_info_s::key, LOG, mon_app_key_t, mon_ctx, mon_app_info_s::node, probe_server(), mon_server_info_s::server_addr, mon_app_info_s::server_mon_params, mon_server_info_s::sock, mon_server_info_s::test_timer, and mon_app_info_s::up_servers.

Referenced by add_server(), and update_application().

in_addr_t monitor_get_server_for ( uint16_t  ss_id,
in_addr_t  app_addr,
uint16_t  app_port 
)

Get the server with the least load for this application

Parameters:
[in] ss_id service-set id
[in] app_addr Application address, used to identify the application
[in] app_port Application port
Returns:
the server address if the application exists and has any up servers. returns 0 if the application does not exist and, (in_addr_t)-1 if there are no "up" servers but the app exists

Definition at line 1387 of file equilibrium-data_monitor.c.

References mon_server_info_s::app, mon_app_info_s::app_lock, apps, apps_big_lock, INSIST_ERR, mon_app_key_t, mon_server_info_s::server_addr, mon_server_info_s::sessions, and mon_app_info_s::up_servers.

Referenced by process_packet().

void monitor_remove_all_servers_in_app ( uint16_t  ss_id,
in_addr_t  app_addr,
uint16_t  app_port 
)

Remove all servers from the monitor's configuration matching this application

Parameters:
[in] ss_id service-set id
[in] app_addr Application address, used to identify the application
[in] app_port Application port

Definition at line 1104 of file equilibrium-data_monitor.c.

References mon_server_info_s::app, mon_app_info_s::app_lock, apps, apps_big_lock, clean_sessions_with_app(), mon_app_info_s::down_servers, INSIST_ERR, mon_app_info_s::key, LOG, mon_app_key_t, mon_app_info_s::node, stop_server_probes(), and mon_app_info_s::up_servers.

Referenced by delete_all_servers(), delete_application(), and update_application().

void monitor_remove_all_servers_in_service_set ( uint16_t  ss_id  ) 

Remove all servers from the monitor's configuration matching this service set

Parameters:
[in] ss_id service-set id

Definition at line 1177 of file equilibrium-data_monitor.c.

References mon_server_info_s::app, mon_app_info_s::app_lock, apps, apps_big_lock, clean_sessions_with_service_set(), mon_app_info_s::down_servers, INSIST_ERR, LOG, mon_app_info_s::node, stop_server_probes(), TAILQ_HEAD(), and mon_app_info_s::up_servers.

Referenced by delete_service_set().

void monitor_remove_server ( uint16_t  ss_id,
in_addr_t  app_addr,
uint16_t  app_port,
in_addr_t  server_addr 
)

Remove the server from the monitor's configuration.

Parameters:
[in] ss_id service-set id
[in] app_addr Application address, used to identify the application
[in] app_port Application port
[in] server_addr The server address, of the server within that application

Definition at line 987 of file equilibrium-data_monitor.c.

References mon_server_info_s::app, mon_app_info_s::app_lock, apps, apps_big_lock, clean_sessions_using_server(), mon_app_info_s::down_servers, INSIST_ERR, mon_app_info_s::key, LOG, mon_app_key_t, mon_app_info_s::node, mon_server_info_s::server_addr, stop_server_probes(), and mon_app_info_s::up_servers.

Referenced by delete_server().

void monitor_remove_session_for_server ( uint16_t  ss_id,
in_addr_t  app_addr,
uint16_t  app_port,
in_addr_t  server_addr 
)

Find the server in the app, and reduce the load by one

Parameters:
[in] ss_id service-set id
[in] app_addr Application address, used to identify the application
[in] app_port Application port
[in] server_addr Server address

Definition at line 1473 of file equilibrium-data_monitor.c.

References mon_server_info_s::app, mon_app_info_s::app_lock, apps, apps_big_lock, INSIST_ERR, mon_app_key_t, mon_server_info_s::server_addr, mon_server_info_s::sessions, and mon_app_info_s::up_servers.

Referenced by aging_cleanup().

void monitor_send_stats ( void   ) 

Send server/application load stats to the mgmt component

Definition at line 1548 of file equilibrium-data_monitor.c.

References mon_server_info_s::app, mon_app_info_s::app_lock, apps, apps_big_lock, INSIST_ERR, mon_app_info_s::key, mon_app_info_s::node, notify_application_sessions(), mon_server_info_s::sessions, and mon_app_info_s::up_servers.

void shutdown_monitor ( void   ) 

Shutdown the monitor

Definition at line 764 of file equilibrium-data_monitor.c.

References mon_server_info_s::app, mon_app_info_s::app_lock, apps, apps_big_lock, doShutdown, mon_app_info_s::down_servers, INSIST_ERR, mon_app_info_s::node, stop_server_probes(), and mon_app_info_s::up_servers.

Referenced by equilibrium_quit().


2007-2009 Juniper Networks, Inc. All rights reserved. The information contained herein is confidential information of Juniper Networks, Inc., and may not be used, disclosed, distributed, modified, or copied without the prior written consent of Juniper Networks, Inc. in an express license. This information is subject to change by Juniper Networks, Inc. Juniper Networks, the Juniper Networks logo, and JUNOS are registered trademarks of Juniper Networks, Inc. in the United States and other countries. All other trademarks, service marks, registered trademarks, or registered service marks are the property of their respective owners.
Generated on Sun May 30 20:26:56 2010 for SDK Your Net Corporation Equilibrium Load Balancer Example: equilibrium-data 1.0 by Doxygen 1.5.1