小编nur*_*cuk的帖子

如何读取“jstat -gcutil <PID>”的输出?

我正在运行 JBoss 服务器,以下输出属于 -gcutil 工具。我很好奇这个缩写是什么。

/usr/java/jdk1.7.0_25/bin/jstat  -gcutil 47929 
  S0     S1     E      O      P     YGC     YGCT    FGC    FGCT     GCT   
  0.00   0.00  68.46 100.00  57.08  44539 5829.704 303497 241552.104 247381.808
Run Code Online (Sandbox Code Playgroud)

谢谢

java memory garbage-collection heap-memory jstat

4
推荐指数
1
解决办法
8364
查看次数

PyQt 进度条用线程更新

我一直在编写一个在服务器上运行远程脚本的程序。因此,我需要用一个栏来显示进度,但不知何故,当我运行代码时,GUI 开始冻结。我已经使用了 QThread 和 SIGNAL 但不幸的是无法成功。

下面是我的代码;

class dumpThread(QThread):

    def __init__(self):
        QThread.__init__(self)

    def __del__(self):
        self.wait()

    def sendEstablismentCommands(self, connection):

        # Commands are sending sequently with proper delay-timers #

        connection.sendShell("telnet localhost 21000")
        time.sleep(0.5)
        connection.sendShell("admin")
        time.sleep(0.5)
        connection.sendShell("admin")
        time.sleep(0.5)
        connection.sendShell("cd imdb")
        time.sleep(0.5)
        connection.sendShell("dump subscriber")

        command = input('$ ')

    def run(self):
        # your logic here              
        # self.emit(QtCore.SIGNAL('THREAD_VALUE'), maxVal)
        self.sendEstablismentCommands(connection)    

class progressThread(QThread):

    def __init__(self):
        QThread.__init__(self)

    def __del__(self):
        self.wait()


    def run(self):
        # your logic here
        while 1:      
            maxVal = 100
            self.emit(SIGNAL('PROGRESS'), maxVal)

class Main(QtGui.QMainWindow):
    def __init__(self):
        QtGui.QMainWindow.__init__(self) …
Run Code Online (Sandbox Code Playgroud)

python user-interface pyqt signals-slots qthread

3
推荐指数
1
解决办法
2万
查看次数