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).

1  
srecord noeq G22SystemInfoPanel(G22Utils g22utils) is Swingable {
2  
  cachedVisualize {
3  
    var gazelleJar = g22utils.gazelleJar();
4  
    File conceptsFile = g22utils.concepts().conceptsFile();
5  
    var projectLibs = g22utils.projectActions().projectLibs();
6  
    var selfTests = g22utils.projectActions().selfTests();
7  
    
8  
    // Sadly, even jScrollVertical causes a bug in formLayouter1 that
9  
    // makes the form grow horizontally without bounds,
10  
    // so no scrolling for now
11  
    
12  
    ret jscrollVertical(makeForm3( 
13  
      "Java Version", jlabel(javaVersion()),
14  
      "Gazelle Jar", JFilePathLabel(gazelleJar).visualize(),
15  
      "Gazelle Jar Size", str_toMB_oneDigit(fileSize(gazelleJar)),
16  
      "Memory use (objects)", jline(
17  
        jLabelShortCalcedEvery(1.0, -> str_toMB(usedMemory())),
18  
        jThreadedButton("Collect garbage", l0 gc),
19  
      ),
20  
      "Max heap", jLabelShortCalcedEvery(1.0, -> str_toMB(maxMemory())),
21  
      "Threads", jReloadEvery(1.0, -> jLabel(n2(threadCount()))),
22  
      "Java VM arguments", joinWithSpace(vmArguments()),
23  
      "Using Custom Classloader", yesNoShort(usingStarter(mc())),
24  
      "Compilation Date", jlabel(g22utils.compilationDate()),
25  
      "Project Libraries", joinWithCommaOr(projectLibs, "-"),
26  
      "Project Database" := JFilePathLabel(conceptsFile).visualize(),
27  
      "Project Database Size" := str_toKB(fileSize(conceptsFile)),
28  
      "Self-Tests" := jlabel(selfTests == null ? "Not run" : selfTests.status()),
29  
      "Gazelle Count" := toolTip("How many Gazelles are running in the world",
30  
        jLiveValueLabel((LiveValue) dm_callOSOpt lvComputerCount())),
31  
    ));
32  
  }
33  
}

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: 66 / 119
Version history: 5 change(s)
Referenced in: [show references]