Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For cpu and net https://github.com/oshi/oshi is used, for mem the java runtime

  • CPU_MAX: The max value of the CPU
  • CPU_FREE:
  • NET_INPUT_RATE:
  • NET_MAX:
  • NET_OUTPUT_RATE:
  • MEM_FREE: Runtime.getRuntime().freeMemory()
  • MEM_TOTAL: Runtime.getRuntime().totalMemory()
Code Block
#PARSER PQL
#RUNQUERY
sysload := RECEIVE({
            source='Systemload',
            transport='Timer',          
		    protocol='systemload',           
            datahandler='Tuple',            
            options=[['period', '2000']],             
			schema=[['ts', 'Timestamp'],
            	['cpu_max','double'],
	            ['cpu_free','double'],
	            ['NET_INPUT_RATE','double'],         
	            ['NET_MAX','double'],             
	            ['NET_OUTPUT_RATE','double'],           
	            ['MEM_FREE','double'],	
	            ['MEM_TOTAL','double']]
            }
          )

Schema is optional. If not given all values as above are created in the output.

It is possible receive less load data by removing attributes from the schema, e.g., if NET_MAX is removed not network max load is measured and printed.

The options field here set the period for the Timer transport handler, so every 2 seconds a new measurement is created.