This topic has not yet been rated - Rate this topic

SPSite.UsageInfo structure

Provides fields used to access information regarding site collection usage.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)
'Declaration
Public Structure UsageInfo
'Usage
Dim instance As SPSite.UsageInfo

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
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.