I just finished writing a small script that lets me add the metric. I took the System Monitor help doc advice and instead of setting up a collector for this I'm grabbing the value with a python script and putting it into a table in a database which is queried like anything else from a database in SM. I made a table that isnt part of the geodatabase in our production environment and then execute the tasklist for ArcSOC and javaw on the two servers in our publication environment. That is returned as text so I broke it down to an integer to stick in the database. The table in the database is called SERVERMONITORMETRICS and has two columns, COUNTER and VALUE. pypyodbc updates the corresponding rows in the database and SM grabs those values. Windows Task Scheduler has the script run every 5 minutes. Might be an easier way to do it but this works for me.
import pypyodbc, subprocess
PUBAGSMEMORY = sum([int(i.split(' ')[-2].replace(',','')) for i in subprocess.check_output('TASKLIST /s xx.xx.xx.xx /FO LIST /FI "Imagename eq ArcSOC.exe"').split('\n') if 'Mem Usage:' in i]) + sum([int(i.split(' ')[-2].replace(',','')) for i in subprocess.check_output('TASKLIST /s xx.xx.xx.xx /FO LIST /FI "Imagename eq javaw.exe"').split('\n') if 'Mem Usage:' in i])
FOAGSMEMORY = sum([int(i.split(' ')[-2].replace(',','')) for i in subprocess.check_output('TASKLIST /s xx.xx.xx.xx /FO LIST /FI "Imagename eq ArcSOC.exe"').split('\n') if 'Mem Usage:' in i]) + sum([int(i.split(' ')[-2].replace(',','')) for i in subprocess.check_output('TASKLIST /s xx.xx.xx.xx /FO LIST /FI "Imagename eq javaw.exe"').split('\n') if 'Mem Usage:' in i])
db = pypyodbc.connect('Driver={SQL Server}; Server=bay-arcgis-pro; Database=sde; Uid=*****; Pwd=*****;')
cursor = db.cursor()
query = '''
UPDATE sde.SERVERMONITORMETRICS
SET VALUE = %s
WHERE COUNTER = 'PUB AGS MEMORY'
UPDATE sde.SERVERMONITORMETRICS
SET VALUE = %s
WHERE COUNTER = 'FO AGS MEMORY'
'''%(PUBAGSMEMORY, FOAGSMEMORY)
cursor.execute(query)
cursor.commit()
del cursor, db