The class of interest here is Sitecore.Diagnostics.PerformanceCounters.DataCount
(in Sitecore.Kernel.dll). You can simply use the following technique:
var initialItemsAccessed = Sitecore.Diagnostics.PerformanceCounters.DataCount.DataItemsAccessed.Value;
SomeMethod();//the method you want to assess
var totalItemsAccessed = Sitecore.Diagnostics.PerformanceCounters.DataCount.DataItemsAccessed.Value - initialItemsAccessed;
The DataCount class has various other static counter properties which you can query in the same way.
I found this out by looking first at /Sitecore/admin/ShowConfig.aspx to see what processors are used within the mvc.renderRendering
pipeline. Two processors are of interest here:
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.StartStatisticRecording, Sitecore.Mvc"/>
and
<processor type="Sitecore.Mvc.Pipelines.Response.RenderRendering.RecordStatistic, Sitecore.Mvc"/>
Looking at these, I saw a call to DataCount.DataItemsAccessed.Value
which is used to query total items accessed before and after rendering the rendering.