Class HttpHealthCheck
Represents a HTTP-based health check.
[DataContract]
public sealed class HttpHealthCheck : IEquatable<HttpHealthCheck>
- Inheritance
-
HttpHealthCheck
- Implements
- Inherited Members
Properties
Headers
The headers that should be sent in the HTTP request.
[DataMember(Name = "headers", EmitDefaultValue = true)]
public Dictionary<string, string> Headers { get; }
Property Value
Interval
The polling interval, in seconds.
[DataMember(Name = "interval", EmitDefaultValue = true)]
public int Interval { get; }
Property Value
Name
A name for the health check.
[DataMember(Name = "name", EmitDefaultValue = true)]
public string Name { get; }
Property Value
Timeout
The timeout after which a health check is deemed as failed, in milliseconds.
[DataMember(Name = "timeout", EmitDefaultValue = true)]
public long Timeout { get; }
Property Value
Url
The health check URL/endpoint.
[DataMember(Name = "url", EmitDefaultValue = true)]
public string Url { get; }
Property Value
Methods
AddHeader(string, string)
Adds a HTTP header, which will be sent with the HTTP request to the health check URL.
public void AddHeader(string name, string value)
Parameters
Exceptions
- ArgumentException
Thrown when
nameis null or empty, or whenvalueis null.
Equals(HttpHealthCheck)
Compares this health check with another by URL.
public bool Equals(HttpHealthCheck other)
Parameters
otherHttpHealthCheckThe health check to compare with.
Returns
Equals(object)
Compares this instance with another object.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with.
Returns
- bool
true when
objis a matching HttpHealthCheck; otherwise, false.
GetHashCode()
Returns a hash code derived from the health check URL.
public override int GetHashCode()
Returns
- int
A hash code for the current health check.