From bd8977c51d4c64befc3288d77547c4f809a178ee Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Thu, 24 Mar 2016 10:24:45 -0400 Subject: [PATCH] more stats --- src/ioc/db/dbCaTest.c | 3 ++- src/ioc/db/dbLink.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ioc/db/dbCaTest.c b/src/ioc/db/dbCaTest.c index 427137e88..b236ed760 100644 --- a/src/ioc/db/dbCaTest.c +++ b/src/ioc/db/dbCaTest.c @@ -65,6 +65,7 @@ void dbCaReportLink(const struct link *plink, dbLinkReportInfo *pinfo) pinfo->connected = ca_field_type(pca->chid) != TYPENOTCONN; pinfo->nWriteFail = pca->nNoWrite; + pinfo->nDisconnect = pca->nDisconnect; if (pinfo->connected) { pinfo->readable = ca_read_access(pca->chid); @@ -161,7 +162,7 @@ long dbcar(char *precordname, int level) linfo.detailLevel = level-2; dbReportLink(plink, &linfo); nconnected += linfo.connected; - nDisconnect += !linfo.connected; + nDisconnect += linfo.nDisconnect; noReadAccess += !linfo.readable; noWriteAccess += !linfo.writable; } diff --git a/src/ioc/db/dbLink.h b/src/ioc/db/dbLink.h index c24f89dc5..5315a7973 100644 --- a/src/ioc/db/dbLink.h +++ b/src/ioc/db/dbLink.h @@ -49,6 +49,7 @@ typedef struct { unsigned readable:1; /* would a dbGetLink() succeed at this moment */ unsigned writable:1; /* would a dbPutLink() succeed at this moment */ /* callee fills in statistics */ + unsigned nDisconnect; /* number of times this link has entered a not connected state */ unsigned nEvents; /* number of times new data has been received from the underlying data source */ unsigned nWriteFail; /* number of times dbPutLink() has failed for this link */ } dbLinkReportInfo;