Garbage calculation script in linux server

Hi guys,
Can someone please help with this requirement:

I want to calculate the garbage calculation on a server by using shell scripting.
I don't know much about this garbage calculation. Can someone help me with this.

I need to add garbage calculation metrics in my bash shell scripting on daily basis.
Actually, I'm monitoring the server with metrics like CPU percentage, memory usage, swap memory, and all other metrics.

In that script, I want to add a garbage calculation metric.

Any help is appreciated.

Regards

Hi @ag1018,

what is your definition of garbage?
You wrote:

How do you do that exactly?

You could also use e.g. http://munin-monitoring.org. To display the data, you should use a web service, such as nginx, apache oder lighttpd, cause munin creates html files by default, including RRDtool - About RRDtool time series data.

2 Likes

Hey @ag1018

You mean Java (JVM) garbage collection on linux ?

Or did you mean something more generic in "C", like this:

https://www.linuxjournal.com/article/6679

1 Like
Summary

It reminded me:

#define fo(upto) for(int i = 0; i < (int)upto; ++i)

int main() {
        fo(2)
          fo(2)
            fo(3)
              printf("%d\n", i);
}

Sorry for the offtopic.