some comments

This commit is contained in:
Zhen Tang 2013-07-08 20:33:31 +08:00
parent 656d7076e3
commit 5f60afd253
3 changed files with 119 additions and 58 deletions

View File

@ -1,27 +1,60 @@
#include "stdafx.h"
#include "Monitor.h"
#include "Common.h"
#include "System.h"
list<wstring> System::GetCounterList()
{
return Common::GetCounterList(L"System");
}
// File Read Operations/sec
// File Write Operations/sec
// File Control Operations/sec
// File Read Bytes/sec
// File Write Bytes/sec
// File Control Bytes/sec
// Context Switches/sec
// System Calls/sec
// File Data Operations/sec
// System Up Time
// Processor Queue Length
// Processes
// Threads
// Alignment Fixups/sec
// Exception Dispatches/sec
// Floating Emulations/sec
// % Registry Quota In Use
#include "stdafx.h"
#include "Monitor.h"
#include "Common.h"
#include "System.h"
list<wstring> System::GetCounterList()
{
return Common::GetCounterList(L"System");
}
// File Read Operations/sec
// File Write Operations/sec
// File Control Operations/sec
// File Read Bytes/sec
// File Write Bytes/sec
// File Control Bytes/sec
// Context Switches/sec
// System Calls/sec
// File Data Operations/sec
// System Up Time
// Processor Queue Length
// Processes
// Threads
// Alignment Fixups/sec
// Exception Dispatches/sec
// Floating Emulations/sec
// % Registry Quota In Use

View File

@ -50,25 +50,25 @@ public class Main {
}
public static void main(String[] args) {
// LogicalDiskMonitor logicalDiskMonitor = new LogicalDiskMonitor();
// String[] logicalDiskInstances = logicalDiskMonitor.getInstances();
// for (String elem : logicalDiskInstances) {
// System.out.println(elem);
// }
// String[] logicalDiskCounter = logicalDiskMonitor.getCounterList();
// for (String elem : logicalDiskCounter) {
// System.out.println(elem);
// }
// System.out.println(logicalDiskMonitor.getFreeMegabytes("_Total"));
//
// MemoryMonitor memoryMonitor = new MemoryMonitor();
// String[] memoryCounter = memoryMonitor.getCounterList();
// for (String elem : memoryCounter) {
// System.out.println(elem);
// }
// System.out.println(memoryMonitor.getAvailableBytes());
// System.out.println(memoryMonitor.getAvailableKiloBytes());
// System.out.println(memoryMonitor.getAvailableMegaBytes());
LogicalDiskMonitor logicalDiskMonitor = new LogicalDiskMonitor();
String[] logicalDiskInstances = logicalDiskMonitor.getInstances();
for (String elem : logicalDiskInstances) {
System.out.println(elem);
}
String[] logicalDiskCounter = logicalDiskMonitor.getCounterList();
for (String elem : logicalDiskCounter) {
System.out.println(elem);
}
System.out.println(logicalDiskMonitor.getFreeMegabytes("_Total"));
MemoryMonitor memoryMonitor = new MemoryMonitor();
String[] memoryCounter = memoryMonitor.getCounterList();
for (String elem : memoryCounter) {
System.out.println(elem);
}
System.out.println(memoryMonitor.getAvailableBytes());
System.out.println(memoryMonitor.getAvailableKiloBytes());
System.out.println(memoryMonitor.getAvailableMegaBytes());
NetworkInterfaceMonitor networkInterfaceMonitor = new NetworkInterfaceMonitor();
String[] networkInterfaceInstances = networkInterfaceMonitor
@ -79,14 +79,14 @@ public class Main {
+ networkInterfaceMonitor.getCurrentBandwidth(elem));
}
// String[] networkInterfaceCounter = networkInterfaceMonitor
// .getCounterList();
// for (String elem : networkInterfaceCounter) {
// System.out.println(elem);
// }
String[] networkInterfaceCounter = networkInterfaceMonitor
.getCounterList();
for (String elem : networkInterfaceCounter) {
System.out.println(elem);
}
// MonitorServer monitorServer = new MonitorServer(5555);
// monitorServer.start();
MonitorServer monitorServer = new MonitorServer(5555);
monitorServer.start();
}
}

View File

@ -1,5 +1,33 @@
package org.bench4q.monitor.performance.linux;
public class CpuInfoMonitor {
// /proc/cpuinfo
}
package org.bench4q.monitor.performance.linux;
public class CpuInfoMonitor {
// /proc/cpuinfo
// processor : 0
// vendor_id : GenuineIntel
// cpu family : 6
// model : 44
// model name : Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
// stepping : 2
// microcode : 0xc
// cpu MHz : 2394.062
// cache size : 12288 KB
// physical id : 0
// siblings : 1
// core id : 0
// cpu cores : 1
// apicid : 0
// initial apicid : 3
// fpu : yes
// fpu_exception : yes
// cpuid level : 11
// wp : yes
// flags : fpu de tsc msr pae cx8 sep cmov pat clflush mmx fxsr sse sse2 ss
// ht syscall nx lm constant_tsc up rep_good nopl pni pclmulqdq ssse3 cx16
// sse4_1 sse4_2 popcnt aes hypervisor lahf_lm ida arat epb dtherm
// bogomips : 4788.12
// clflush size : 64
// cache_alignment : 64
// address sizes : 40 bits physical, 48 bits virtual
// power management:
}