How is available memory calculated?

Greetings everyone,

I am using telegraf to collect certain metrics so that I can apply the “available memory” equation as described here:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=34e431b0ae398fc54ea69ff85ec700722c9da773

However, when I compare the graphs between the formula in the aforementioned link (blue line) against the standard “available memory” field of telegraf (red line), I see differences. See below:

This raises the question, how does telegraf calculate available memory? What is the applied formula?

Thanks!