diff options
| author | Roy <Roy.mail.net@gmail.com> | 2022-11-15 11:14:01 +0200 |
|---|---|---|
| committer | Roy <Roy.mail.net@gmail.com> | 2022-11-15 11:14:01 +0200 |
| commit | 59052dd593c0d3d4eb2bf6c579e44c06daf7a038 (patch) | |
| tree | d39dd9289e16d897e82efe8be4c48509c4895cbb /Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics | |
| parent | 81b37f187ad6823bb27ce132782301fb0bbd0c75 (diff) | |
| download | Tango-59052dd593c0d3d4eb2bf6c579e44c06daf7a038.tar.gz Tango-59052dd593c0d3d4eb2bf6c579e44c06daf7a038.zip | |
Job runs extended info.
Diffstat (limited to 'Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics')
| -rw-r--r-- | Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs index 00381377d..7eee23925 100644 --- a/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs +++ b/Software/Visual_Studio/PPC/Tango.PPC.Common/Statistics/DefaultStatisticsService.cs @@ -1,6 +1,8 @@ -using System; +using Newtonsoft.Json; +using System; using System.Collections.Generic; using System.Data.Entity; +using System.IO; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -11,6 +13,7 @@ using Tango.BL.Enumerations; using Tango.Core; using Tango.Core.DI; using Tango.Integration.ExternalBridge; +using Tango.Integration.JobRuns; using Tango.PPC.Common.Connection; using Tango.PPC.Common.ExternalBridge; using Tango.PPC.Shared.Statistics; @@ -189,9 +192,30 @@ namespace Tango.PPC.Common.Statistics await receiver.SendGenericResponse(response, token); } - public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) + [ExternalBridgeRequestHandlerMethod(typeof(GetJobRunExtendedInfoRequest), RequestHandlerLoggingMode.LogRequestName)] + public async Task OnGetJobRunExtendedInfoRequest(GetJobRunExtendedInfoRequest request, String token, ExternalBridgeReceiver receiver) { + this.ThrowIfDisabled(); + + var response = new GetJobRunExtendedInfoResponse(); + + String filePath = Path.Combine((_machineProvider.MachineOperator.JobRunsLogger as BasicJobRunsLogger).JobRunsFolder, $"{request.JobRunID}.run"); + String json = File.ReadAllText(filePath); + + JobRunInfo info = JsonConvert.DeserializeObject<JobRunInfo>(json); + + response.ExtendedInfo.JobRunID = info.JobRunID; + response.ExtendedInfo.JobTicket = info.JobTicket; + response.ExtendedInfo.Events = info.Events; + response.ExtendedInfo.StartMachineStatus = info.StartMachineStatus; + response.ExtendedInfo.EndMachineStatus = info.EndMachineStatus; + await receiver.SendGenericResponse(response, token); + } + + public void OnReceiverDisconnected(ExternalBridgeReceiver receiver) + { + } } } |
