Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

*** empty log message ***

  • Loading branch information...
commit 95bca5c62a920dcdf401c9b364f0e9c1a687e686 1 parent 5171f25
massie authored
View
8 monitor-core/gmond/gmond.c
@@ -820,7 +820,7 @@ host_metric_type( Ganglia_value_types type)
/* NOT THREAD SAFE */
static char *
-host_metric_value( Ganglia_old_metric *metric, Ganglia_message *message )
+host_metric_value( Ganglia_25metric *metric, Ganglia_message *message )
{
static char value[1024];
if(!metric||!message)
@@ -860,12 +860,12 @@ host_metric_value( Ganglia_old_metric *metric, Ganglia_message *message )
static apr_status_t
print_host_metric( apr_socket_t *client, Ganglia_metric_data *data )
{
- Ganglia_old_metric *metric;
+ Ganglia_25metric *metric;
char metricxml[1024];
apr_size_t len;
apr_time_t now;
- metric = Ganglia_old_metric_get( data->message.id );
+ metric = Ganglia_25metric_bykey( data->message.id );
if(!metric)
return APR_SUCCESS;
@@ -878,7 +878,7 @@ print_host_metric( apr_socket_t *client, Ganglia_metric_data *data )
host_metric_type( metric->type ),
metric->units? metric->units: "",
(int)((now - data->last_heard_from) / APR_USEC_PER_SEC),
- metric->step,
+ metric->tmax,
metric->slope );
return apr_send(client, metricxml, &len);
View
226 monitor-core/lib/protocol.x
@@ -9,81 +9,6 @@ enum Ganglia_value_types {
GANGLIA_VALUE_DOUBLE
};
-typedef string varstring<>;
-
-union Ganglia_value switch(Ganglia_value_types type) {
- case GANGLIA_VALUE_UNKNOWN:
- void;
- case GANGLIA_VALUE_STRING:
- string str<>;
- case GANGLIA_VALUE_UNSIGNED_SHORT:
- unsigned short u_short;
- case GANGLIA_VALUE_SHORT:
- short s_short;
- case GANGLIA_VALUE_UNSIGNED_INT:
- unsigned int u_int;
- case GANGLIA_VALUE_INT:
- int s_int;
- case GANGLIA_VALUE_FLOAT:
- float f;
- case GANGLIA_VALUE_DOUBLE:
- double d;
- default:
- void;
-};
-
-struct Ganglia_unit_value {
- Ganglia_value value;
- char *units;
-};
-
-#if 0
-struct Ganglia_metric {
- string name<>;
- Ganglia_value value;
-};
-
-/* Necessary for source to act as proxy */
-struct Ganglia_hostinfo {
- string hostname<>;
- string ip<>;
-};
-
-/* Necessary for reliable UDP (later) */
-struct Ganglia_msginfo {
- unsigned int seq;
- unsigned int timestamp;
-};
-
-enum Ganglia_data_state {
- GANGLIA_METRIC_CONSTANT, /* slope == "zero" */
- GANGLIA_METRIC_TIME_THRESHOLD, /* slope != "zero" here down */
- GANGLIA_METRIC_VALUE_THRESHOLD,
- GANGLIA_METRIC_WARNING,
- GANGLIA_METRIC_ALERT,
- GANGLIA_METRIC_UNKNOWN_OLD_FORMAT
-};
-
-struct Ganglia_message_header_26 {
- Ganglia_hostinfo *host;
- Ganglia_msginfo *msg;
-};
-
-struct Ganglia_message_body_26 {
- unsigned int source_instance;
- Ganglia_data_state state;
- unsigned int age;
- unsigned int step;
- string units<>;
- Ganglia_metric metrics<>;
-};
-
-struct Ganglia_format_26 {
- Ganglia_message_header_26 *hdr;
- Ganglia_message_body_26 *bdy;
-};
-#endif
-
struct Ganglia_gmetric_message {
string type<>;
string name<>;
@@ -131,24 +56,10 @@ enum Ganglia_message_formats {
metric_disk_total,
metric_disk_free,
metric_part_max_used,
- GANGLIA_NUM_OLD_METRICS /* this should always directly follow the last metric_* */
-
-#if 0
- GANGLIA_FORMAT_26 = 2874789, /* give a little space for old metrics in case they are modified */
-
- /* insert new formats here. */
-
- GANGLIA_NUM_FORMATS /* this should always be the last entry */
-#endif
+ GANGLIA_NUM_25_METRICS /* this should always directly follow the last 25 metric_* */
};
union Ganglia_message switch (Ganglia_message_formats id) {
-#if 0
- case GANGLIA_FORMAT_26:
- Ganglia_format_26 *format_26;
-#endif
-
- /* 2.5.x sources... */
case metric_user_defined:
Ganglia_gmetric_message gmetric;
@@ -201,74 +112,87 @@ union Ganglia_message switch (Ganglia_message_formats id) {
void;
};
+struct Ganglia_25metric
+{
+ int key;
+ string name<16>;
+ int tmax;
+ Ganglia_value_types type;
+ string units<32>;
+ string slope<32>;
+ string fmt<32>;
+};
+
#ifdef RPC_HDR
-%
-%
-%struct Ganglia_old_metric /* this is for limited 2.5.x compatibility ... */
-%{
-% int key; /* the unique key for this metric.
-% matches position in metric array and enum. */
-% const char name[16]; /* the name of the metric */
-% int step; /* how often is the metric collected */
-% Ganglia_value_types type; /* the type of data to expect */
-% char units[32]; /* units the value are in */
-% char slope[32]; /* slope of the metric */
-% char fmt[32]; /* how to format the data into a string */
-%};
-%typedef struct Ganglia_old_metric Ganglia_old_metric;
-%
-% Ganglia_old_metric *Ganglia_old_metric_get( int key );
-%
+% Ganglia_25metric *Ganglia_25metric_bykey( int key );
+% Ganglia_25metric *Ganglia_25metric_byname( char *name );
#endif
+
#ifdef RPC_XDR
-%
-% Ganglia_old_metric *
-% Ganglia_old_metric_get( int key )
-% {
-% static Ganglia_old_metric ganglia_old_metric_array[GANGLIA_NUM_OLD_METRICS] = {
+% Ganglia_25metric ganglia_25_metric_array[GANGLIA_NUM_25_METRICS] = {
% { metric_user_defined, "gmetric", 0, GANGLIA_VALUE_UNKNOWN, "", "" },
-% { metric_cpu_num, "cpu_num", -1, GANGLIA_VALUE_UNSIGNED_SHORT, "CPUs", "zero", "%hu"},
-% { metric_cpu_speed, "cpu_speed", -1, GANGLIA_VALUE_UNSIGNED_INT, "MHz", "zero", "%hu"},
-% { metric_mem_total, "mem_total", -1, GANGLIA_VALUE_UNSIGNED_INT, "KB", "zero", "%u"},
-% { metric_swap_total, "swap_total", -1, GANGLIA_VALUE_UNSIGNED_INT, "KB", "zero", "%u"},
-% { metric_boottime, "boottime", -1, GANGLIA_VALUE_UNSIGNED_INT, "s", "zero", "%u"},
-% { metric_sys_clock, "sys_clock", -1, GANGLIA_VALUE_UNSIGNED_INT, "s", "zero", "%u"},
-% { metric_machine_type, "machine_type", -1, GANGLIA_VALUE_STRING, "", "zero", "%s"},
-% { metric_os_name, "os_name", -1, GANGLIA_VALUE_STRING, "", "zero", "%s"},
-% { metric_os_release, "os_release", -1, GANGLIA_VALUE_STRING, "", "zero", "%s"},
-% { metric_cpu_user, "cpu_user", 20, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
-% { metric_cpu_nice, "cpu_nice", 20, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
-% { metric_cpu_system, "cpu_system", 20, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
-% { metric_cpu_idle, "cpu_idle", 20, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
-% { metric_cpu_aidle, "cpu_aidle", 950, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
-% { metric_load_one, "load_one", 20, GANGLIA_VALUE_FLOAT, "", "both", "%.2f"},
-% { metric_load_five, "load_five", 40, GANGLIA_VALUE_FLOAT, "", "both", "%.2f"},
-% { metric_load_fifteen, "load_fifteen", 80, GANGLIA_VALUE_FLOAT, "", "both", "%.2f"},
-% { metric_proc_run, "proc_run", 80, GANGLIA_VALUE_UNSIGNED_INT, "", "both", "%u"},
-% { metric_proc_total, "proc_total", 80, GANGLIA_VALUE_UNSIGNED_INT, "", "both", "%u"},
-% { metric_mem_free, "mem_free", 40, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
-% { metric_mem_shared, "mem_shared", 40, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
-% { metric_mem_buffers, "mem_buffers", 40, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
-% { metric_mem_cached, "mem_cached", 40, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
-% { metric_swap_free, "swap_free", 40, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
-% { metric_gexec, "gexec", -1, GANGLIA_VALUE_STRING, "", "zero", "%s"},
-% { metric_heartbeat, "heartbeat", -1, GANGLIA_VALUE_UNSIGNED_INT, "", "", "%u"},
+% { metric_cpu_num, "cpu_num", 1200, GANGLIA_VALUE_UNSIGNED_SHORT, "CPUs", "zero", "%hu"},
+% { metric_cpu_speed, "cpu_speed", 1200, GANGLIA_VALUE_UNSIGNED_INT, "MHz", "zero", "%hu"},
+% { metric_mem_total, "mem_total", 1200, GANGLIA_VALUE_UNSIGNED_INT, "KB", "zero", "%u"},
+% { metric_swap_total, "swap_total", 1200, GANGLIA_VALUE_UNSIGNED_INT, "KB", "zero", "%u"},
+% { metric_boottime, "boottime", 1200, GANGLIA_VALUE_UNSIGNED_INT, "s", "zero", "%u"},
+% { metric_sys_clock, "sys_clock", 1200, GANGLIA_VALUE_UNSIGNED_INT, "s", "zero", "%u"},
+% { metric_machine_type, "machine_type", 1200, GANGLIA_VALUE_STRING, "", "zero", "%s"},
+% { metric_os_name, "os_name", 1200, GANGLIA_VALUE_STRING, "", "zero", "%s"},
+% { metric_os_release, "os_release", 1200, GANGLIA_VALUE_STRING, "", "zero", "%s"},
+% { metric_cpu_user, "cpu_user", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
+% { metric_cpu_nice, "cpu_nice", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
+% { metric_cpu_system, "cpu_system", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
+% { metric_cpu_idle, "cpu_idle", 90, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
+% { metric_cpu_aidle, "cpu_aidle", 3800, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"},
+% { metric_load_one, "load_one", 70, GANGLIA_VALUE_FLOAT, "", "both", "%.2f"},
+% { metric_load_five, "load_five", 325, GANGLIA_VALUE_FLOAT, "", "both", "%.2f"},
+% { metric_load_fifteen, "load_fifteen", 950, GANGLIA_VALUE_FLOAT, "", "both", "%.2f"},
+% { metric_proc_run, "proc_run", 950, GANGLIA_VALUE_UNSIGNED_INT, "", "both", "%u"},
+% { metric_proc_total, "proc_total", 950, GANGLIA_VALUE_UNSIGNED_INT, "", "both", "%u"},
+% { metric_mem_free, "mem_free", 180, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
+% { metric_mem_shared, "mem_shared", 180, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
+% { metric_mem_buffers, "mem_buffers", 180, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
+% { metric_mem_cached, "mem_cached", 180, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
+% { metric_swap_free, "swap_free", 180, GANGLIA_VALUE_UNSIGNED_INT, "KB", "both", "%u"},
+% { metric_gexec, "gexec", 300, GANGLIA_VALUE_STRING, "", "zero", "%s"},
+% { metric_heartbeat, "heartbeat", 20, GANGLIA_VALUE_UNSIGNED_INT, "", "", "%u"},
% { metric_mtu, "mtu", 1200, GANGLIA_VALUE_UNSIGNED_INT, "", "both", "%u"},
-% { metric_location, "location", -1, GANGLIA_VALUE_STRING, "(x,y,z)", "", "%s"},
-% { metric_bytes_out, "bytes_out", 40, GANGLIA_VALUE_FLOAT, "bytes/sec", "both", "%.2f"},
-% { metric_bytes_in, "bytes_in", 40, GANGLIA_VALUE_FLOAT, "bytes/sec", "both", "%.2f"},
-% { metric_pkts_in, "pkts_in", 40, GANGLIA_VALUE_FLOAT, "packets/sec","both", "%.2f"},
-% { metric_pkts_out, "pkts_out", 40, GANGLIA_VALUE_FLOAT, "packets/sec","both", "%.2f"},
-% { metric_disk_total, "disk_total", 3600, GANGLIA_VALUE_DOUBLE, "GB", "both", "%.3f"},
-% { metric_disk_free, "disk_free", 40, GANGLIA_VALUE_DOUBLE, "GB", "both", "%.3f"},
-% { metric_part_max_used,"part_max_used", 40, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"}
+% { metric_location, "location", 1200, GANGLIA_VALUE_STRING, "(x,y,z)", "", "%s"},
+% { metric_bytes_out, "bytes_out", 300, GANGLIA_VALUE_FLOAT, "bytes/sec", "both", "%.2f"},
+% { metric_bytes_in, "bytes_in", 300, GANGLIA_VALUE_FLOAT, "bytes/sec", "both", "%.2f"},
+% { metric_pkts_in, "pkts_in", 300, GANGLIA_VALUE_FLOAT, "packets/sec","both", "%.2f"},
+% { metric_pkts_out, "pkts_out", 300, GANGLIA_VALUE_FLOAT, "packets/sec","both", "%.2f"},
+% { metric_disk_total, "disk_total", 1200, GANGLIA_VALUE_DOUBLE, "GB", "both", "%.3f"},
+% { metric_disk_free, "disk_free", 180, GANGLIA_VALUE_DOUBLE, "GB", "both", "%.3f"},
+% { metric_part_max_used,"part_max_used", 180, GANGLIA_VALUE_FLOAT, "%", "both", "%.1f"}
% };
%
-% if(key < 0 || key >= GANGLIA_NUM_OLD_METRICS)
-% {
-% return NULL;
-% }
-% return &ganglia_old_metric_array[key];
+% Ganglia_25metric *
+% Ganglia_25metric_bykey( int key )
+% {
+% if(key < 0 || key >= GANGLIA_NUM_25_METRICS)
+% {
+% return NULL;
+% }
+% return &ganglia_25_metric_array[key];
+% }
+% Ganglia_25metric *
+% Ganglia_25metric_byname( char *name )
+% {
+% int i;
+% if(!name)
+% {
+% return NULL;
+% }
+% for(i = 0; i< GANGLIA_NUM_25_METRICS; i++)
+% {
+% if(! strcasecmp(name, ganglia_25_metric_array[i].name))
+% {
+% return &ganglia_25_metric_array[i];
+% }
+% }
+% return NULL;
% }
#endif
View
133 monitor-core/srclib/libmetrics/key_ugly.h
@@ -1,133 +0,0 @@
-#ifndef KEY_UGLY_H
-#define KEY_UGLY_H 1
-
-/*
- * All behavior of gmond is tweak'd by this array..
- *
- * Each metric is checked during some random interval between "check_min" and
- * "check_max" (assuming the threshold value is not negative). If the metric is
- * "threshold" greater than the previous metric value then the key_metric
- * (listed on the left) is multicast. If there has been no multicast
- * during some random interval from "mcast_min" to "mcast_max" then a multicast
- * is sent regardless of the metric value.
- *
- */
-#define INIT 0, 0, {0}, {0}
-#define KEY(NAME) { #NAME, NAME ##_func, INIT
-
-metric_t metric[num_key_metrics] = {
-/* threshold check_max mcast_max units */
-/* key check_min mcast_min type fmt */
-/*------------------------------------------------------------------*/
-
-/* user_defined does nothing */
-{"user_defined",metric_init,
- INIT, -1, -1, -1, -1, -1, g_int32, "", ""},
-
-/* CONFIGURATION METRICS */
-KEY(cpu_num), -1, -1, -1, 900, 1200, g_uint16, "","%hu"},
-KEY(cpu_speed), -1, -1, -1, 900, 1200, g_uint32, "MHz", "%hu"},
-KEY(mem_total), -1, -1, -1, 900, 1200, g_uint32, "KB", "%u" },
-KEY(swap_total), -1, -1, -1, 900, 1200, g_uint32, "KB", "%u" },
-KEY(boottime), -1, -1, -1, 900, 1200, g_timestamp, "s", "%u" },
-KEY(sys_clock), -1, -1, -1, 900, 1200, g_timestamp, "s", "%u" },
-KEY(machine_type), -1, -1, -1, 900, 1200, g_string, "", "%s" },
-KEY(os_name), -1, -1, -1, 900, 1200, g_string, "", "%s" },
-KEY(os_release), -1, -1, -1, 900, 1200, g_string, "", "%s" },
-
-/* STATE METRICS */
-KEY(cpu_user), 1, 15, 20, 60, 90, g_float, "%", "%.1f"},
-KEY(cpu_nice), 1, 15, 20, 60, 90, g_float, "%", "%.1f"},
-KEY(cpu_system), 1, 15, 20, 60, 90, g_float, "%", "%.1f"},
-KEY(cpu_idle), 5, 15, 20, 60, 90, g_float, "%", "%.1f"},
-KEY(cpu_wio), 1, 15, 20, 60, 90, g_float, "%", "%.1f"},
-KEY(cpu_aidle), 5, 850, 950, 3400, 3800, g_float, "%", "%.1f"},
-KEY(cpu_intr), 1, 15, 20, 60, 90, g_float, "%", "%.1f"},
-KEY(cpu_sintr), 1, 15, 20, 60, 90, g_float, "%", "%.1f"},
-
-/* (sacerdoti) Experiments have shown gmon resting bandwidth is around 2KB/s for
- * a 128-node cluster. We set the value thresh of these metrics to double that.
- */
-KEY(bytes_out), 4096, 30, 40, 200, 300, g_float, "bytes/sec", "%.2f" },
-KEY(bytes_in), 4096, 30, 40, 200, 300, g_float, "bytes/sec", "%.2f" },
-KEY(pkts_in), 256, 30, 40, 200, 300, g_float, "packets/sec", "%.2f" },
-KEY(pkts_out), 256, 30, 40, 200, 300, g_float, "packets/sec", "%.2f" },
-
-/*
- * The amount of disk space could change - hot-swap, mounts, etc. check: 30-60min. */
-KEY(disk_total), 1, 1800, 3600, 900, 1200, g_double, "GB", "%.3f" },
-KEY(disk_free), 1, 30, 40, 120, 180, g_double, "GB", "%.3f" },
-KEY(part_max_used), 1, 30, 40, 120, 180, g_float, "%", "%.1f" },
-KEY(load_one), 1, 15, 20, 50, 70, g_float, "", "%.2f"},
-KEY(load_five), 1, 30, 40, 275, 325, g_float, "", "%.2f"},
-KEY(load_fifteen), 1, 60, 80, 850, 950, g_float, "", "%.2f"},
-KEY(proc_run), 1, 45, 80, 850, 950, g_uint32, "","%u"},
-KEY(proc_total), 1, 45, 80, 850, 950, g_uint32, "","%u"},
-KEY(mem_free), 1024, 30, 40, 120, 180, g_uint32, "KB", "%u" },
-KEY(mem_shared), 1024, 30, 40, 120, 180, g_uint32, "KB", "%u" },
-KEY(mem_buffers),1024, 30, 40, 120, 180, g_uint32, "KB", "%u" },
-KEY(mem_cached), 1024, 30, 40, 120, 180, g_uint32, "KB", "%u" },
-KEY(swap_free), 1024, 30, 40, 120, 180, g_uint32, "KB", "%u" },
-
-/* gmond internals */
-KEY(gexec), -1, -1, -1, 180, 300, g_string, "", "%s"},
-KEY(heartbeat), -1, -1, -1, 10, 20, g_uint32, "", "%u"},
-KEY(mtu), -1, -1, -1, 900, 1200, g_uint32, "B", "%u" },
-KEY(location), -1, -1, -1, 900, 1200, g_string, "(x,y,z)", "%s" }
-
-#ifdef SOLARIS
-,
-/* buffer reads and writes, adjusted per second */
-
-KEY(bread_sec), 1, 15, 20, 60, 90, g_float, "", "%.2f" },
-KEY(bwrite_sec), 1, 15, 20, 60, 90, g_float, "", "%.2f" },
-
-/* linear reads/writes, adjusted per second */
-
-KEY(lread_sec),1, 15, 20, 60, 90, g_float, "", "%.2f" },
-KEY(lwrite_sec), 1, 15, 20, 60, 90, g_float, "", "%.2f" },
-
-/* cache hit ratios, rcache = 1 - (bread/lread), wcache = 1 - (bwrite/lwrite) */
-
-KEY(rcache), 1, 15, 20, 60, 90, g_float, "%", "%.1f" },
-KEY(wcache), 1, 15, 20, 60, 90, g_float, "%", "%.1f" },
-
-/* physical reads/writes per second. */
-
-KEY(phread_sec), 1, 15, 20, 60, 90, g_float, "", "%.2f" },
-KEY(phwrite_sec), 1, 15, 20, 60, 90, g_float, "", "%.2f" }
-
-#endif
-
-#ifdef LINUX
-#endif
-
-#ifdef CYGWIN
-#endif
-
-#ifdef HPUX
-,
-KEY(mem_arm), 1024, 30, 40, 120, 180, g_uint32, "KB", "%u" },
-KEY(mem_rm), 1024, 30, 40, 120, 180, g_uint32, "KB", "%u" },
-KEY(mem_avm), 1024, 30, 40, 120, 180, g_uint32, "KB", "%u" },
-KEY(mem_vm), 1024, 30, 40, 120, 180, g_uint32, "KB", "%u" }
-
-#endif
-
-#ifdef FREEBSD
-#endif
-
-#ifdef IRIX
-#endif
-
-#ifdef AIX
-#endif
-
-#ifdef DARWIN
-#endif
-
-#ifdef OSF
-#endif
-};
-
-#endif /* KEY_UGLY_H */
Please sign in to comment.
Something went wrong with that request. Please try again.