更新到Azure诊断:rolestatus并获取健康状态

时间:2011-07-27 04:27:18

标签: azure

所以我想知道Azure中RoleStatus和getHealthStatus()的更新诊断是什么?

由于 Supraja J

1 个答案:

答案 0 :(得分:0)

来自:http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleinstancestatuscheckeventargs.aspx

public override bool OnStart()
{
   RoleEnvironment.StatusCheck += RoleEnvironmentStatusCheck;
   return base.OnStart();
}

private void RoleEnvironmentStatusCheck(object sender, RoleInstanceStatusCheckEventArgs e)
{
   Trace.WriteLine("The status of the role instance: " + e.Status, "Information");
}

另见:

RoleInstanceStatusCheckEventArgs.SetBusy():http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleinstancestatuscheckeventargs.setbusy.aspx

RoleEnvironment.RequestRecycle():http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleenvironment.requestrecycle.aspx