Add mibs for hastd(1) queue stats.

MFC after:	1 week
This commit is contained in:
Mikolaj Golub 2013-12-29 19:02:33 +00:00
parent 01f6c1ea07
commit bcfa7a8677
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=260049
3 changed files with 88 additions and 1 deletions

View File

@ -60,6 +60,11 @@ begemotHast MODULE-IDENTITY
REVISION "201307010000Z"
DESCRIPTION
"Added hastResourceWorkerPid."
REVISION "201312290000Z"
DESCRIPTION
"Added hastResourceLocalQueue, hastResourceSendQueue,
hastResourceRecvQueue, hastResourceDoneQueue,
hastResourceIdleQueue."
::= { begemot 220 }
begemotHastObjects OBJECT IDENTIFIER ::= { begemotHast 1 }
@ -120,7 +125,12 @@ HastResourceEntry ::= SEQUENCE {
hastResourceWriteErrors Counter64,
hastResourceDeleteErrors Counter64,
hastResourceFlushErrors Counter64,
hastResourceWorkerPid INTEGER
hastResourceWorkerPid INTEGER,
hastResourceLocalQueue UNSIGNED32,
hastResourceSendQueue UNSIGNED32,
hastResourceRecvQueue UNSIGNED32,
hastResourceDoneQueue UNSIGNED32,
hastResourceIdleQueue UNSIGNED32
}
hastResourceIndex OBJECT-TYPE
@ -307,4 +317,46 @@ hastResourceWorkerPid OBJECT-TYPE
"Worker process ID."
::= { hastResourceEntry 22 }
hastResourceLocalQueue OBJECT-TYPE
SYNTAX UNSIGNED32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of outstanding I/O requests to the local component."
::= { hastResourceEntry 23 }
hastResourceSendQueue OBJECT-TYPE
SYNTAX UNSIGNED32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of outstanding I/O requests to send to the remote
component."
::= { hastResourceEntry 24 }
hastResourceRecvQueue OBJECT-TYPE
SYNTAX UNSIGNED32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of outstanding I/O requests waiting for response
from the remote component."
::= { hastResourceEntry 25 }
hastResourceDoneQueue OBJECT-TYPE
SYNTAX UNSIGNED32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of processed I/O requests to return to the kernel."
::= { hastResourceEntry 26 }
hastResourceIdleQueue OBJECT-TYPE
SYNTAX UNSIGNED32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Number of request objects in the free bucket."
::= { hastResourceEntry 27 }
END

View File

@ -79,6 +79,11 @@ struct hast_snmp_resource {
uint64_t delete_errors;
uint64_t flush_errors;
pid_t workerpid;
uint32_t local_queue;
uint32_t send_queue;
uint32_t recv_queue;
uint32_t done_queue;
uint32_t idle_queue;
};
static TAILQ_HEAD(, hast_snmp_resource) resources =
@ -345,6 +350,16 @@ update_resources(void)
res->flush_errors =
nv_get_uint64(nvout, "stat_flush_error%u", i);
res->workerpid = nv_get_int32(nvout, "workerpid%u", i);
res->local_queue =
nv_get_uint64(nvout, "local_queue_size%u", i);
res->send_queue =
nv_get_uint64(nvout, "send_queue_size%u", i);
res->recv_queue =
nv_get_uint64(nvout, "recv_queue_size%u", i);
res->done_queue =
nv_get_uint64(nvout, "done_queue_size%u", i);
res->idle_queue =
nv_get_uint64(nvout, "idle_queue_size%u", i);
TAILQ_INSERT_TAIL(&resources, res, link);
}
nv_free(nvout);
@ -503,6 +518,21 @@ op_hastResourceTable(struct snmp_context *context __unused,
case LEAF_hastResourceWorkerPid:
value->v.integer = res->workerpid;
break;
case LEAF_hastResourceLocalQueue:
value->v.uint32 = res->local_queue;
break;
case LEAF_hastResourceSendQueue:
value->v.uint32 = res->send_queue;
break;
case LEAF_hastResourceRecvQueue:
value->v.uint32 = res->recv_queue;
break;
case LEAF_hastResourceDoneQueue:
value->v.uint32 = res->done_queue;
break;
case LEAF_hastResourceIdleQueue:
value->v.uint32 = res->idle_queue;
break;
default:
ret = SNMP_ERR_RES_UNAVAIL;
break;

View File

@ -60,6 +60,11 @@
(20 hastResourceDeleteErrors COUNTER64 GET)
(21 hastResourceFlushErrors COUNTER64 GET)
(22 hastResourceWorkerPid INTEGER GET)
(23 hastResourceLocalQueue UNSIGNED32 GET)
(24 hastResourceSendQueue UNSIGNED32 GET)
(25 hastResourceRecvQueue UNSIGNED32 GET)
(26 hastResourceDoneQueue UNSIGNED32 GET)
(27 hastResourceIdleQueue UNSIGNED32 GET)
)
)
)