Export (0) Print
Expand All

DiagnosticMonitorConfiguration.OverallQuotaInMB Property

Updated: December 6, 2013

Gets or sets the total amount of local storage allocated for all logging buffers.

Namespace: Microsoft.WindowsAzure.Diagnostics
Assembly: Microsoft.WindowsAzure.Diagnostics (in Microsoft.WindowsAzure.Diagnostics.dll)

public int OverallQuotaInMB { get; set; }

Property Value

Type: System.Int32

Returns Int32.

The diagnostics.wadcfg file is used to configure diagnostics in your application. For more information on how to configure your diagnostics.wadcfg file, see Enabling Diagnostics in Windows Azure. Once your application is running in Windows Azure, you can use the DiagnosticMonitorConfiguration class along with the RoleInstanceDiagnosticManager class to remotely change your application’s diagnostics configuration.

The OverallQuotaInMB property specifies the amount of local storage allocated for the combined total of all the data buffers’ BufferQuotaInMB properties. If your buffer exceeds the OverallQuotaInMB size, older entries will be deleted, so you should consider this when sizing your data buffers and setting the frequency of your transfer intervals.

By default, the OverallQuotaInMB is set to 4GB. If you want to specify a smaller amount, you can set this property to your desired value. You cannot specify a larger value using this property; instead you must add a <LocalStorage> element for DiagnosticStore to your ServiceDefinition.csdef file. For example:

ServiceDefinition.csdef

<LocalResources>
    <LocalStorage name="DiagnosticStore" sizeInMB="8192" cleanOnRoleRecycle="false"/>
</LocalResources>

Note that if you specify a larger size in your ServiceConfiguration.cscfg file, such as 8GB in the example above, you must also set the OverallQuotaInMB property to the same value or a smaller value. If you make no changes to the value of the OverallQuotaInMB property, your data buffers will be limited to the original 4GB value.

For more information see How to Configure Local Storage Resources.

Example

The following snippet gets the diagnostic monitor configuration for each instance of a specific role, specifies a smaller overall quota, and sets the new configuration.

// Get the connection string. It's recommended that you store the connection string in your web.config or app.config file.
// Use the ConfigurationManager type to retrieve your storage connection string.  You can find the account name and key in
// the Windows Azure Management Portal (http://manage.windowsazure.com).
//string connectionString = "DefaultEndpointsProtocol=https;AccountName=<AccountName>;AccountKey=<AccountKey>";
string connectionString = System.Configuration.ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString;

// The deployment ID and role name for your application can be obtained from the 
// Windows Azure Management Portal (http://manage.windowsazure.com). See your 
// application dashboard under Cloud Services.
string deploymentID = "e2ab8b6667644666ba627bdf6f5e4daa";
string roleName = "WebRole1";

// Get the DeploymentDiagnosticManager object for your deployment.
DeploymentDiagnosticManager diagManager = new DeploymentDiagnosticManager(connectionString, deploymentID);

// Get the RoleInstanceDiagnosticManager objects for each instance of your role.
IEnumerable<RoleInstanceDiagnosticManager> instanceManagers = diagManager.GetRoleInstanceDiagnosticManagersForRole(roleName);

// Iterate through the role instances and update the configuration.
foreach (RoleInstanceDiagnosticManager roleInstance in instanceManagers)
{
   DiagnosticMonitorConfiguration diagnosticConfiguration = roleInstance.GetCurrentConfiguration();

   // Set an overall quota of 2GB.
   diagnosticConfiguration.OverallQuotaInMB = 2048;

   // Set the configuration.
   roleInstance.SetCurrentConfiguration(diagnosticConfiguration);
}

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

Development Platforms

Windows Vista, Windows 7 and Windows Server 2008

Target Platforms

Community Additions

ADD
Show:
© 2014 Microsoft