Code Review
/
vpp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
API refactoring : l2, mpls, sr
[vpp.git]
/
gmod
/
gmod
/
mod_vpp.c
diff --git
a/gmod/gmod/mod_vpp.c
b/gmod/gmod/mod_vpp.c
index
c28f1a5
..
572f9ef
100644
(file)
--- a/
gmod/gmod/mod_vpp.c
+++ b/
gmod/gmod/mod_vpp.c
@@
-21,7
+21,7
@@
#include <vppinfra/clib.h>
#include <vppinfra/vec.h>
#include <vppinfra/hash.h>
#include <vppinfra/clib.h>
#include <vppinfra/vec.h>
#include <vppinfra/hash.h>
-#include <svmdb.h>
+#include <svm
/svm
db.h>
#include <errno.h>
mmodule vpp_module;
#include <errno.h>
mmodule vpp_module;
@@
-33,6
+33,7
@@
static int vpp_metric_init (apr_pool_t *p)
apr_array_header_t *list_params = vpp_module.module_params_list;
mmparam *params;
char *chroot_path = 0;
apr_array_header_t *list_params = vpp_module.module_params_list;
mmparam *params;
char *chroot_path = 0;
+ svmdb_map_args_t _ma, *ma= &_ma;
int i;
if (str_params) {
int i;
if (str_params) {
@@
-47,7
+48,10
@@
static int vpp_metric_init (apr_pool_t *p)
}
}
}
}
- svmdb_client = svmdb_map_chroot (chroot_path);
+ memset (ma, 0, sizeof (*ma));
+ ma->root_path = (char *)chroot_path;
+
+ svmdb_client = svmdb_map (ma);
/* Initialize the metadata storage for each of the metrics and then
/* Initialize the metadata storage for each of the metrics and then
@@
-70,7
+74,7
@@
static g_val_t vpp_metric_handler (int metric_index)
{
g_val_t val;
pid_t *vpp_pidp;
{
g_val_t val;
pid_t *vpp_pidp;
- f64 *vector_ratep, *vpp_rx_ratep;
+ f64 *vector_ratep, *vpp_rx_ratep
, *sig_error_ratep
;
switch (metric_index) {
case 0:
switch (metric_index) {
case 0:
@@
-108,6
+112,16
@@
static g_val_t vpp_metric_handler (int metric_index)
val.d = 0.0;
break;
val.d = 0.0;
break;
+ case 3:
+ sig_error_ratep = svmdb_local_get_vec_variable
+ (svmdb_client, "vpp_sig_error_rate", sizeof (*vector_ratep));
+ if (sig_error_ratep) {
+ val.d = *sig_error_ratep;
+ vec_free (sig_error_ratep);
+ } else
+ val.d = 0.0;
+ break;
+
default:
val.d = 0.0;
}
default:
val.d = 0.0;
}
@@
-125,6
+139,10
@@
static Ganglia_25metric vpp_metric_info[] =
{0, "Input_Rate", 100, GANGLIA_VALUE_DOUBLE, "5 sec RX rate",
"both", "%.1f",
UDP_HEADER_SIZE+8, "VPP Aggregate RX Rate"},
{0, "Input_Rate", 100, GANGLIA_VALUE_DOUBLE, "5 sec RX rate",
"both", "%.1f",
UDP_HEADER_SIZE+8, "VPP Aggregate RX Rate"},
+ {0, "Sig_Error_Rate", 100, GANGLIA_VALUE_DOUBLE,
+ "5 sec significant error rate",
+ "both", "%.1f",
+ UDP_HEADER_SIZE+8, "VPP Significant Error Rate"},
{0, NULL}
};
{0, NULL}
};