Percentege of memory used

Hello,

I am trying to figure out the right query to display the percentage of memory used of a cisco device. I pull via SNMP the memory free and memory used. What I done so far is:

SELECT last(“cempMemPoolHCUsed”) / 12613160960*100 FROM “snmp” WHERE (“hostname” = ‘vfw3-lon1.netops.tmcs’) AND timeFilter GROUP BY time(__interval) fill(null)

Where 12613160960 is the total device memory gathered from show command:

Used memory: 103315392 bytes ( 1%)


Total memory: 12613160960 bytes (100%)

Most used memory: 1321899472 bytes (10%)

However, this query change the value returned in relation to the time range used in grafana (i.e. last 5 minutes is 0.8 last 6 hours is 28) What I was expecting is to see the percentage (1%) no matter which time range used

Suggestions?