[PVFS2-CVS]
commit by rbross in pvfs2/src/apps/karma: details.c karma.c
CVS commit program
cvs at parl.clemson.edu
Wed Feb 11 14:12:22 EST 2004
Update of /projects/cvsroot/pvfs2/src/apps/karma
In directory parlweb:/tmp/cvs-serv5698/src/apps/karma
Modified Files:
details.c karma.c
Log Message:
Enabled sorting again after fixing bug pointed out by Nathan Porter a while
back; seems ok now?
Also, tuned timeout functions so that stats are gathered less frequently
while traffic data is still gathered frequently.
Index: details.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/karma/details.c,v
diff -p -u -r1.9 -r1.10
--- details.c 10 Feb 2004 18:15:43 -0000 1.9
+++ details.c 11 Feb 2004 19:12:22 -0000 1.10
@@ -6,7 +6,7 @@
#include "karma.h"
-#undef GUI_DETAILS_ENABLE_SORTING
+#define GUI_DETAILS_ENABLE_SORTING
/* values used for column names; don't mess with these indescriminately */
enum {
@@ -298,8 +298,8 @@ static gint gui_details_float_string_com
gtk_tree_model_get(model, iter_a, (gint) col_id, &string_a, -1);
gtk_tree_model_get(model, iter_b, (gint) col_id, &string_b, -1);
- a = strtof(string_a);
- b = strtof(string_b);
+ a = (float) strtod(string_a, NULL);
+ b = (float) strtod(string_b, NULL);
g_free(string_a);
g_free(string_b);
Index: karma.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/apps/karma/karma.c,v
diff -p -u -r1.6 -r1.7
--- karma.c 11 Feb 2004 02:09:57 -0000 1.6
+++ karma.c 11 Feb 2004 19:12:22 -0000 1.7
@@ -7,7 +7,8 @@
#include "pvfs2.h"
#include "pvfs2-mgmt.h"
-gint timer_callback(gpointer data);
+static gint status_timer_callback(gpointer data);
+static gint traffic_timer_callback(gpointer data);
static GtkWidget *main_window;
@@ -103,10 +104,15 @@ int main(int argc,
/* show the window */
gtk_widget_show_all(main_window);
- timer_callback(NULL);
+ status_timer_callback(NULL);
+ traffic_timer_callback(NULL);
+
+ gtk_timeout_add(5000 /* 5 seconds */,
+ status_timer_callback,
+ NULL);
gtk_timeout_add(1000 /* 1 second */,
- timer_callback,
+ traffic_timer_callback,
NULL);
/* handle events */
@@ -115,14 +121,11 @@ int main(int argc,
return 0;
}
-gint timer_callback(gpointer data)
+static gint status_timer_callback(gpointer data)
{
struct PVFS_mgmt_server_stat *svr_stat;
int i, ret, svr_stat_ct = 0;
struct gui_status_graph_data *graph_data;
- struct gui_traffic_raw_data *raw_traffic_data;
-
- static struct gui_traffic_graph_data *traffic_graph = NULL;
ret = gui_comm_stats_retrieve(&svr_stat, &svr_stat_ct);
if (ret != 0) {
@@ -138,6 +141,16 @@ gint timer_callback(gpointer data)
}
gui_details_update(svr_stat, svr_stat_ct);
+
+ return 1; /* schedule it again */
+}
+
+static gint traffic_timer_callback(gpointer data)
+{
+ int ret, svr_stat_ct = 0;
+ struct gui_traffic_raw_data *raw_traffic_data;
+
+ static struct gui_traffic_graph_data *traffic_graph = NULL;
ret = gui_comm_traffic_retrieve(&raw_traffic_data, &svr_stat_ct);
More information about the PVFS2-CVS
mailing list