summaryrefslogtreecommitdiff
path: root/ctdb/utils
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@suse.de>2011-09-02 17:34:19 +0200
committerDavid Disseldorp <ddiss@suse.de>2011-09-06 14:01:18 +0200
commit66f92be635f5d001fb82517175f44cc72fe7db61 (patch)
treee92d2d15926ab08dab1dc8ba6a9698d36d817719 /ctdb/utils
parent927abee4c130567ce89253c603c2b83596f25e6a (diff)
downloadsamba-66f92be635f5d001fb82517175f44cc72fe7db61.tar.gz
pmda: handle struct latency_counter and add num_recoveries
Rebase the CTDB PMDA from 1.0.114 to master: - Add tevent and ctdb_protocol includes - Handle latency metrics now stored under struct latency_counter - Add new metric for the num_recoveries counter (This used to be ctdb commit 2165a6f5117a71f9f97f46be9708fa34c037e17c)
Diffstat (limited to 'ctdb/utils')
-rw-r--r--ctdb/utils/pmda/help2
-rw-r--r--ctdb/utils/pmda/pmda_ctdb.c22
-rw-r--r--ctdb/utils/pmda/pmns1
3 files changed, 18 insertions, 7 deletions
diff --git a/ctdb/utils/pmda/help b/ctdb/utils/pmda/help
index 4066fde3ade..0e9984eab3a 100644
--- a/ctdb/utils/pmda/help
+++ b/ctdb/utils/pmda/help
@@ -102,3 +102,5 @@
@ ctdb.max_lockwait_latency maximum time spent waiting for a tdb chainlock
@ ctdb.max_childwrite_latency maximum time spent performing a childwrite
+
+@ ctdb.num_recoveries number of recoveries finished
diff --git a/ctdb/utils/pmda/pmda_ctdb.c b/ctdb/utils/pmda/pmda_ctdb.c
index 7b6b710dea3..927fea5805d 100644
--- a/ctdb/utils/pmda/pmda_ctdb.c
+++ b/ctdb/utils/pmda/pmda_ctdb.c
@@ -23,9 +23,10 @@
#include <pcp/impl.h>
#include <pcp/pmda.h>
#include "../../include/includes.h"
-#include "../../lib/events/events.h"
+#include "../../lib/tevent/tevent.h"
#include "../../include/ctdb.h"
#include "../../include/ctdb_private.h"
+#include "../../include/ctdb_protocol.h"
#include "domain.h"
/*
@@ -154,6 +155,9 @@ static pmdaMetric metrictab[] = {
/* max_childwrite_latency */
{ NULL, { PMDA_PMID(25,36), PM_TYPE_DOUBLE, PM_INDOM_NULL, PM_SEM_INSTANT,
PMDA_PMUNITS(0,1,0,0,PM_TIME_SEC,0) }, },
+ /* num_recoveries */
+ { NULL, { PMDA_PMID(26,37), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_INSTANT,
+ PMDA_PMUNITS(0,0,0,0,0,0) }, },
};
static struct event_context *ev;
@@ -231,7 +235,8 @@ pmda_ctdb_daemon_connect(void)
ctdb->daemon.queue = ctdb_queue_setup(ctdb, ctdb, ctdb->daemon.sd,
CTDB_DS_ALIGNMENT,
- pmda_ctdb_q_read_cb, ctdb);
+ pmda_ctdb_q_read_cb, ctdb,
+ "to-ctdbd");
if (ctdb->daemon.queue == NULL) {
fprintf(stderr, "Failed to setup queue\n");
goto err_sd;
@@ -437,19 +442,22 @@ pmda_ctdb_fetch_cb(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
atom->ul = stats->max_hop_count;
break;
case 21:
- atom->d = stats->reclock.ctdbd;
+ atom->d = stats->reclock.ctdbd.max;
break;
case 22:
- atom->d = stats->reclock.recd;
+ atom->d = stats->reclock.recd.max;
break;
case 23:
- atom->d = stats->max_call_latency;
+ atom->d = stats->call_latency.max;
break;
case 24:
- atom->d = stats->max_lockwait_latency;
+ atom->d = stats->lockwait_latency.max;
break;
case 25:
- atom->d = stats->max_childwrite_latency;
+ atom->d = stats->childwrite_latency.max;
+ break;
+ case 26:
+ atom->d = stats->num_recoveries;
break;
default:
return PM_ERR_PMID;
diff --git a/ctdb/utils/pmda/pmns b/ctdb/utils/pmda/pmns
index 000dee53c79..38509defb99 100644
--- a/ctdb/utils/pmda/pmns
+++ b/ctdb/utils/pmda/pmns
@@ -45,6 +45,7 @@ ctdb {
max_call_latency CTDB:23:34
max_lockwait_latency CTDB:24:35
max_childwrite_latency CTDB:25:36
+ num_recoveries CTDB:26:37
}
ctdb.node {