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

33
LINES

< > BotCompany Repo | #1036373 // G22SystemInfoPanel

JavaX fragment (include) [tags: use-pretranspiled]

Uses 2164K of libraries. Click here for Pure Java version (66631L/354K).

srecord noeq G22SystemInfoPanel(G22Utils g22utils) is Swingable {
  cachedVisualize {
    var gazelleJar = g22utils.gazelleJar();
    File conceptsFile = g22utils.concepts().conceptsFile();
    var projectLibs = g22utils.projectActions().projectLibs();
    var selfTests = g22utils.projectActions().selfTests();
    
    // Sadly, even jScrollVertical causes a bug in formLayouter1 that
    // makes the form grow horizontally without bounds,
    // so no scrolling for now
    
    ret jscrollVertical(makeForm3( 
      "Java Version", jlabel(javaVersion()),
      "Gazelle Jar", JFilePathLabel(gazelleJar).visualize(),
      "Gazelle Jar Size", str_toMB_oneDigit(fileSize(gazelleJar)),
      "Memory use (objects)", jline(
        jLabelShortCalcedEvery(1.0, -> str_toMB(usedMemory())),
        jThreadedButton("Collect garbage", l0 gc),
      ),
      "Max heap", jLabelShortCalcedEvery(1.0, -> str_toMB(maxMemory())),
      "Threads", jReloadEvery(1.0, -> jLabel(n2(threadCount()))),
      "Java VM arguments", joinWithSpace(vmArguments()),
      "Using Custom Classloader", yesNoShort(usingStarter(mc())),
      "Compilation Date", jlabel(g22utils.compilationDate()),
      "Project Libraries", joinWithCommaOr(projectLibs, "-"),
      "Project Database" := JFilePathLabel(conceptsFile).visualize(),
      "Project Database Size" := str_toKB(fileSize(conceptsFile)),
      "Self-Tests" := jlabel(selfTests == null ? "Not run" : selfTests.status()),
      "Gazelle Count" := toolTip("How many Gazelles are running in the world",
        jLiveValueLabel((LiveValue) dm_callOSOpt lvComputerCount())),
    ));
  }
}

download  show line numbers  debug dex  old transpilations   

Travelled to 2 computer(s): mowyntqkapby, mqqgnosmbjvj

No comments. add comment

Snippet ID: #1036373
Snippet name: G22SystemInfoPanel
Eternal ID of this version: #1036373/6
Text MD5: dff786b68ba816d8c29b27e782607f53
Transpilation MD5: 6e7921f862bf3f9f59b37e1ad951ae37
Author: stefan
Category: javax
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2022-11-28 20:22:33
Source code size: 1648 bytes / 33 lines
Pitched / IR pitched: No / No
Views / Downloads: 126 / 203
Version history: 5 change(s)
Referenced in: [show references]