private void ReportPartitionHealthHelper(Health.HealthInformation healthInfo, Health.HealthReportSendOptions sendOptions)
        {
            using (var pin = new PinCollection())
            {
                var nativeSendOptions = IntPtr.Zero;
                if (sendOptions != null)
                {
                    nativeSendOptions = sendOptions.ToNative(pin);
                }

                this.nativePartition.ReportPartitionHealth2(healthInfo.ToNative(pin), nativeSendOptions);
            }
        }
 /// <summary>
 /// Reports health on the current stateless service instance.
 /// Specifies send options that control how the report is sent to the health store.
 /// </summary>
 /// <param name="healthInfo">The <see cref="System.Fabric.Health.HealthInformation"/> that describes the health report information.</param>
 /// <param name="sendOptions">
 /// <para>The <see cref="System.Fabric.Health.HealthReportSendOptions"/> that controls how the report is sent.</para>
 /// </param>
 /// <remarks>
 /// <para>The health information describes the report details, like the source ID, the property, the health state
 /// and other relevant details.
 /// Internally, the partition uses an internal health client to send the reports to the health store.
 /// The client optimizes messages to Health Manager by batching reports per a configured duration (Default: 30 seconds).
 /// If the report has high priority, you can specify send options to send it immediately.
 /// </para>
 /// <para>Read more about <see href="https://docs.microsoft.com/azure/service-fabric/service-fabric-report-health">health reporting</see>.</para>
 /// </remarks>
 public void ReportInstanceHealth(Health.HealthInformation healthInfo, Health.HealthReportSendOptions sendOptions)
 {
     Requires.Argument("healthInfo", healthInfo).NotNull();
     Utility.WrapNativeSyncInvoke(() => this.ReportInstanceHealthHelper(healthInfo, sendOptions), "StatelessPartition.ReportInstanceHealth");
 }
 /// <summary>
 /// Reports health on the current partition.
 /// </summary>
 /// <param name="healthInfo">The <see cref="System.Fabric.Health.HealthInformation"/> that describes the health report information.</param>
 /// <remarks>
 /// <para>The health information describes the report details, like the source ID, the property, the health state
 /// and other relevant details.
 /// The partition uses an internal health client to send the reports to the health store.
 /// The client optimizes messages to Health Manager by batching reports per a configured duration (Default: 30 seconds).
 /// If the report has high priority, you can specify send options to send it immediately by using
 /// <see cref="System.Fabric.StatelessServicePartition.ReportPartitionHealth(System.Fabric.Health.HealthInformation, System.Fabric.Health.HealthReportSendOptions)"/>.
 /// </para>
 /// <para>Read more about <see href="https://docs.microsoft.com/azure/service-fabric/service-fabric-report-health">health reporting</see>.</para>
 /// </remarks>
 public void ReportPartitionHealth(Health.HealthInformation healthInfo)
 {
     Requires.Argument("healthInfo", healthInfo).NotNull();
     Utility.WrapNativeSyncInvoke(() => this.ReportPartitionHealthHelper(healthInfo, null), "StatelessPartition.ReportPartitionHealth");
 }
Exemple #4
0
 public void ReportPartitionHealth(SfHealthInformation healthInfo, System.Fabric.Health.HealthReportSendOptions sendOptions) =>
 ReportPartitionHealth(healthInfo);
Exemple #5
0
 public void ReportPartitionHealth(SfHealthInformation healthInfo) => HealthInformation.Add(healthInfo);
Exemple #6
0
 /// <summary>
 /// <para>Creates a cluster health report.</para>
 /// </summary>
 /// <param name="healthInformation">
 /// <para>The health information which describes the report parameters. Cannot be null.</para>
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// <para>A null value was passed in for a required parameter.</para>
 /// </exception>
 public ClusterHealthReport(HealthInformation healthInformation)
     : base(HealthReportKind.Cluster, healthInformation)
 {
 }
 /// <summary>
 /// <para>Initializes a new instance of the <see cref="System.Fabric.Health.PartitionHealthReport" /> class.</para>
 /// </summary>
 /// <param name="partitionId">
 /// <para>The partition ID. Required.</para>
 /// </param>
 /// <param name="healthInformation">
 /// <para>The <see cref="System.Fabric.Health.HealthInformation" /> which describes the report fields, like sourceId, property,
 /// health state. Required.</para>
 /// </param>
 /// <exception cref="System.ArgumentNullException">
 /// <para>A null value was passed in for a required parameter.</para>
 /// </exception>
 public PartitionHealthReport(Guid partitionId, HealthInformation healthInformation)
     : base(HealthReportKind.Partition, healthInformation)
 {
     this.PartitionId = partitionId;
 }