Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[PATCH] pmda: handle new ctdb_statistics format

2 views
Skip to first unread message

David Disseldorp

unread,
May 24, 2013, 10:11:12 AM5/24/13
to
From: David Disseldorp <dd...@samba.org>

The ctdb_statistics structure was recently changed. Update the PMDA to
dereference the new structure member names.

Signed-off-by: David Disseldorp <dd...@samba.org>
---
utils/pmda/pmda_ctdb.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/utils/pmda/pmda_ctdb.c b/utils/pmda/pmda_ctdb.c
index c8983ef..e8033be 100644
--- a/utils/pmda/pmda_ctdb.c
+++ b/utils/pmda/pmda_ctdb.c
@@ -121,10 +121,10 @@ static pmdaMetric metrictab[] = {
/* pending_calls */
{ NULL, { PMDA_PMID(14,25), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_INSTANT,
PMDA_PMUNITS(0,0,0,0,0,0) }, },
- /* lockwait_calls */
+ /* locks.num_calls */
{ NULL, { PMDA_PMID(15,27), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_COUNTER,
PMDA_PMUNITS(0,0,1,0,0,PM_COUNT_ONE) }, },
- /* pending_lockwait_calls */
+ /* locks.pending_calls */
{ NULL, { PMDA_PMID(16,27), PM_TYPE_U32, PM_INDOM_NULL, PM_SEM_INSTANT,
PMDA_PMUNITS(0,0,0,0,0,0) }, },
/* childwrite_calls */
@@ -148,10 +148,10 @@ static pmdaMetric metrictab[] = {
/* max_call_latency */
{ NULL, { PMDA_PMID(23,34), PM_TYPE_DOUBLE, PM_INDOM_NULL, PM_SEM_INSTANT,
PMDA_PMUNITS(0,1,0,0,PM_TIME_SEC,0) }, },
- /* max_lockwait_latency */
+ /* locks.latency.max */
{ NULL, { PMDA_PMID(24,35), PM_TYPE_DOUBLE, PM_INDOM_NULL, PM_SEM_INSTANT,
PMDA_PMUNITS(0,1,0,0,PM_TIME_SEC,0) }, },
- /* max_childwrite_latency */
+ /* childwrite_latency.max */
{ 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 */
@@ -423,10 +423,10 @@ pmda_ctdb_fetch_cb(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
atom->ul = stats->pending_calls;
break;
case 15:
- atom->ul = stats->lockwait_calls;
+ atom->ul = stats->locks.num_calls;
break;
case 16:
- atom->ul = stats->pending_lockwait_calls;
+ atom->ul = stats->locks.num_pending;
break;
case 17:
atom->ul = stats->childwrite_calls;
@@ -450,7 +450,7 @@ pmda_ctdb_fetch_cb(pmdaMetric *mdesc, unsigned int inst, pmAtomValue *atom)
atom->d = stats->call_latency.max;
break;
case 24:
- atom->d = stats->lockwait_latency.max;
+ atom->d = stats->locks.latency.max;
break;
case 25:
atom->d = stats->childwrite_latency.max;
--
1.8.1.4

Andrew Bartlett

unread,
May 24, 2013, 6:06:41 PM5/24/13
to
On Fri, 2013-05-24 at 16:11 +0200, David Disseldorp wrote:
> From: David Disseldorp <dd...@samba.org>
>
> The ctdb_statistics structure was recently changed. Update the PMDA to
> dereference the new structure member names.

Do we need to change our build system to ensure this is always built in
autobuild, in the samba-ctdb build?
Andrew Bartlett http://samba.org/~abartlet/
Authentication Developer, Samba Team http://samba.org

David Disseldorp

unread,
May 26, 2013, 5:23:18 PM5/26/13
to
Hi Andrew,

On Sat, 25 May 2013 08:06:41 +1000
Andrew Bartlett <abar...@samba.org> wrote:

> > The ctdb_statistics structure was recently changed. Update the PMDA to
> > dereference the new structure member names.
>
> Do we need to change our build system to ensure this is always built in
> autobuild, in the samba-ctdb build?

I'm happy maintaining it as-is for the moment, but if others see use
in the monitoring agent, then the Performance Co-Pilot development
package could be added to our autobuild systems.

Cheers, David

Andrew Bartlett

unread,
May 26, 2013, 5:56:03 PM5/26/13
to
OK, I wasn't aware of the additional dependency.

Reviewed-by: Andrew Bartlett <abar...@samba.org>

Michael Adam

unread,
May 26, 2013, 6:05:26 PM5/26/13
to
Hi David,

pushed to ctdb master.

On 2013-05-26 at 23:23 +0200, David Disseldorp wrote:
> Hi Andrew,
>
> On Sat, 25 May 2013 08:06:41 +1000
> Andrew Bartlett <abar...@samba.org> wrote:
>
> > > The ctdb_statistics structure was recently changed. Update the PMDA to
> > > dereference the new structure member names.
> >
> > Do we need to change our build system to ensure this is always built in
> > autobuild, in the samba-ctdb build?

Andrew,

this is a pure ctdb patch.
Samba's samba-ctdb target does not build or test ctdb,
it only builds samba with clustering enabled.

> I'm happy maintaining it as-is for the moment, but if others see use
> in the monitoring agent, then the Performance Co-Pilot development
> package could be added to our autobuild systems.

We can try to ensure it gets built in the ctdb build,
but it has dependencies, so we would need to protect it
with configure checks, and without installing libpcp-pmda3-dev
and some other packages it would not get built.

Once we have ctdb in the samba tree and autobuild system,
we can ensure that it always gets built and can avoid
regressions.

Cheers - Michael

0 new messages