func QueueManagerNormalise(attr *StatusAttribute, v int64) float64 {
	return statusNormalise(attr, v)
}
Return a standardised value. If the attribute indicates that something
special has to be done, then do that. Otherwise just make sure it's a non-negative
value of the correct datatype
package mqmetric
import (
	"github.com/ibm-messaging/mq-golang/v5/ibmmq"
	"strings"
	"time"
)
const (
	ATTR_QMGR_NAME                = "name"
	ATTR_QMGR_CONNECTION_COUNT    = "connection_count"
	ATTR_QMGR_CHINIT_STATUS       = "channel_initiator_status"
	ATTR_QMGR_CMD_SERVER_STATUS   = "command_server_status"
	ATTR_QMGR_STATUS              = "status"
	ATTR_QMGR_UPTIME              = "uptime"
	ATTR_QMGR_MAX_CHANNELS        = "max_channels"
	ATTR_QMGR_MAX_ACTIVE_CHANNELS = "max_active_channels"
	ATTR_QMGR_MAX_TCP_CHANNELS    = "max_tcp_channels"
)
func QueueManagerInitAttributes() {
	traceEntry("QueueManagerInitAttributes")
	ci := getConnection(GetConnectionKey())
	os := &ci.objectStatus[OT_Q_MGR]
	st := GetObjectStatus(GetConnectionKey(), OT_Q_MGR)
	if os.init {
		traceExit("QueueManagerInitAttributes", 1)
		return
	}
	st.Attributes = make(map[string]*StatusAttribute)
	attr := ATTR_QMGR_NAME
	st.Attributes[attr] = newPseudoStatusAttribute(attr, "Queue Manager Name")
	if GetPlatform() != ibmmq.MQPL_ZOS {
		attr = ATTR_QMGR_UPTIME
		st.Attributes[attr] = newStatusAttribute(attr, "Up time", -1)
		attr = ATTR_QMGR_CONNECTION_COUNT
		st.Attributes[attr] = newStatusAttribute(attr, "Connection Count", ibmmq.MQIACF_CONNECTION_COUNT)
		attr = ATTR_QMGR_CHINIT_STATUS
		st.Attributes[attr] = newStatusAttribute(attr, "Channel Initiator Status", ibmmq.MQIACF_CHINIT_STATUS)
		attr = ATTR_QMGR_CMD_SERVER_STATUS
		st.Attributes[attr] = newStatusAttribute(attr, "Command Server Status", ibmmq.MQIACF_CMD_SERVER_STATUS)
	} else {
		attr = ATTR_QMGR_MAX_CHANNELS
		st.Attributes[attr] = newStatusAttribute(attr, "Max Channels", -1)
		attr = ATTR_QMGR_MAX_TCP_CHANNELS
		st.Attributes[attr] = newStatusAttribute(attr, "Max TCP Channels", -1)
		attr = ATTR_QMGR_MAX_ACTIVE_CHANNELS
		st.Attributes[attr] = newStatusAttribute(attr, "Max Active Channels", -1)
	}
	attr = ATTR_QMGR_STATUS
	st.Attributes[attr] = newStatusAttribute(attr, "Queue Manager Status", ibmmq.MQIACF_Q_MGR_STATUS)
	os.init = true
	traceExit("QueueManagerInitAttributes", 0)
}
func CollectQueueManagerStatus() error {
	var err error
	traceEntry("CollectQueueManagerStatus")
	st := GetObjectStatus(GetConnectionKey(), OT_Q_MGR)
	QueueManagerInitAttributes()
	for k := range st.Attributes {
		st.Attributes[k].Values = make(map[string]*StatusValue)
	}
	if GetPlatform() == ibmmq.MQPL_ZOS {
		err = collectQueueManagerAttrs()
	} else {
		err = collectQueueManagerStatus(ibmmq.MQOT_Q_MGR)
	}
	traceExitErr("CollectQueueManagerStatus", 0, err)
	return err
}
func collectQueueManagerAttrs() error {
	traceEntry("collectQueueManagerAttrs")
	ci := getConnection(GetConnectionKey())
	st := GetObjectStatus(GetConnectionKey(), OT_Q_MGR)
	selectors := []int32{ibmmq.MQCA_Q_MGR_NAME,
		ibmmq.MQIA_ACTIVE_CHANNELS,
		ibmmq.MQIA_TCP_CHANNELS,
		ibmmq.MQIA_MAX_CHANNELS}
	v, err := ci.si.qMgrObject.Inq(selectors)
	if err == nil {
		maxchls := v[ibmmq.MQIA_MAX_CHANNELS].(int32)
		maxact := v[ibmmq.MQIA_ACTIVE_CHANNELS].(int32)
		maxtcp := v[ibmmq.MQIA_TCP_CHANNELS].(int32)
		key := v[ibmmq.MQCA_Q_MGR_NAME].(string)
		st.Attributes[ATTR_QMGR_MAX_ACTIVE_CHANNELS].Values[key] = newStatusValueInt64(int64(maxact))
		st.Attributes[ATTR_QMGR_MAX_CHANNELS].Values[key] = newStatusValueInt64(int64(maxchls))
		st.Attributes[ATTR_QMGR_MAX_TCP_CHANNELS].Values[key] = newStatusValueInt64(int64(maxtcp))
		st.Attributes[ATTR_QMGR_NAME].Values[key] = newStatusValueString(key)
		st.Attributes[ATTR_QMGR_STATUS].Values[key] = newStatusValueInt64(int64(ibmmq.MQQMSTA_RUNNING))
	}
	traceExitErr("collectQueueManagerAttrs", 0, err)
	return err
}
func collectQueueManagerStatus(instanceType int32) error {
	var err error
	traceEntry("collectQueueManagerStatus")
	ci := getConnection(GetConnectionKey())
	statusClearReplyQ()
	putmqmd, pmo, cfh, buf := statusSetCommandHeaders()
	cfh.Command = ibmmq.MQCMD_INQUIRE_Q_MGR_STATUS
	buf = append(cfh.Bytes(), buf...)
	err = ci.si.cmdQObj.Put(putmqmd, pmo, buf)
	if err != nil {
		traceExitErr("collectQueueManagerStatus", 1, err)
		return err
	}
	for allReceived := false; !allReceived; {
		cfh, buf, allReceived, err = statusGetReply()
		if buf != nil {
			parseQMgrData(instanceType, cfh, buf)
		}
	}
	traceExitErr("collectQueueManagerStatus", 0, err)
	return err
}
func parseQMgrData(instanceType int32, cfh *ibmmq.MQCFH, buf []byte) string {
	var elem *ibmmq.PCFParameter
	traceEntry("parseQMgrData")
	st := GetObjectStatus(GetConnectionKey(), OT_Q_MGR)
	qMgrName := ""
	key := ""
	startTime := ""
	startDate := ""
	parmAvail := true
	bytesRead := 0
	offset := 0
	datalen := len(buf)
	if cfh == nil || cfh.ParameterCount == 0 {
		traceExit("parseQMgrData", 1)
		return ""
	}
	for parmAvail && cfh.CompCode != ibmmq.MQCC_FAILED {
		elem, bytesRead = ibmmq.ReadPCFParameter(buf[offset:])
		offset += bytesRead
		if offset >= datalen {
			parmAvail = false
		}
		switch elem.Parameter {
		case ibmmq.MQCA_Q_MGR_NAME:
			qMgrName = strings.TrimSpace(elem.String[0])
		}
	}
	key = qMgrName
	st.Attributes[ATTR_QMGR_NAME].Values[key] = newStatusValueString(qMgrName)
	parmAvail = true
	offset = 0
	for parmAvail && cfh.CompCode != ibmmq.MQCC_FAILED {
		elem, bytesRead = ibmmq.ReadPCFParameter(buf[offset:])
		offset += bytesRead
		if offset >= datalen {
			parmAvail = false
		}
		if !statusGetIntAttributes(GetObjectStatus(GetConnectionKey(), OT_Q_MGR), elem, key) {
			switch elem.Parameter {
			case ibmmq.MQCACF_Q_MGR_START_TIME:
				startTime = strings.TrimSpace(elem.String[0])
			case ibmmq.MQCACF_Q_MGR_START_DATE:
				startDate = strings.TrimSpace(elem.String[0])
			}
		}
	}
	now := time.Now()
	st.Attributes[ATTR_QMGR_UPTIME].Values[key] = newStatusValueInt64(statusTimeDiff(now, startDate, startTime))
	traceExitF("parseQMgrData", 0, "Key: %s", key)
	return key
}