SPSite.UsageInfo Structure

The UsageInfo structure provides fields used to access information regarding site collection usage.

System.Object

   System.ValueType

      Microsoft.SharePoint.SPSite.UsageInfo

Public Fields

The following table shows the public fields of the UsageInfo structure and a brief description of each.

Name Description
Bandwidth Contains the cumulative bandwidth used by the site collection on the previous day or on the last day that log files were processed, which is tracked by usage analysis code.
DiscussionStorage Contains the amount of storage in bytes consumed by Web discussion data in the site collection.
Hits Contains the cumulative number of hits on the site collection, which is tracked by the usage analysis code.
Storage Contains the total amount of storage in bytes that is consumed by the site collection.
Visits Contains the cumulative number of visits to the site collection, which is tracked by the usage analysis code.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Remarks

The Storage and DiscussionStorage fields contain data that is updated in real time, while 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 what is logged in the HTTP logs. The HTTP log reports most operations, but does not report requests for files in the _layouts directory or HTTP requests with results greater than or equal to 300 bytes.

Example

The following code example uses the UsageInfo structure to gather usage information about the current site collection.

This example requires using directives (Imports in Visual Basic) for both the Microsoft.SharePoint and Microsoft.SharePoint.WebControls namespaces.

Requirements

Namespace: Microsoft.SharePoint

Platforms: Microsoft Windows Server 2003

Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security