Skip to content

Commit c010fe4

Browse files
committed
Use seconds for duration and log connection duration
Signed-off-by: Victor Chang <[email protected]>
1 parent bde5d47 commit c010fe4

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/InformaticsGateway/Logging/Log.100.200.ScpService.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,5 +103,8 @@ public static partial class Log
103103

104104
[LoggerMessage(EventId = 213, Level = LogLevel.Error, Message = "Error saving DICOM association information. Correlation ID={correlationId}.")]
105105
public static partial void ErrorSavingDicomAssociationInfo(this ILogger logger, Guid correlationId, Exception ex);
106+
107+
[LoggerMessage(EventId = 214, Level = LogLevel.Information, Message = "Connection closed. Correlation ID={correlationId}. Calling AE Title={callingAeTitle}. Called AE Title={calledAeTitle}. Duration={durationSeconds} seconds.")]
108+
public static partial void ConnectionClosed(this ILogger logger, string correlationId, string callingAeTitle, string calledAeTitle, double durationSeconds);
106109
}
107110
}

src/InformaticsGateway/Logging/Log.700.PayloadService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ public static partial class Log
5353
[LoggerMessage(EventId = 711, Level = LogLevel.Information, Message = "Publishing workflow request message ID={messageId}...")]
5454
public static partial void PublishingWorkflowRequest(this ILogger logger, string messageId);
5555

56-
[LoggerMessage(EventId = 712, Level = LogLevel.Information, Message = "Workflow request published to {queue}, message ID={messageId}. Payload took {payloadElapsedTime} to complete.")]
57-
public static partial void WorkflowRequestPublished(this ILogger logger, string queue, string messageId, TimeSpan payloadElapsedTime);
56+
[LoggerMessage(EventId = 712, Level = LogLevel.Information, Message = "Workflow request published to {queue}, message ID={messageId}. Payload took {durationSeconds} seconds to complete.")]
57+
public static partial void WorkflowRequestPublished(this ILogger logger, string queue, string messageId, double durationSeconds);
5858

5959
[LoggerMessage(EventId = 713, Level = LogLevel.Information, Message = "Restoring payloads from database.")]
6060
public static partial void StartupRestoreFromDatabase(this ILogger logger);

src/InformaticsGateway/Services/Connectors/PayloadNotificationActionHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ await messageBrokerPublisherService.Publish(
135135
_options.Value.Messaging.Topics.WorkflowRequest,
136136
message.ToMessage()).ConfigureAwait(false);
137137

138-
_logger.WorkflowRequestPublished(_options.Value.Messaging.Topics.WorkflowRequest, message.MessageId, payload.Elapsed);
138+
_logger.WorkflowRequestPublished(_options.Value.Messaging.Topics.WorkflowRequest, message.MessageId, payload.Elapsed.TotalSeconds);
139139
}
140140

141141
private async Task<PayloadAction> UpdatePayloadState(Payload payload, CancellationToken cancellationToken = default)

src/InformaticsGateway/Services/Scp/ScpServiceInternal.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public void OnConnectionClosed(Exception exception)
7474
var repo = _associationDataProvider!.GetService<IDicomAssociationInfoRepository>();
7575
_associationInfo.Disconnect();
7676
repo?.AddAsync(_associationInfo).Wait();
77+
_logger.ConnectionClosed(_associationInfo.CorrelationId, _associationInfo.CallingAeTitle, _associationInfo.CalledAeTitle, _associationInfo.Duration.TotalSeconds);
7778
}
7879
catch (Exception ex)
7980
{

0 commit comments

Comments
 (0)