示例#1
0
/////////////////////////////////////////////////
// Memory-Status
TStr TSysMemStat::GetLoadStr(){
  static TStr MemUsageStr="Mem Load: ";
  TChA ChA;
  ChA+=MemUsageStr;
  ChA+=TUInt64::GetStr(GetLoad());
  ChA+="%";
  return ChA;
}
示例#2
0
TStr TSysMemStat::GetStr(){
  TChA ChA;
  ChA+=TUInt64::GetStr(GetLoad()); ChA+=' ';
  ChA+=TUInt64::GetStr(GetTotalPhys()); ChA+=' ';
  ChA+=TUInt64::GetStr(GetAvailPhys()); ChA+=' ';
  ChA+=TUInt64::GetStr(GetTotalPageFile()); ChA+=' ';
  ChA+=TUInt64::GetStr(GetAvailPageFile()); ChA+=' ';
  ChA+=TUInt64::GetStr(GetTotalVirtual()); ChA+=' ';
  ChA+=TUInt64::GetStr(GetAvailVirtual());
  return ChA;
}
示例#3
0
TStr TSysMemStat::GetInfoStr(){
  TChA ChA;
  ChA+="Memory Load:";
  ChA+=TUInt64::GetMegaStr(GetLoad()); ChA+="\r\n";
  ChA+="Total Physical:";
  ChA+=TUInt64::GetMegaStr(GetTotalPhys()); ChA+="\r\n";
  ChA+="Available Physical:";
  ChA+=TUInt64::GetMegaStr(GetAvailPhys()); ChA+="\r\n";
  ChA+="Total Page File:";
  ChA+=TUInt64::GetMegaStr(GetTotalPageFile()); ChA+="\r\n";
  ChA+="Available Page File:";
  ChA+=TUInt64::GetMegaStr(GetAvailPageFile()); ChA+="\r\n";
  ChA+="Total Virtual:";
  ChA+=TUInt64::GetMegaStr(GetTotalVirtual()); ChA+="\r\n";
  ChA+="Available Virtual:";
  ChA+=TUInt64::GetMegaStr(GetAvailVirtual()); ChA+="\r\n";
  return ChA;
}
示例#4
0
void InsertLoad()
{
  int UserTime, NiceTime, SystemTime, FreeTime, act, constrain;
  GetLoad( 52, &UserTime, &NiceTime, &SystemTime, &FreeTime);

  constrain = (UserTime + NiceTime + SystemTime + FreeTime);
  if(constrain == 53)
    {
      if(FreeTime > 0) FreeTime--;
      else if(SystemTime > 0) SystemTime--;
      else if(NiceTime > 0) NiceTime--;
      else if(UserTime > 0) UserTime--;
    }
  else if(constrain == 51) FreeTime++;

  /* Move the area */
    XCopyArea(dpy, visible.pixmap, visible.pixmap, NormalGC,
        	Shape(7), Shape(6), 51, 52, Shape(6), Shape(6));


    /* User Time */
    act = 58 - UserTime;
    if(UserTime > 0)
      XCopyArea(dpy, wmload.pixmap, visible.pixmap, NormalGC,
		Shape(6), Shape(6), 1, UserTime, Shape(57), Shape(act));

    /* Nice Time */
    act = act - NiceTime;
    if(NiceTime > 0)
      XCopyArea(dpy, wmload.pixmap, visible.pixmap, NormalGC,
		Shape(7), Shape(6), 1, NiceTime, Shape(57), Shape(act));

    /* System Time */
    act = act - SystemTime;
    if(SystemTime > 0)
      XCopyArea(dpy, wmload.pixmap, visible.pixmap, NormalGC,
		Shape(8), Shape(6), 1, SystemTime, Shape(57), Shape(act));

    /* Free Time */
    if(FreeTime > 0)
      XCopyArea(dpy, wmload.pixmap, visible.pixmap, NormalGC,
		Shape(9), Shape(6), 1, FreeTime, Shape(57), Shape(6));
}
FREEZE_NET::PollerBase::~PollerBase(void)
{
	//  Make sure there is no more load on the shutdown.
	assert(GetLoad() == 0);
}