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

23
LINES

< > BotCompany Repo | #1016259 // Test oshi Disk Stores Read Bytes Sanity

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 11569K of libraries. Click here for Pure Java version (6786L/48K).

!7

p-experiment {
  wordWrapConsole();
  
  L<HWDiskStore> l = oshi_diskStores();
  int i = 0;
  for (HWDiskStore disk : l) {
    print();
    print("Testing disk " + (++i) + "/" + l(l));
    print();
    printStruct("Disk specs", mapPlus(callGetters(disk, 'name, 'model, 'serial, 'size, 'reads, 'readBytes, 'writes, 'writeBytes, 'transferTime, 'timeStamp), partitions := l(disk.getPartitions())));
    
    pcall-short {
      long oldReads = disk.getReads();
      long oldReadBytes = disk.getReadBytes();
      assertTrue("update disk stats", disk.updateDiskStats());
      assertTrue(print("new reads", disk.getReads()) >= print("old reads", oldReads));
      assertTrue(print("new read bytes", disk.getReadBytes()) >= print("old read bytes", oldReadBytes));
      print("Sanity test OK");
    }
  }
}

Author comment

Began life as a copy of #1016257

download  show line numbers  debug dex  old transpilations   

Travelled to 14 computer(s): aoiabmzegqzx, bhatertpkbcr, cbybwowwnfue, cfunsshuasjs, gwrvuhgaqvyk, irmadwmeruwu, ishqpsrjomds, lpdgvwnxivlt, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tslmcundralx, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1016259
Snippet name: Test oshi Disk Stores Read Bytes Sanity
Eternal ID of this version: #1016259/6
Text MD5: cebe24212d08ad6eda13d448e236bcac
Transpilation MD5: 2d49350e359104216b5fb9f1b5b17ee1
Author: stefan
Category: javax / os
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2018-06-12 15:24:35
Source code size: 828 bytes / 23 lines
Pitched / IR pitched: No / No
Views / Downloads: 282 / 753
Version history: 5 change(s)
Referenced in: [show references]