Skip to content
30 changes: 30 additions & 0 deletions iocAdmin/Db/ioc.template
Original file line number Diff line number Diff line change
Expand Up @@ -160,10 +160,18 @@ record(ai, "$(IOCNAME):IOC_CPU_LOAD") {
field(HIGH, "70")
field(HHSV, "MAJOR")
field(HSV, "MINOR")
field(FLNK, "$(IOCNAME):IOC_SINGLE_CPU_LOAD")

info(autosaveFields_pass0, "HOPR LOPR HIHI HIGH LOW LOLO HHSV HSV LSV LLSV")
}

record(calc, "$(IOCNAME):IOC_SINGLE_CPU_LOAD") {
field(INPA, "$(IOCNAME):IOC_CPU_LOAD")
field(INPB, "$(IOCNAME):CPU_CNT")
field(CALC, "A*B")
field(PREC, "1")
}

record(ai, "$(IOCNAME):CPU_CNT") {
field(DESC, "Number of CPUs")
field(DTYP, "IOC stats")
Expand All @@ -182,12 +190,20 @@ record(ai, "$(IOCNAME):SUSP_TASK_CNT") {
info(autosaveFields_pass0, "HOPR LOPR HIHI HIGH LOW LOLO HHSV HSV LSV LLSV")
}


record(ai, "$(IOCNAME):MEM_USED") {
field(DESC, "Allocated Memory")
field(SCAN, "I/O Intr")
field(DTYP, "IOC stats")
field(INP, "@allocated_bytes")
field(EGU, "byte")
field(FLNK, "$(IOCNAME):MEM_USED_GB")
}

record(calc, "$(IOCNAME):MEM_USED_GB") {
field(INPA, "$(IOCNAME):MEM_USED")
field(CALC, "A/1e9")
field(PREC, "3")
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we have EGU=byte on the MEM_USED record, maybe add the equivalent here?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes to EGU. imo it should be GB, and the scaling factor should be A/B where B is 1073741824 ($2^{30}$).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Careful. According to standards the 1024^3 units are called GiB while GB uses 1000^3.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to standards

I guess this is SI. So I have had GB and GiB backwards all these years...

@ralphlange ralphlange Jun 2, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought the lowercase "i" was a typo.
But I will never call it "gibibyte" in public. I swear.


record(ai, "$(IOCNAME):MEM_FREE") {
Expand All @@ -198,16 +214,30 @@ record(ai, "$(IOCNAME):MEM_FREE") {
field(EGU, "byte")
field(LLSV, "MAJOR")
field(LSV, "MINOR")
field(FLNK, "$(IOCNAME):MEM_FREE_GB")

info(autosaveFields_pass0, "HOPR LOPR LOW LOLO LSV LLSV")
}

record(calc, "$(IOCNAME):MEM_FREE_GB") {
field(INPA, "$(IOCNAME):MEM_FREE")
field(CALC, "A/1e9")
field(PREC, "3")
}

record(ai, "$(IOCNAME):MEM_MAX") {
field(DESC, "Maximum Memory")
field(SCAN, "I/O Intr")
field(DTYP, "IOC stats")
field(INP, "@total_bytes")
field(EGU, "byte")
field(FLNK, "$(IOCNAME):MEM_MAX_GB")
}

record(calc, "$(IOCNAME):MEM_MAX_GB") {
field(INPA, "$(IOCNAME):MEM_MAX")
field(CALC, "A/1e9")
field(PREC, "3")
}

record(ao, "$(IOCNAME):CA_UPD_TIME") {
Expand Down