示例#1
0
        public static Prtg ReadQueue(dynamic data)
        {
            var result = new Prtg();


            result.Add(new PrtgResult
            {
                Channel    = "Total",
                CustomUnit = "msgs",
                Value      = data.messages
            });

            result.Add(new PrtgResult
            {
                Channel    = "Unacknowledged",
                CustomUnit = "msgs",
                Value      = data.messages_unacknowledged
            });

            result.Add(new PrtgResult
            {
                Channel    = "Rate",
                CustomUnit = "msg/sec",
                Value      = data.messages_details.rate
            });

            result.Add(new PrtgResult
            {
                Channel    = "Publish Rate",
                CustomUnit = "msg/sec",
                Value      = ReadDec(() => data.message_stats.publish_details.rate)
            });

            result.Add(new PrtgResult
            {
                Channel    = "Consumers",
                ShowChart  = 0,
                CustomUnit = "#",
                Value      = data.consumers
            });

            result.Add(new PrtgResult
            {
                Channel   = "Memory",
                ShowChart = 0,
                ShowTable = 0,
                Unit      = ChannelUnit.BytesMemory,
                Value     = data.memory
            });

            result.Add(new PrtgResult
            {
                Channel    = "Acknowledge",
                CustomUnit = "msg/sec",
                Value      = ReadDec(() => data.message_stats.ack_details.rate)
            });

            return(result);
        }
示例#2
0
        public static Prtg ReadExchange(dynamic data)
        {
            var result = new Prtg();

            result.Add(new PrtgResult
            {
                Channel    = "Out",
                CustomUnit = "msg/sec",
                Value      = ReadDec(() => data.message_stats.publish_out_details.rate)
            });

            result.Add(new PrtgResult
            {
                Channel    = "In",
                CustomUnit = "msg/sec",
                Value      = ReadDec(() => data.message_stats.publish_in_details.rate)
            });

            result.Add(new PrtgResult
            {
                Channel    = "Destinations",
                CustomUnit = "#",
                ShowChart  = 0,
                Value      = ReadDec(() => data.outgoing.Count)
            });

            result.Add(new PrtgResult
            {
                Channel    = "Total in",
                ShowChart  = 0,
                ShowTable  = 0,
                CustomUnit = "msgs",
                Value      = ReadDec(() => data.message_stats.publish_in)
            });

            result.Add(new PrtgResult
            {
                Channel    = "Total out",
                ShowChart  = 0,
                ShowTable  = 0,
                CustomUnit = "msgs",
                Value      = ReadDec(() => data.message_stats.publish_out)
            });

            return(result);
        }