Exemplo n.º 1
0
        /**
         * <summary>Gets statistics for an entire server</summary>
         *
         * <param name="stats"> Receives the statistics information.</param>
         * <returns> Safmq.EC_NOERROR on success <br/>
         * 	Safmq.EC_NETWORKERROR<br/>
         *  Safmq.EC_NOTOPEN </returns>
         */
        public ErrorCode GetServerStatistics(out QueueStatistics stats)
        {
            QUEUE_STATS_RESPONSE response = new QUEUE_STATS_RESPONSE();
            response.stats = stats = new QueueStatistics();
            try {
                output.Write(Safmq.CMD_SERVER_STATS);
                output.Flush();
                response.Read(input);
            } catch (IOException) {
                response.errorcode = ErrorCode.EC_NETWORKERROR;
            }

            return response.errorcode;
        }
Exemplo n.º 2
0
        /**
         * <summary>Gets statistics about an open queue.  Places statistic information into
         * the parameter <c>stats</c>.</summary>
         *
         * <param name="qhandle"> Handle to an open queue</param>
         * <param name="includeStorageBytes"> Causes server to calculate the number of bytes on disk</param>
         * <param name="includeMessageBytes"> Causes the server to calculate the number of bytes in queue,
         *		may be less than bytes on disk</param>
         * <param name="stats"> Receives the statistics information.</param>
         * <returns> Safmq.EC_NOERROR on success <br/>
         * 	Safmq.EC_NETWORKERROR<br/>
         *  Safmq.EC_NOTOPEN </returns>
         */
        public ErrorCode GetQueueStatistics(QueueHandle qhandle, bool includeStorageBytes, bool includeMessageBytes, out QueueStatistics stats)
        {
            QUEUE_STATS_PARAMS parms = new QUEUE_STATS_PARAMS(qhandle, includeStorageBytes, includeMessageBytes);
            QUEUE_STATS_RESPONSE response = new QUEUE_STATS_RESPONSE();
            response.stats = stats = new QueueStatistics();
            try {
                output.Write(Safmq.CMD_QUEUE_STATS);
                parms.Write(output);
                output.Flush();
                response.Read(input);
            } catch (IOException ) {
                response.errorcode = ErrorCode.EC_NETWORKERROR;
            }

            return response.errorcode;
        }