UNPKG

openhim-core

Version:

The OpenHIM core application that provides logging and routing of http requests

564 lines (563 loc) 27.3 kB
<!doctype html> <html lang="en"> <head> <title>Code coverage report for src/stats.coffee</title> <meta charset="utf-8" /> <link rel="stylesheet" href="../prettify.css" /> <link rel="stylesheet" href="../base.css" /> <meta name="viewport" content="width=device-width, initial-scale=1"> <style type='text/css'> .coverage-summary .sorter { background-image: url(../sort-arrow-sprite.png); } </style> </head> <body> <div class='wrapper'> <div class='pad1'> <h1> <a href="../index.html">All files</a> / <a href="index.html">src</a> stats.coffee </h1> <div class='clearfix'> <div class='fl pad1y space-right2'> <span class="strong">14% </span> <span class="quiet">Statements</span> <span class='fraction'>14/100</span> </div> <div class='fl pad1y space-right2'> <span class="strong">0% </span> <span class="quiet">Branches</span> <span class='fraction'>0/8</span> </div> <div class='fl pad1y space-right2'> <span class="strong">0% </span> <span class="quiet">Functions</span> <span class='fraction'>0/8</span> </div> <div class='fl pad1y space-right2'> <span class="strong">14.89% </span> <span class="quiet">Lines</span> <span class='fraction'>14/94</span> </div> </div> </div> <div class='status-line low'></div> <pre><table class="coverage"> <tr><td class="line-count quiet">1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167</td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-yes">1x</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-no">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span> <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">config = require './config/config' SDC = require "statsd-client" statsdServer = config.get 'statsd' application = config.get 'application' logger = require "winston" os = require 'os' timer = new Date() domain = os.hostname() + '.' + application.name util = require 'util' &nbsp; sdc = new SDC statsdServer &nbsp; exports.incrementTransactionCount = <span class="fstat-no" title="function not covered" >(</span>ctx, done) -&gt; <span class="cstat-no" title="statement not covered" > logger.info 'sending counts to statsd for ' + domain + '.' + ctx.authorisedChannel._id</span> <span class="cstat-no" title="statement not covered" > transactionStatus = ctx.t</span>ransactionStatus try <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels' # Overall Counter</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + transactionStatus #Overall Transaction Status</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id # Per channel</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.statuses.' + transactionStatus # Per Channel Status</span> &nbsp; <span class="cstat-no" title="statement not covered" > if ctx.mediatorResponse?</span> # Check for custom mediator metrics if ctx.mediatorResponse.metrics? &nbsp; &nbsp; <span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" > for metric in ctx.mediatorResponse.metrics</span></span> &nbsp; if metric.type == 'counter' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing mediator counter ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.' + ctx.mediatorResponse.properties.name + '.mediator_metrics.' + metric.name</span> &nbsp; if metric.type == 'timer' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing mediator timer ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.' + ctx.mediatorResponse.properties.name + '.mediator_metrics.' + metric.name, metric.value</span> &nbsp; if metric.type == 'gauge' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing mediator gauge ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.gauge domain + '.channels.' + ctx.authorisedChannel._id + '.' + ctx.mediatorResponse.properties.name + '.mediator_metrics.' + metric.name, metric.value</span> &nbsp; &nbsp; <span class="cstat-no" title="statement not covered" > if ctx.mediatorResponse.orchestrations?</span> <span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" > for orchestration in ctx.mediatorResponse.orchestrations</span></span> do <span class="fstat-no" title="function not covered" >(</span>orchestration) -&gt; <span class="cstat-no" title="statement not covered" > orchestrationStatus = orchestration.response.s</span>tatus <span class="cstat-no" title="statement not covered" > orchestrationName = orchestration.n</span>ame if orchestration.group <span class="cstat-no" title="statement not covered" > orchestrationName = "#{orchestration.group}.#{orchestration.name}" #Namespace it by group</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.orchestrations.' + orchestrationName</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.orchestrations.' + orchestrationName + '.statusCodes.' + orchestrationStatus</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.statuses.' + transactionStatus + '.orchestrations.' + orchestrationName</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.statuses.' + transactionStatus + '.orchestrations.' + orchestrationName + '.statusCodes.' + orchestrationStatus</span> &nbsp; if orchestration.metrics? <span class="cstat-no" title="statement not covered" > for metric in orchestration.metrics</span> if metric.type == 'counter' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing orchestration counter ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.' + ctx.mediatorResponse.properties.name + '.orchestrations.' + orchestrationName + '.' + metric.name, metric.value</span> &nbsp; if metric.type == 'timer' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing orchestration timer ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.' + ctx.mediatorResponse.properties.name + '.orchestrations.' + orchestrationName + '.' + metric.name, metric.value</span> &nbsp; if metric.type == 'gauge' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing orchestration gauge ' + metric.name</span> sdc.gauge domain + '.channels.' + ctx.authorisedChannel._id + '.' + ctx.mediatorResponse.properties.name + '.orchestrations.' + orchestrationName + '.' + metric.name, metric.value &nbsp; catch <span class="cstat-no" title="statement not covered" >error</span> <span class="cstat-no" title="statement not covered" > logger.error error, done</span> done() &nbsp; exports.measureTransactionDuration = <span class="fstat-no" title="function not covered" >(</span>ctx, done) -&gt; <span class="cstat-no" title="statement not covered" > logger.info 'sending durations to statsd for ' + domain + '.' + ctx.authorisedChannel._id</span> <span class="cstat-no" title="statement not covered" > transactionStatus = ctx.t</span>ransactionStatus &nbsp; try <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels' , ctx.timer # Overall Timer</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + transactionStatus, ctx.timer # Overall Transaction Status</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id, ctx.timer # Per Channel</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.statuses.' + transactionStatus, ctx.timer # Per Channel Status</span> &nbsp; &nbsp; <span class="cstat-no" title="statement not covered" > if ctx.mediatorResponse?</span> <span class="cstat-no" title="statement not covered" > if ctx.mediatorResponse.orchestrations?</span> <span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" > for orchestration in ctx.mediatorResponse.orchestrations</span></span> do <span class="fstat-no" title="function not covered" >(</span>orchestration) -&gt; <span class="cstat-no" title="statement not covered" > orchestratrionDuration = orchestration.response.timestamp - orchestration.request.t</span>imestamp <span class="cstat-no" title="statement not covered" > orchestrationStatus = orchestration.response.s</span>tatus <span class="cstat-no" title="statement not covered" > orchestrationName = orchestration.n</span>ame if orchestration.group <span class="cstat-no" title="statement not covered" > orchestrationName = "#{orchestration.group}.#{orchestration.name}" #Namespace it by group</span> &nbsp; <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.orchestrations.' + orchestrationName, orchestratrionDuration</span> sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.orchestrations.' + orchestrationName + '.statusCodes.' + orchestrationStatus , orchestratrionDuration &nbsp; &nbsp; catch <span class="cstat-no" title="statement not covered" >error</span> <span class="cstat-no" title="statement not covered" > logger.error error, done</span> done() &nbsp; exports.nonPrimaryRouteRequestCount = <span class="fstat-no" title="function not covered" >(</span>ctx, route, done) -&gt; &nbsp; <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name # Per non-primary route</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.statusCodes.' + route.response.status # Per route response status</span> &nbsp; if route.metrics? <span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" > for metric in route.metrics</span></span> if metric.type == 'counter' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing mediator counter ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.mediator_metrics.' + metric.name</span> &nbsp; if metric.type == 'timer' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing mediator timer ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.mediator_metrics.' + metric.name, metric.value</span> &nbsp; if metric.type == 'gauge' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing mediator gauge ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.gauge domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.mediator_metrics.' + metric.name, metric.value</span> &nbsp; if route.orchestrations? <span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" > for orchestration in route.orchestrations</span></span> do <span class="fstat-no" title="function not covered" >(</span>orchestration) -&gt; <span class="cstat-no" title="statement not covered" > orchestrationStatus = orchestration.response.s</span>tatus <span class="cstat-no" title="statement not covered" > orchestrationName = orchestration.n</span>ame if orchestration.group <span class="cstat-no" title="statement not covered" > orchestrationName = "#{orchestration.group}.#{orchestration.name}" #Namespace it by group</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.orchestrations.' + orchestrationName</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.orchestrations.' + orchestrationName + '.statusCodes.' + orchestrationStatus</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.statusCodes.' + route.response.status + '.orchestrations.' + orchestrationName</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.statusCodes.' + route.response.status + '.orchestrations.' + orchestrationName + '.statusCodes.' + orchestrationStatus</span> &nbsp; # Log custom orchestration metrics if orchestration.metrics? <span class="cstat-no" title="statement not covered" > for metric in orchestration.metrics</span> if metric.type == 'counter' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing '+ route.name + ' orchestration counter ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.increment domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.orchestrations.' + orchestrationName + '.' + metric.name, metric.value</span> &nbsp; if metric.type == 'timer' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing '+ route.name + 'orchestration timer ' + metric.name</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.orchestrations.' + orchestrationName + '.' + metric.name, metric.value</span> &nbsp; if metric.type == 'gauge' <span class="cstat-no" title="statement not covered" > logger.info 'incrementing '+ route.name + 'orchestration gauge ' + metric.name</span> sdc.gauge domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.orchestrations.' + orchestrationName + '.' + metric.name, metric.value done() &nbsp; exports.nonPrimaryRouteDurations = <span class="fstat-no" title="function not covered" >(</span>ctx, route, done) -&gt; &nbsp; <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name, ctx.timer</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.statusCodes.' + route.response.status, ctx.timer</span> &nbsp; if route.orchestrations? <span class="cstat-no" title="statement not covered" ><span class="cstat-no" title="statement not covered" > for orchestration in route.orchestrations</span></span> do <span class="fstat-no" title="function not covered" >(</span>orchestration) -&gt; <span class="cstat-no" title="statement not covered" > orchestratrionDuration = orchestration.response.timestamp - orchestration.request.t</span>imestamp <span class="cstat-no" title="statement not covered" > orchestrationStatus = orchestration.response.s</span>tatus <span class="cstat-no" title="statement not covered" > orchestrationName = orchestration.n</span>ame if orchestration.group <span class="cstat-no" title="statement not covered" > orchestrationName = "#{orchestration.group}.#{orchestration.name}" #Namespace it by group</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.orchestrations.' + orchestrationName, orchestratrionDuration</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.orchestrations.' + orchestrationName + '.statusCodes.' + orchestrationStatus , orchestratrionDuration</span> <span class="cstat-no" title="statement not covered" > sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.statusCodes.' + route.response.status + '.orchestrations.' + orchestrationName, orchestratrionDuration</span> sdc.timing domain + '.channels.' + ctx.authorisedChannel._id + '.nonPrimaryRoutes.' + route.name + '.statusCodes.' + route.response.status + '.orchestrations.' + orchestrationName + '.statusCodes.' + orchestrationStatus , orchestratrionDuration &nbsp; done() &nbsp;</pre></td></tr> </table></pre> <div class='push'></div><!-- for sticky footer --> </div><!-- /wrapper --> <div class='footer quiet pad2 space-top1 center small'> Code coverage generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Oct 10 2016 13:39:22 GMT+0200 (SAST) </div> </div> <script src="../prettify.js"></script> <script> window.onload = function () { if (typeof prettyPrint === 'function') { prettyPrint(); } }; </script> <script src="../sorter.js"></script> </body> </html>