Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

22
LINES

< > BotCompany Repo | #1024201 // Java + HotSpot Compilation CPU % [Dyn Module]

JavaX source code (Dynamic Module) [tags: use-pretranspiled] - run with: Stefan's OS

Libraryless. Click here for Pure Java version (10137L/72K).

!7

sclass JavaPlusHotSpotCPUPercentage extends DynBigNumber {
  transient O cpuMonitor;
  transient RollingAverage avg = new(5); // =10 seconds
  transient double recentValue;
  
  start {
    setDescription("JAVA + HOTSPOT CPU %");
    setToolTip("Percentage is per core");
    cpuMonitor = runDependent(#1001405);
    ownTimer(doEvery(2.0, r actualUpdate));
  }
  
  void actualUpdate {
    recentValue =
      (double) call(cpuMonitor, 'getInProcessCPU) +
      (double) get(cpuMonitor, 'compilationPercentage);
    avg.add(recentValue);
    setValue(iceil(avg!) + " %");
  }
}

Author comment

Began life as a copy of #1016652

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1024201
Snippet name: Java + HotSpot Compilation CPU % [Dyn Module]
Eternal ID of this version: #1024201/3
Text MD5: 03205f577e6db6307a5da23d08d94e92
Transpilation MD5: bdb0cd47a9708b57c8a4401d848a1853
Author: stefan
Category: javax / modules
Type: JavaX source code (Dynamic Module)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-08-18 11:35:28
Source code size: 602 bytes / 22 lines
Pitched / IR pitched: No / No
Views / Downloads: 188 / 110161
Version history: 2 change(s)
Referenced in: [show references]