Changeset 10534 in vbox for trunk/src/VBox/Main/testcase
- Timestamp:
- Jul 11, 2008 3:21:53 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/testcase/tstAPI.cpp
r10528 r10534 920 920 921 921 #if 1 922 { 923 Bstr metricNames[] = { L"CPU/User:avg,CPU/System:avg,CPU/Idle:avg" }; 924 com::SafeArray<BSTR> metrics(1); 925 metricNames[0].detachTo(&metrics[0]); 926 922 for (int i = 0; i < 10; i++) 923 { 927 924 ComPtr <IHost> host; 928 925 CHECK_RC_BREAK (virtualBox->COMGETTER(Host) (host.asOutParam())); 929 ComPtr <IPerformanceCollector> collector;930 CHECK_RC( virtualBox->COMGETTER(PerformanceCollector)(collector.asOutParam()) );931 932 com::SafeIfaceArray<IUnknown> objects(1);933 host.queryInterfaceTo(&objects[0]);934 collector->SetupMetrics(ComSafeArrayAsInParam(metrics),935 ComSafeArrayAsInParam(objects), 1u, 10u);936 RTThreadSleep(3000); /* Sleep 10 seconds. */937 /*com::SafeIfaceArray<IPerformanceData> result;938 collector->QueryMetricsData(ComSafeArrayAsInParam(metrics),939 ComSafeArrayAsInParam(objects),940 ComSafeArrayAsOutParam(result));941 for (unsigned i = 0; i < result.size(); i++)942 {943 Bstr metricName;944 result[i]->COMGETTER(MetricName) (metricName.asOutParam());945 com::SafeArray<LONG> values;946 result[i]->COMGETTER(Values) (ComSafeArrayAsOutParam(values));947 printf("%ls", metricName.raw());948 for (unsigned j = 0; j < values.size(); j++)949 {950 printf(" %d\n", values[j]);951 }952 }*/953 }954 #endif955 #if 0956 for (int i = 0; i < 10; i++)957 {958 926 ULONG user, system, idle; 959 927 host->GetProcessorUsage(&user, &system, &idle); 960 928 printf("user=%u system=%u idle=%u\n", user/10000000, system/10000000, idle/10000000); 961 } 962 #endif 963 964 #if 0 929 RTThreadSleep(1000); 930 } 931 #endif 932 933 #if 1 965 934 { 966 935 ComPtr <IMachine> machine;
Note:
See TracChangeset
for help on using the changeset viewer.