Hi,
I modified apps/karma + statfs and the request protocoll to add the number of
active bmi connections and the used amount of swap to the server fs details.
Therefore I added a new value to the perf counter which is modified in
bmi_tcp. I'm not sure how to figure the active connections out for gm and
infiniband. Also to get a latest value of the perf counter I added
PINT_perf_retrieve_single to the performance counter. Probably there is a
better way to get a single perf counter value instead of retrieving the whole
history. The already in the request protocoll present load_1 is added to the
karma details, too.
Julian
Index: include/pvfs2-encode-stubs.h
===================================================================
RCS file: /anoncvs/pvfs2/include/pvfs2-encode-stubs.h,v
retrieving revision 1.11
diff -d -r1.11 pvfs2-encode-stubs.h
50a51
> #define endecode_fields_14(n,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12,t13,x13,t14,x14)
Index: include/pvfs2-mgmt.h
===================================================================
RCS file: /anoncvs/pvfs2/include/pvfs2-mgmt.h,v
retrieving revision 1.53
diff -d -r1.53 pvfs2-mgmt.h
39a40
> uint64_t swap_used_bytes;
45a47
> uint64_t active_connections;
309c311
< PVFS_object_ref object_ref,
---
> PVFS_object_ref object_ref,
315c317
< PVFS_object_ref object_ref,
---
> PVFS_object_ref object_ref,
Index: include/pvfs2-types.h
===================================================================
RCS file: /anoncvs/pvfs2/include/pvfs2-types.h,v
retrieving revision 1.127
diff -d -r1.127 pvfs2-types.h
286a287
> uint64_t swap_used_bytes;
292a294
> uint64_t active_connections;
294c296,297
< endecode_fields_12(
---
>
> endecode_fields_14(
301a305
> uint64_t, swap_used_bytes,
307c311,312
< uint64_t, handles_total_count);
---
> uint64_t, handles_total_count,
> uint64_t, active_connections);
Index: src/apps/admin/pvfs2-statfs.c
===================================================================
RCS file: /anoncvs/pvfs2/src/apps/admin/pvfs2-statfs.c,v
retrieving revision 1.30
diff -d -r1.30 pvfs2-statfs.c
54a55
> char scratch_swap[SCRATCH_LEN] = {0};
115c115
< scratch_size);
---
> scratch_total);
181c181,183
<
---
> PVFS_util_make_size_human_readable(
> (PVFS_size)stat_array[i].swap_used_bytes,
> scratch_swap, SCRATCH_LEN, user_opts->use_si_units);
183a186
> printf("\tswap used : %s\n", scratch_swap);
193a197,198
> printf("\tswap bytes used : %llu\n",
> llu(stat_array[i].swap_used_bytes));
227a233,236
>
>
> printf("\tactive connections: %llu\n",
> llu(stat_array[i].active_connections));
Index: src/apps/karma/details.c
===================================================================
RCS file: /anoncvs/pvfs2/src/apps/karma/details.c,v
retrieving revision 1.16
diff -d -r1.16 details.c
20a21
> "Swap used",
21a23
> "Load 1",
25a28
> "Active Connections",
44a48
> float sw_div,
86a91
> G_TYPE_STRING, /* swap used */
87a93
> G_TYPE_STRING, /* load 1 */
92,93c98,100
< G_TYPE_STRING); /* server type */
<
---
> G_TYPE_STRING, /* active connections */
> G_TYPE_STRING); /* server type */
>
184,185c191,192
< float rt_div, ra_div, up_div, ht_div, ha_div, bt_div, ba_div;
< char *rt_units, *ra_units, *up_units, *ht_units, *ha_units, *bt_units,
---
> float rt_div, ra_div, sw_div, up_div, ht_div, ha_div, bt_div, ba_div;
> char *rt_units, *ra_units, *sw_units, *up_units, *ht_units, *ha_units, *bt_units,
201a209,213
> if (s_stat[i].swap_used_bytes > s_stat[max].swap_used_bytes) max = i;
> }
> sw_units = gui_units_size(s_stat[max].swap_used_bytes, &sw_div);
>
> for (max=0, i=1; i < s_stat_ct; i++) {
237a250,254
> gui_details_column_name[GUI_DETAILS_SWAP_USED], sw_units);
> gtk_tree_view_column_set_title(col[GUI_DETAILS_SWAP_USED],
> titlebuf);
>
> snprintf(titlebuf, sizeof(titlebuf), "%s\n(%s)",
277a295
> sw_div,
293a312
> sw_div,
311a331
> float sw_div,
325a346,347
> snprintf(fmtbuf[GUI_DETAILS_SWAP_USED], 12, "%.2f",
> (float) s_stat->swap_used_bytes / sw_div);
327a350,351
> snprintf(fmtbuf[GUI_DETAILS_LOAD_1], 12, "%.2f",
> (float) s_stat->load_1 / 60000.0);
336c360,361
<
---
> snprintf(fmtbuf[GUI_DETAILS_ACTIVE_CONNECTIONS], 12, "%.2f",
> (float) s_stat->active_connections );
363a389,390
> GUI_DETAILS_SWAP_USED,
> fmtbuf[GUI_DETAILS_SWAP_USED],
365a393,394
> GUI_DETAILS_LOAD_1,
> fmtbuf[GUI_DETAILS_LOAD_1],
373a403,404
> GUI_DETAILS_ACTIVE_CONNECTIONS,
> fmtbuf[GUI_DETAILS_ACTIVE_CONNECTIONS],
Index: src/apps/karma/karma.h
===================================================================
RCS file: /anoncvs/pvfs2/src/apps/karma/karma.h,v
retrieving revision 1.11
diff -d -r1.11 karma.h
105a106
> GUI_DETAILS_SWAP_USED,
106a108
> GUI_DETAILS_LOAD_1,
110a113
> GUI_DETAILS_ACTIVE_CONNECTIONS,
Index: src/client/sysint/mgmt-statfs-list.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/client/sysint/mgmt-statfs-list.sm,v
retrieving revision 1.38
diff -d -r1.38 mgmt-statfs-list.sm
276a277
> sm_stat->swap_used_bytes = resp_stat->swap_used_bytes;
284a286
> sm_stat->active_connections = resp_stat->active_connections;
Index: src/common/misc/pint-perf-counter.c
===================================================================
RCS file: /anoncvs/pvfs2/src/common/misc/pint-perf-counter.c,v
retrieving revision 1.10
diff -d -r1.10 pint-perf-counter.c
479a480,484
> uint64_t PINT_perf_retrieve_single( struct PINT_perf_counter* pc,
> enum PINT_server_perf_keys key ){
> return pc->value_matrix[key][0];
> }
>
Index: src/common/misc/pint-perf-counter.h
===================================================================
RCS file: /anoncvs/pvfs2/src/common/misc/pint-perf-counter.h,v
retrieving revision 1.7
diff -d -r1.7 pint-perf-counter.h
33c33,34
< PINT_PERF_REQSCHED = 6
---
> PINT_PERF_REQSCHED = 6,
> PINT_PERF_ACTIVE_CONNECTIONS = 7
112,115c114,120
< uint64_t* start_time_array_ms,
< uint64_t* interval_array_ms,
< int max_key,
< int max_history);
---
> uint64_t* start_time_array_ms,
> uint64_t* interval_array_ms,
> int max_key,
> int max_history);
>
> uint64_t PINT_perf_retrieve_single( struct PINT_perf_counter* pc,
> enum PINT_server_perf_keys);
Index: src/proto/endecode-funcs.h
===================================================================
RCS file: /anoncvs/pvfs2/src/proto/endecode-funcs.h,v
retrieving revision 1.16
diff -d -r1.16 endecode-funcs.h
365c365
< encode_##t11(pptr, &x->x12); \
---
> encode_##t12(pptr, &x->x12); \
379c379
< decode_##t11(pptr, &x->x12); \
---
> decode_##t12(pptr, &x->x12); \
380a381,415
>
> #define endecode_fields_14(name,t1,x1,t2,x2,t3,x3,t4,x4,t5,x5,t6,x6,t7,x7,t8,x8,t9,x9,t10,x10,t11,x11,t12,x12,t13,x13,t14,x14) \
> static inline void encode_##name(char **pptr, const name *x) { \
> encode_##t1(pptr, &x->x1); \
> encode_##t2(pptr, &x->x2); \
> encode_##t3(pptr, &x->x3); \
> encode_##t4(pptr, &x->x4); \
> encode_##t5(pptr, &x->x5); \
> encode_##t6(pptr, &x->x6); \
> encode_##t7(pptr, &x->x7); \
> encode_##t8(pptr, &x->x8); \
> encode_##t9(pptr, &x->x9); \
> encode_##t10(pptr, &x->x10); \
> encode_##t11(pptr, &x->x11); \
> encode_##t12(pptr, &x->x12); \
> encode_##t13(pptr, &x->x13); \
> encode_##t14(pptr, &x->x14); \
> } \
> static inline void decode_##name(char **pptr, name *x) { \
> decode_##t1(pptr, &x->x1); \
> decode_##t2(pptr, &x->x2); \
> decode_##t3(pptr, &x->x3); \
> decode_##t4(pptr, &x->x4); \
> decode_##t5(pptr, &x->x5); \
> decode_##t6(pptr, &x->x6); \
> decode_##t7(pptr, &x->x7); \
> decode_##t8(pptr, &x->x8); \
> decode_##t9(pptr, &x->x9); \
> decode_##t10(pptr, &x->x10); \
> decode_##t11(pptr, &x->x11); \
> decode_##t12(pptr, &x->x12); \
> decode_##t13(pptr, &x->x13); \
> decode_##t14(pptr, &x->x14); \
> }
>
Index: src/server/perf-mon.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/perf-mon.sm,v
retrieving revision 1.8
diff -d -r1.8 perf-mon.sm
197a198,199
> s_op->resp.u.mgmt_perf_mon.perf_array[i].keyval_queue =
> static_value_matrix[PINT_PERF_ACTIVE_CONNECTIONS][i];
Index: src/server/pvfs2-server.c
===================================================================
RCS file: /anoncvs/pvfs2/src/server/pvfs2-server.c,v
retrieving revision 1.205
diff -d -r1.205 pvfs2-server.c
79a80
> {"active connections", PINT_PERF_ACTIVE_CONNECTIONS, PINT_PERF_PRESERVE},
Index: src/server/statfs.sm
===================================================================
RCS file: /anoncvs/pvfs2/src/server/statfs.sm,v
retrieving revision 1.12
diff -d -r1.12 statfs.sm
21a22,24
> #include "pint-perf-counter.h"
> extern struct PINT_perf_counter *PINT_server_pc;
>
94a98,100
> s_op->resp.u.statfs.stat.active_connections = PINT_perf_retrieve_single(PINT_server_pc,
> PINT_PERF_ACTIVE_CONNECTIONS);
>
122a129,130
> s_op->resp.u.statfs.stat.swap_used_bytes = (uint64_t)
> ((system_metrics.totalswap -system_metrics.freeswap) * system_metrics.mem_unit);
Index: src/io/bmi/bmi_tcp/bmi-tcp.c
===================================================================
RCS file: /anoncvs/pvfs2/src/io/bmi/bmi_tcp/bmi-tcp.c,v
retrieving revision 1.100
diff -d -r1.100 bmi-tcp.c
44a45,49
> #ifndef __PVFS2_CLIENT__
> #include "pint-perf-counter.h"
>
> extern struct PINT_perf_counter *PINT_server_pc;
> #endif //__PVFS2_CLIENT__
1560a1566,1568
> #ifndef __PVFS2_CLIENT__
> PINT_perf_count(PINT_server_pc, PINT_PERF_ACTIVE_CONNECTIONS, 1, PINT_PERF_SUB);
> #endif
2548a2557,2559
> #ifndef __PVFS2_CLIENT__
> PINT_perf_count(PINT_server_pc, PINT_PERF_ACTIVE_CONNECTIONS, 1, PINT_PERF_ADD);
> #endif
_______________________________________________
Pvfs2-developers mailing list
[email protected]
http://www.beowulf-underground.org/mailman/listinfo/pvfs2-developers