Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force release and remove redundant private modifier #35

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Source/DataPointParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ namespace RaaLabs.Edge.Connectors.OPCUA;

public class DataPointParser : ICreateDatapointsFromDataValues
{
private readonly ConnectorConfiguration _configuration;
private readonly ILogger _logger;
private readonly IMetricsHandler _metrics;
private readonly TimeProvider _clock;
readonly ConnectorConfiguration _configuration;
readonly ILogger _logger;
readonly IMetricsHandler _metrics;
readonly TimeProvider _clock;

public DataPointParser(ConnectorConfiguration configuration, ILogger logger, IMetricsHandler metrics, TimeProvider clock)
{
Expand All @@ -38,15 +38,15 @@ public OpcuaDatapointOutput CreateDatapointFrom(NodeValue nodeValue)
};
}

private void LogWarningIfStatusCodeIsNotGood(NodeValue nodeValue)
void LogWarningIfStatusCodeIsNotGood(NodeValue nodeValue)
{
if (StatusCode.IsGood(nodeValue.Value.StatusCode) && StatusCode.IsNotBad(nodeValue.Value.StatusCode)) return;

_logger.Warning("Bad status code for node {NodeId} - {StatusCode}", nodeValue.Node, nodeValue.Value.StatusCode);
_metrics.NumberOfBadStatusCodesFor(1, nodeValue.Node.ToString()!);
}

private void LogWarningIfFaultyTimestamp(NodeValue nodeValue, DateTime timestamp, string timestampType)
void LogWarningIfFaultyTimestamp(NodeValue nodeValue, DateTime timestamp, string timestampType)
{
var dateTimeOffset = (DateTimeOffset) timestamp;
var utcNow = _clock.GetUtcNow();
Expand Down