-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add metrics to sdk * metrics for sends and receives * format
- Loading branch information
1 parent
e14913b
commit 1a9d28e
Showing
10 changed files
with
67 additions
and
9 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
namespace Speckle.Sdk.Logging; | ||
|
||
public interface ISdkCounter<T> | ||
where T : struct | ||
{ | ||
void Add(T value); | ||
void Add(T value, KeyValuePair<string, object?> tag); | ||
void Add(T value, KeyValuePair<string, object?> tag1, KeyValuePair<string, object?> tag2); | ||
void Add( | ||
T value, | ||
KeyValuePair<string, object?> tag1, | ||
KeyValuePair<string, object?> tag2, | ||
KeyValuePair<string, object?> tag3 | ||
); | ||
void Add(T value, params KeyValuePair<string, object?>[] tag); | ||
} |
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,7 @@ | ||
namespace Speckle.Sdk.Logging; | ||
|
||
public interface ISdkMetricsFactory | ||
{ | ||
ISdkCounter<T> CreateCounter<T>(string name, string? unit = default, string? description = default) | ||
where T : struct; | ||
} |
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,8 @@ | ||
namespace Speckle.Sdk.Logging; | ||
|
||
public sealed class NullActivityFactory : ISdkActivityFactory | ||
{ | ||
public void Dispose() { } | ||
|
||
public ISdkActivity? Start(string? name = default, string source = "") => null; | ||
} |
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,20 @@ | ||
namespace Speckle.Sdk.Logging; | ||
|
||
public sealed class NullSdkCounter<T> : ISdkCounter<T> | ||
where T : struct | ||
{ | ||
public void Add(T value) { } | ||
|
||
public void Add(T value, KeyValuePair<string, object?> tag) { } | ||
|
||
public void Add(T value, KeyValuePair<string, object?> tag1, KeyValuePair<string, object?> tag2) { } | ||
|
||
public void Add( | ||
T value, | ||
KeyValuePair<string, object?> tag1, | ||
KeyValuePair<string, object?> tag2, | ||
KeyValuePair<string, object?> tag3 | ||
) { } | ||
|
||
public void Add(T value, params KeyValuePair<string, object?>[] tag) { } | ||
} |
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,7 @@ | ||
namespace Speckle.Sdk.Logging; | ||
|
||
public sealed class NullSdkMetricsFactory : ISdkMetricsFactory | ||
{ | ||
public ISdkCounter<T> CreateCounter<T>(string name, string? unit = default, string? description = default) | ||
where T : struct => new NullSdkCounter<T>(); | ||
} |
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