diff include/freeDiameter/libfdproto.h @ 1060:13fc3fc9c789

New feature in fd_fifo to get timing statistics
author Sebastien Decugis <sdecugis@freediameter.net>
date Mon, 29 Apr 2013 17:15:34 +0800
parents b3d623f04b6d
children 23989d6c8390
line wrap: on
line diff
--- a/include/freeDiameter/libfdproto.h	Mon Apr 29 12:43:41 2013 +0800
+++ b/include/freeDiameter/libfdproto.h	Mon Apr 29 17:15:34 2013 +0800
@@ -3036,6 +3036,7 @@
  * PARAMETERS:
  *  queue	: The queue from which to retrieve the number of elements.
  *  length	: Upon success, the current number of elements in the queue is stored here.
+ *  max		: the maximum number of elements as specified during creation. Can be NULL.
  *
  * DESCRIPTION: 
  *  Retrieve the number of elements in a queue.
@@ -3044,10 +3045,29 @@
  *  0		: The length of the queue has been written.
  *  EINVAL 	: A parameter is invalid.
  */
-int fd_fifo_length ( struct fifo * queue, int * length );
+int fd_fifo_length ( struct fifo * queue, int * length, int * max);
 int fd_fifo_length_noerr ( struct fifo * queue ); /* no error checking version */
 
 /*
+ * FUNCTION:	fd_fifo_getstats
+ *
+ * PARAMETERS:
+ *  queue	: The queue from which to retrieve the timings information.
+ *  total	: Cumulated time all items spent in this queue, including blocking time (always growing, use deltas for monitoring)
+ *  blocking    : Cumulated time threads trying to post new items were blocked (queue full).
+ *  last        : For the last element retrieved from the queue, how long it take between posting (including blocking) and poping
+ *  
+ * DESCRIPTION: 
+ *  Retrieve the timing information associated with a queue, for monitoring purpose.
+ *
+ * RETURN VALUE:
+ *  0		: The statistics have been updated.
+ *  EINVAL 	: A parameter is invalid.
+ */
+int fd_fifo_getstats( struct fifo * queue, struct timespec * total, struct timespec * blocking, struct timespec * last);
+
+
+/*
  * FUNCTION:	fd_fifo_setthrhd
  *
  * PARAMETERS:
"Welcome to our mercurial repository"