PerformanceImpl.cpp revision 05c28d9d4557bed6e320dfee1acca69408bc3c15
/* $Id$ */
/** @file
*
* VBox Performance API COM Classes implementation
*/
/*
* Copyright (C) 2008 Sun Microsystems, Inc.
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*
* Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
* Clara, CA 95054 USA or visit http://www.sun.com if you need
* additional information or have any questions.
*/
#if defined(RT_OS_WINDOWS)
#elif defined(RT_OS_LINUX)
#endif
#include "PerformanceImpl.h"
#include "Logging.h"
#include <vector>
#include <algorithm>
#include <functional>
static Bstr gMetricNames[] =
{
};
////////////////////////////////////////////////////////////////////////////////
// PerformanceCollector class
////////////////////////////////////////////////////////////////////////////////
// constructor / destructor
////////////////////////////////////////////////////////////////////////////////
{
LogFlowThisFunc (("\n"));
return S_OK;
}
void PerformanceCollector::FinalRelease()
{
LogFlowThisFunc (("\n"));
}
// public initializer/uninitializer for internal purposes only
////////////////////////////////////////////////////////////////////////////////
/**
* Initializes the PerformanceCollector object.
*/
{
/* Enclose the state transition NotReady->InInit->Ready */
AutoInitSpan autoInitSpan (this);
/* @todo Obviously other platforms must be added as well. */
/* Start resource usage sampler */
&PerformanceCollector::staticSamplerCallback, this);
"sampling timer(%Rra)\n", vrc));
if (RT_FAILURE (vrc))
return rc;
}
/**
* Uninitializes the PerformanceCollector object.
*
* Called either from FinalRelease() or by the parent when it gets destroyed.
*/
void PerformanceCollector::uninit()
{
/* Enclose the state transition Ready->InUninit->NotReady */
AutoUninitSpan autoUninitSpan (this);
if (autoUninitSpan.uninitDone())
{
LogFlowThisFunc (("Already uninitialized.\n"));
return;
}
/* Destroy resource usage sampler */
"sampling timer (%Rra)\n", vrc));
delete mFactory;
}
// IPerformanceCollector properties
////////////////////////////////////////////////////////////////////////////////
{
return E_POINTER;
AutoCaller autoCaller (this);
AutoReadLock alock (this);
{
}
//gMetricNames.detachTo(ComSafeArrayOutArg (theMetricNames));
return S_OK;
}
// IPerformanceCollector methods
////////////////////////////////////////////////////////////////////////////////
{
//LogFlowThisFunc (("mState=%d, mType=%d\n", mState, mType));
AutoCaller autoCaller (this);
return E_NOTIMPL;
}
{
#if 0
#endif
return E_NOTIMPL;
}
{
return E_NOTIMPL;
}
{
return E_NOTIMPL;
}
{
AutoCaller autoCaller (this);
/// @todo r=dmik don't we need to lock this for reading?
int i;
/* Let's compute the size of the resulting flat array */
{
/* @todo Filtering goes here! */
}
{
/* @todo Filtering goes here! */
retLengths[i] = length;
retIndices[i] = flatIndex;
++i;
}
return S_OK;
}
// public methods for internal purposes
///////////////////////////////////////////////////////////////////////////////
{
}
{
}
{
aObject));
}
{
aObject));
}
// private methods
///////////////////////////////////////////////////////////////////////////////
/* static */
{
}
void PerformanceCollector::samplerCallback()
{
}
#if 0
{
}
{
}
{
LogFlowThisFunc (("\n"));
return S_OK;
}
void PerformanceData::FinalRelease()
{
LogFlowThisFunc (("\n"));
uninit ();
}
{
return S_OK;
}
void PerformanceData::uninit()
{
mData = 0;
mLength = 0;
}
{
return S_OK;
}
{
return S_OK;
}
{
return S_OK;
}
#endif
////////////////////////////////////////////////////////////////////////////////
// PerformanceMetric class
////////////////////////////////////////////////////////////////////////////////
// constructor / destructor
////////////////////////////////////////////////////////////////////////////////
{
mMetric = 0;
}
{
}
{
LogFlowThisFunc (("\n"));
return S_OK;
}
void PerformanceMetric::FinalRelease()
{
LogFlowThisFunc (("\n"));
uninit ();
}
// public initializer/uninitializer for internal purposes only
////////////////////////////////////////////////////////////////////////////////
{
return S_OK;
}
void PerformanceMetric::uninit()
{
}
{
return S_OK;
}
{
return S_OK;
}
{
return S_OK;
}
{
return S_OK;
}
{
return S_OK;
}
{
return S_OK;
}
{
return S_OK;
}