SPSite.UsageInfo structure
SharePoint 2013
Provides fields used to access information regarding site collection usage.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
The Storage and DiscussionStorage fields contain data that is updated in real time; data for the Bandwidth field, Hits field, and Visits field is updated daily by the usage analysis timer job. The usage analysis timer job produces an aggregate summary of data in the site collection and reports only data contained in the HTTP logs. The HTTP log reports most operations, but it does not report requests for files in the _layouts directory.
The following code example uses the UsageInfo structure to gather usage information about the current site collection.
Dim siteCollection As SPSite = SPControl.GetContextSite(Context) Dim uInfo As SPSite.UsageInfo = siteCollection.Usage Dim discussionStorage As Int64 = uInfo.DiscussionStorage Dim storage As Int64 = uInfo.Storage Dim discussionStorage As Int64 = uInfo.Bandwidth Dim hits As Int64 = uInfo.Hits Dim visits As Int64 = uInfo.Visits