VirtualBox

Ignore:
Timestamp:
Mar 30, 2010 1:01:36 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
59493
Message:

Removed guest statistics interface; to be merged with metrics.

Location:
trunk/src/VBox/Frontends/VBoxManage
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManage.h

    r27703 r27822  
    122122    VMINFO_NONE             = 0,
    123123    VMINFO_STANDARD         = 1,    /**< standard details */
    124     VMINFO_STATISTICS       = 2,    /**< guest statistics */
    125     VMINFO_FULL             = 3,    /**< both */
    126     VMINFO_MACHINEREADABLE  = 4,    /**< both, and make it machine readable */
    127     VMINFO_COMPACT          = 5
     124    VMINFO_FULL             = 2,    /**< both */
     125    VMINFO_MACHINEREADABLE  = 3,    /**< both, and make it machine readable */
     126    VMINFO_COMPACT          = 4
    128127} VMINFO_DETAILS;
    129128
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageControlVM.cpp

    r27581 r27822  
    791791                CHECK_ERROR(guest, COMSETTER(MemoryBalloonSize)(uVal));
    792792        }
    793         else if (!strcmp(a->argv[1], "gueststatisticsinterval"))
    794         {
    795             if (a->argc != 3)
    796             {
    797                 errorSyntax(USAGE_CONTROLVM, "Incorrect number of parameters");
    798                 rc = E_FAIL;
    799                 break;
    800             }
    801             uint32_t uVal;
    802             int vrc;
    803             vrc = RTStrToUInt32Ex(a->argv[2], NULL, 0, &uVal);
    804             if (vrc != VINF_SUCCESS)
    805             {
    806                 errorArgument("Error parsing guest statistics interval '%s'", a->argv[2]);
    807                 rc = E_FAIL;
    808                 break;
    809             }
    810 
    811             /* guest is running; update IGuest */
    812             ComPtr <IGuest> guest;
    813 
    814             rc = console->COMGETTER(Guest)(guest.asOutParam());
    815             if (SUCCEEDED(rc))
    816                 CHECK_ERROR(guest, COMSETTER(StatisticsUpdateInterval)(uVal));
    817         }
    818         /* Undocumented show guest statistics testcase. */
    819         else if (!strcmp(a->argv[1], "showgueststats"))
    820         {
    821             /* guest is running; update IGuest */
    822             ComPtr <IGuest> guest;
    823 
    824             rc = console->COMGETTER(Guest)(guest.asOutParam());
    825             if (SUCCEEDED(rc))
    826             {
    827                 ULONG StatVal;
    828 
    829                 if (guest->GetStatistic(0, GuestStatisticType_SampleNumber, &StatVal) == S_OK)
    830                     RTPrintf("Statistics sample:      %u\n", StatVal);
    831                 if (guest->GetStatistic(0, GuestStatisticType_CPULoad_Idle, &StatVal) == S_OK)
    832                     RTPrintf("CPU load idle:          %u%%\n", StatVal);
    833                 if (guest->GetStatistic(0, GuestStatisticType_CPULoad_Kernel, &StatVal) == S_OK)
    834                     RTPrintf("CPU load kernel:        %u%%\n", StatVal);
    835                 if (guest->GetStatistic(0, GuestStatisticType_CPULoad_User, &StatVal) == S_OK)
    836                     RTPrintf("CPU load user:          %u%%\n", StatVal);
    837                 if (guest->GetStatistic(0, GuestStatisticType_Threads, &StatVal) == S_OK)
    838                     RTPrintf("Nr. of threads:         %u\n", StatVal);
    839                 if (guest->GetStatistic(0, GuestStatisticType_Processes, &StatVal) == S_OK)
    840                     RTPrintf("Nr. of processes:       %u\n", StatVal);
    841                 if (guest->GetStatistic(0, GuestStatisticType_Handles, &StatVal) == S_OK)
    842                     RTPrintf("Nr. of handles:         %u\n", StatVal);
    843                 if (guest->GetStatistic(0, GuestStatisticType_MemoryLoad, &StatVal) == S_OK)
    844                     RTPrintf("Memory load:            %u\n", StatVal);
    845                 if (guest->GetStatistic(0, GuestStatisticType_PhysMemTotal, &StatVal) == S_OK)
    846                     RTPrintf("Total phys. memory:     %uMB\n", StatVal);
    847                 if (guest->GetStatistic(0, GuestStatisticType_PhysMemAvailable, &StatVal) == S_OK)
    848                     RTPrintf("Available phys. memory: %uMB\n", StatVal);
    849                 if (guest->GetStatistic(0, GuestStatisticType_PhysMemBalloon, &StatVal) == S_OK)
    850                     RTPrintf("Balloon size:           %uMB\n", StatVal);
    851                 if (guest->GetStatistic(0, GuestStatisticType_MemCommitTotal, &StatVal) == S_OK)
    852                     RTPrintf("Total memory commit:    %uMB\n", StatVal);
    853                 if (guest->GetStatistic(0, GuestStatisticType_MemKernelTotal, &StatVal) == S_OK)
    854                     RTPrintf("Kernel memory:          %uMB\n", StatVal);
    855                 if (guest->GetStatistic(0, GuestStatisticType_MemKernelPaged, &StatVal) == S_OK)
    856                     RTPrintf("Paged kernel mem:       %uMB\n", StatVal);
    857                 if (guest->GetStatistic(0, GuestStatisticType_MemKernelNonpaged, &StatVal) == S_OK)
    858                     RTPrintf("Locked kernel mem:      %uMB\n", StatVal);
    859                 if (guest->GetStatistic(0, GuestStatisticType_MemSystemCache, &StatVal) == S_OK)
    860                     RTPrintf("System cache:          %uMB\n", StatVal);
    861                 if (guest->GetStatistic(0, GuestStatisticType_PageFileSize, &StatVal) == S_OK)
    862                     RTPrintf("Page file size:        %uMB\n", StatVal);
    863             }
    864         }
    865793        else if (!strcmp(a->argv[1], "teleport"))
    866794        {
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageInfo.cpp

    r27537 r27822  
    18061806            RTPrintf("Configured memory balloon size:      %d MB\n", guestVal);
    18071807    }
    1808     rc = machine->COMGETTER(StatisticsUpdateInterval)(&guestVal);
    1809     if (SUCCEEDED(rc))
    1810     {
    1811         if (details == VMINFO_MACHINEREADABLE)
    1812             RTPrintf("GuestStatisticsUpdateInterval=%d\n", guestVal);
    1813         else
    1814         {
    1815             if (guestVal == 0)
    1816                 RTPrintf("Statistics update:                   disabled\n");
    1817             else
    1818                 RTPrintf("Statistics update interval:          %d seconds\n", guestVal);
    1819         }
    1820     }
    18211808    if (details != VMINFO_MACHINEREADABLE)
    18221809        RTPrintf("\n");
    1823 
    1824     if (    console
    1825         &&  (   details == VMINFO_STATISTICS
    1826              || details == VMINFO_FULL
    1827              || details == VMINFO_MACHINEREADABLE))
    1828     {
    1829         ComPtr <IGuest> guest;
    1830 
    1831         rc = console->COMGETTER(Guest)(guest.asOutParam());
    1832         if (SUCCEEDED(rc))
    1833         {
    1834             ULONG statVal;
    1835 
    1836             rc = guest->GetStatistic(0, GuestStatisticType_SampleNumber, &statVal);
    1837             if (SUCCEEDED(rc))
    1838             {
    1839                 if (details == VMINFO_MACHINEREADABLE)
    1840                     RTPrintf("StatGuestSample=%d\n", statVal);
    1841                 else
    1842                     RTPrintf("Guest statistics for sample %d:\n\n", statVal);
    1843             }
    1844 
    1845             rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_Idle, &statVal);
    1846             if (SUCCEEDED(rc))
    1847             {
    1848                 if (details == VMINFO_MACHINEREADABLE)
    1849                     RTPrintf("StatGuestLoadIdleCPU%d=%d\n", 0, statVal);
    1850                 else
    1851                     RTPrintf("CPU%d: CPU Load Idle          %-3d%%\n", 0, statVal);
    1852             }
    1853 
    1854             rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_Kernel, &statVal);
    1855             if (SUCCEEDED(rc))
    1856             {
    1857                 if (details == VMINFO_MACHINEREADABLE)
    1858                     RTPrintf("StatGuestLoadKernelCPU%d=%d\n", 0, statVal);
    1859                 else
    1860                     RTPrintf("CPU%d: CPU Load Kernel        %-3d%%\n", 0, statVal);
    1861             }
    1862 
    1863             rc = guest->GetStatistic(0, GuestStatisticType_CPULoad_User, &statVal);
    1864             if (SUCCEEDED(rc))
    1865             {
    1866                 if (details == VMINFO_MACHINEREADABLE)
    1867                     RTPrintf("StatGuestLoadUserCPU%d=%d\n", 0, statVal);
    1868                 else
    1869                     RTPrintf("CPU%d: CPU Load User          %-3d%%\n", 0, statVal);
    1870             }
    1871 
    1872             rc = guest->GetStatistic(0, GuestStatisticType_Threads, &statVal);
    1873             if (SUCCEEDED(rc))
    1874             {
    1875                 if (details == VMINFO_MACHINEREADABLE)
    1876                     RTPrintf("StatGuestThreadsCPU%d=%d\n", 0, statVal);
    1877                 else
    1878                     RTPrintf("CPU%d: Threads                %d\n", 0, statVal);
    1879             }
    1880 
    1881             rc = guest->GetStatistic(0, GuestStatisticType_Processes, &statVal);
    1882             if (SUCCEEDED(rc))
    1883             {
    1884                 if (details == VMINFO_MACHINEREADABLE)
    1885                     RTPrintf("StatGuestProcessesCPU%d=%d\n", 0, statVal);
    1886                 else
    1887                     RTPrintf("CPU%d: Processes              %d\n", 0, statVal);
    1888             }
    1889 
    1890             rc = guest->GetStatistic(0, GuestStatisticType_Handles, &statVal);
    1891             if (SUCCEEDED(rc))
    1892             {
    1893                 if (details == VMINFO_MACHINEREADABLE)
    1894                     RTPrintf("StatGuestHandlesCPU%d=%d\n", 0, statVal);
    1895                 else
    1896                     RTPrintf("CPU%d: Handles                %d\n", 0, statVal);
    1897             }
    1898 
    1899             rc = guest->GetStatistic(0, GuestStatisticType_MemoryLoad, &statVal);
    1900             if (SUCCEEDED(rc))
    1901             {
    1902                 if (details == VMINFO_MACHINEREADABLE)
    1903                     RTPrintf("StatGuestMemoryLoadCPU%d=%d\n", 0, statVal);
    1904                 else
    1905                     RTPrintf("CPU%d: Memory Load            %d%%\n", 0, statVal);
    1906             }
    1907 
    1908             rc = guest->GetStatistic(0, GuestStatisticType_PhysMemTotal, &statVal);
    1909             if (SUCCEEDED(rc))
    1910             {
    1911                 if (details == VMINFO_MACHINEREADABLE)
    1912                     RTPrintf("StatGuestMemoryTotalPhysCPU%d=%d\n", 0, statVal);
    1913                 else
    1914                     RTPrintf("CPU%d: Total physical memory  %-4d MB\n", 0, statVal);
    1915             }
    1916 
    1917             rc = guest->GetStatistic(0, GuestStatisticType_PhysMemAvailable, &statVal);
    1918             if (SUCCEEDED(rc))
    1919             {
    1920                 if (details == VMINFO_MACHINEREADABLE)
    1921                     RTPrintf("StatGuestMemoryFreePhysCPU%d=%d\n", 0, statVal);
    1922                 else
    1923                     RTPrintf("CPU%d: Free physical memory   %-4d MB\n", 0, statVal);
    1924             }
    1925 
    1926             rc = guest->GetStatistic(0, GuestStatisticType_PhysMemBalloon, &statVal);
    1927             if (SUCCEEDED(rc))
    1928             {
    1929                 if (details == VMINFO_MACHINEREADABLE)
    1930                     RTPrintf("StatGuestMemoryBalloonCPU%d=%d\n", 0, statVal);
    1931                 else
    1932                     RTPrintf("CPU%d: Memory balloon size    %-4d MB\n", 0, statVal);
    1933             }
    1934 
    1935             rc = guest->GetStatistic(0, GuestStatisticType_MemCommitTotal, &statVal);
    1936             if (SUCCEEDED(rc))
    1937             {
    1938                 if (details == VMINFO_MACHINEREADABLE)
    1939                     RTPrintf("StatGuestMemoryCommittedCPU%d=%d\n", 0, statVal);
    1940                 else
    1941                     RTPrintf("CPU%d: Committed memory       %-4d MB\n", 0, statVal);
    1942             }
    1943 
    1944             rc = guest->GetStatistic(0, GuestStatisticType_MemKernelTotal, &statVal);
    1945             if (SUCCEEDED(rc))
    1946             {
    1947                 if (details == VMINFO_MACHINEREADABLE)
    1948                     RTPrintf("StatGuestMemoryTotalKernelCPU%d=%d\n", 0, statVal);
    1949                 else
    1950                     RTPrintf("CPU%d: Total kernel memory    %-4d MB\n", 0, statVal);
    1951             }
    1952 
    1953             rc = guest->GetStatistic(0, GuestStatisticType_MemKernelPaged, &statVal);
    1954             if (SUCCEEDED(rc))
    1955             {
    1956                 if (details == VMINFO_MACHINEREADABLE)
    1957                     RTPrintf("StatGuestMemoryPagedKernelCPU%d=%d\n", 0, statVal);
    1958                 else
    1959                     RTPrintf("CPU%d: Paged kernel memory    %-4d MB\n", 0, statVal);
    1960             }
    1961 
    1962             rc = guest->GetStatistic(0, GuestStatisticType_MemKernelNonpaged, &statVal);
    1963             if (SUCCEEDED(rc))
    1964             {
    1965                 if (details == VMINFO_MACHINEREADABLE)
    1966                     RTPrintf("StatGuestMemoryNonpagedKernelCPU%d=%d\n", 0, statVal);
    1967                 else
    1968                     RTPrintf("CPU%d: Nonpaged kernel memory %-4d MB\n", 0, statVal);
    1969             }
    1970 
    1971             rc = guest->GetStatistic(0, GuestStatisticType_MemSystemCache, &statVal);
    1972             if (SUCCEEDED(rc))
    1973             {
    1974                 if (details == VMINFO_MACHINEREADABLE)
    1975                     RTPrintf("StatGuestSystemCacheSizeCPU%d=%d\n", 0, statVal);
    1976                 else
    1977                     RTPrintf("CPU%d: System cache size      %-4d MB\n", 0, statVal);
    1978             }
    1979 
    1980             rc = guest->GetStatistic(0, GuestStatisticType_PageFileSize, &statVal);
    1981             if (SUCCEEDED(rc))
    1982             {
    1983                 if (details == VMINFO_MACHINEREADABLE)
    1984                     RTPrintf("StatGuestPageFileSizeCPU%d=%d\n", 0, statVal);
    1985                 else
    1986                     RTPrintf("CPU%d: Page file size         %-4d MB\n", 0, statVal);
    1987             }
    1988 
    1989             RTPrintf("\n");
    1990         }
    1991         else
    1992         {
    1993             if (details != VMINFO_MACHINEREADABLE)
    1994             {
    1995                 RTPrintf("[!] FAILED calling console->getGuest at line %d!\n", __LINE__);
    1996                 GluePrintRCMessage(rc);
    1997             }
    1998         }
    1999     }
    20001810
    20011811    /*
     
    20291839    { "--details",          'D', RTGETOPT_REQ_NOTHING },
    20301840    { "-details",           'D', RTGETOPT_REQ_NOTHING },    // deprecated
    2031     { "--statistics",       'S', RTGETOPT_REQ_NOTHING },
    2032     { "-statistics",        'S', RTGETOPT_REQ_NOTHING },    // deprecated
    20331841    { "--machinereadable",  'M', RTGETOPT_REQ_NOTHING },
    20341842    { "-machinereadable",   'M', RTGETOPT_REQ_NOTHING },    // deprecated
     
    20401848    const char *VMNameOrUuid = NULL;
    20411849    bool fDetails = false;
    2042     bool fStatistics = false;
    20431850    bool fMachinereadable = false;
    20441851
     
    20551862            case 'D':   // --details
    20561863                fDetails = true;
    2057                 break;
    2058 
    2059             case 'S':   // --statistics
    2060                 fStatistics = true;
    20611864                break;
    20621865
     
    21091912        return 1;
    21101913
    2111     /* 2nd option can be -details, -statistics or -argdump */
     1914    /* 2nd option can be -details or -argdump */
    21121915    VMINFO_DETAILS details = VMINFO_NONE;
    21131916    if (fMachinereadable)
    21141917        details = VMINFO_MACHINEREADABLE;
    21151918    else
    2116     if (fDetails && fStatistics)
     1919    if (fDetails)
    21171920        details = VMINFO_FULL;
    21181921    else
    21191922    if (fDetails)
    21201923        details = VMINFO_STANDARD;
    2121     else
    2122     if (fStatistics)
    2123         details = VMINFO_STATISTICS;
    21241924
    21251925    ComPtr <IConsole> console;
  • trunk/src/VBox/Frontends/VBoxManage/VBoxManageModifyVM.cpp

    r27537 r27822  
    120120    MODIFYVM_UARTMODE,
    121121    MODIFYVM_UART,
    122     MODIFYVM_GUESTSTATISTICSINTERVAL,
    123122    MODIFYVM_GUESTMEMORYBALLOON,
    124123    MODIFYVM_AUDIOCONTROLLER,
     
    216215    { "--uartmode",                 MODIFYVM_UARTMODE,                  RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
    217216    { "--uart",                     MODIFYVM_UART,                      RTGETOPT_REQ_STRING | RTGETOPT_FLAG_INDEX },
    218     { "--gueststatisticsinterval",  MODIFYVM_GUESTSTATISTICSINTERVAL,   RTGETOPT_REQ_UINT32 },
    219217    { "--guestmemoryballoon",       MODIFYVM_GUESTMEMORYBALLOON,        RTGETOPT_REQ_UINT32 },
    220218    { "--audiocontroller",          MODIFYVM_AUDIOCONTROLLER,           RTGETOPT_REQ_STRING },
     
    13951393            }
    13961394
    1397             case MODIFYVM_GUESTSTATISTICSINTERVAL:
    1398             {
    1399                 CHECK_ERROR(machine, COMSETTER(StatisticsUpdateInterval)(ValueUnion.u32));
    1400                 break;
    1401             }
    1402 
    14031395            case MODIFYVM_GUESTMEMORYBALLOON:
    14041396            {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette