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

Is it possible to bring the statistics at once? #5

Closed
davidazdias1 opened this issue Jul 28, 2022 · 1 comment
Closed

Is it possible to bring the statistics at once? #5

davidazdias1 opened this issue Jul 28, 2022 · 1 comment

Comments

@davidazdias1
Copy link

Good morning, I would like to bring everything at once in this case only in a json and then using Preprocessing (bulk request), is it possible?
Thanks.
Compliments.

image

@davidazdias1
Copy link
Author

it's working

 case 'mirth.statistics_all':
     /*Obter IDs de canais implantados*/
     var getDeployedChannelIds = ChannelUtil.getDeployedChannelIds();
     var getDeployedChannelIdsCount = getDeployedChannelIds.size();
     /*Inicializar Matriz*/
     var Totaldata = [];
     /*InitializeObject*/
     var monitorObject = {};
     /*Cabeçalho JSON*/
     monitorObject.Date = DateUtil.getCurrentDate('yyyyMMdd');
     monitorObject.ClientKey = UUIDGenerator.getUUID();
     /*LoopIndependentChannelStatistics*/
     for (var index = 0; index < getDeployedChannelIds.size(); index++) {
         var ChannelID = getDeployedChannelIds.get(index);
         monitorObject.ChannelStats = {};
         monitorObject.ChannelStats.Id = ChannelID;
         monitorObject.ChannelStats.ChannelName = ChannelUtil.getChannelName(ChannelID);
         monitorObject.ChannelStats.ReceivedCount = ChannelUtil.getReceivedCount(ChannelID);
         monitorObject.ChannelStats.FilterCount = ChannelUtil.getFilteredCount(ChannelID);
         monitorObject.ChannelStats.QueuedCount = ChannelUtil.getQueuedCount(ChannelID);
         monitorObject.ChannelStats.ErrorCount = ChannelUtil.getErrorCount(ChannelID);
         monitorObject.ChannelStats.SentCount = ChannelUtil.getSentCount(ChannelID);
         Totaldata.push(monitorObject.ChannelStats);
     }
     monitorObject.ChannelStats = Totaldata;
     /*PrintJsonData*/
     msg = JSON.stringify(monitorObject);
     logger.info(msg);
     channelMap.put('jsonOutput', msg);
     break;

@cboyer cboyer closed this as completed Nov 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants