-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #150
- Loading branch information
Pierre-Hugues Jeanneret
committed
Oct 9, 2017
1 parent
46a4e02
commit cafc2ea
Showing
12 changed files
with
198 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Net; | ||
|
||
namespace zipkin4net.Annotation | ||
{ | ||
public sealed class MessageAddr : IAnnotation | ||
{ | ||
public string ServiceName { get; } | ||
public IPEndPoint Endpoint { get; } | ||
|
||
internal MessageAddr(string serviceName, IPEndPoint endpoint) | ||
{ | ||
ServiceName = serviceName; | ||
Endpoint = endpoint; | ||
} | ||
|
||
public override string ToString() | ||
{ | ||
return string.Format("{0}: {1}/{2}", GetType().Name, ServiceName, Endpoint); | ||
} | ||
|
||
public override bool Equals(object obj) | ||
{ | ||
if (ReferenceEquals(null, obj)) return false; | ||
if (ReferenceEquals(this, obj)) return true; | ||
if (obj.GetType() != GetType()) return false; | ||
var messageAddr = (MessageAddr)obj; | ||
return Endpoint.Equals(messageAddr.Endpoint) | ||
&& string.Equals(ServiceName, messageAddr.ServiceName, StringComparison.OrdinalIgnoreCase); | ||
} | ||
|
||
public override int GetHashCode() | ||
{ | ||
var hashCode = -2129424941; | ||
hashCode = hashCode * -1521134295 + ServiceName.GetHashCode(); | ||
hashCode = hashCode * -1521134295 + Endpoint.GetHashCode(); | ||
return hashCode; | ||
} | ||
|
||
public void Accept(IAnnotationVisitor visitor) | ||
{ | ||
visitor.Visit(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace zipkin4net.Annotation | ||
{ | ||
public sealed class MessageRecvStart : IAnnotation | ||
{ | ||
internal MessageRecvStart() | ||
{} | ||
|
||
public override string ToString() | ||
{ | ||
return GetType().Name; | ||
} | ||
|
||
public void Accept(IAnnotationVisitor visitor) | ||
{ | ||
visitor.Visit(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace zipkin4net.Annotation | ||
{ | ||
public sealed class MessageRecvStop : IAnnotation | ||
{ | ||
internal MessageRecvStop() | ||
{} | ||
|
||
public override string ToString() | ||
{ | ||
return GetType().Name; | ||
} | ||
|
||
public void Accept(IAnnotationVisitor visitor) | ||
{ | ||
visitor.Visit(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace zipkin4net.Annotation | ||
{ | ||
public sealed class MessageSendStart : IAnnotation | ||
{ | ||
internal MessageSendStart() | ||
{} | ||
|
||
public override string ToString() | ||
{ | ||
return GetType().Name; | ||
} | ||
|
||
public void Accept(IAnnotationVisitor visitor) | ||
{ | ||
visitor.Visit(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
namespace zipkin4net.Annotation | ||
{ | ||
public sealed class MessageSendStop : IAnnotation | ||
{ | ||
internal MessageSendStop() | ||
{} | ||
|
||
public override string ToString() | ||
{ | ||
return GetType().Name; | ||
} | ||
|
||
public void Accept(IAnnotationVisitor visitor) | ||
{ | ||
visitor.Visit(this); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters