This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PID=$(jps | grep Main | awk '{print $1}') | |
CUR=$(jstat -gc $PID | tail -n 1 | awk '{split($0,a," "); sum=a[3]+a[4]+a[6]+a[8]; print sum/1024}') | |
MAX=$(jstat -gccapacity $PID | tail -n 1 | awk '{split($0,a," "); sum=a[2]+a[8]; print sum/1024}') | |
echo $CUR/$MAX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import socket # Import socket module | |
from threading import Thread | |
def on_new_client(clientsocket, addr): | |
try: | |
while True: | |
msg = clientsocket.recv(1024) | |
if not msg: |
OlderNewer