| 51 | // (e.g., hosting '/slave/log' for each agent log, we don't |
| 52 | // namespace metrics within '/metrics/snapshot', etc). |
| 53 | function agentURLPrefix(agent, includeProcessId) { |
| 54 | var port = agent.pid.substring(agent.pid.lastIndexOf(':') + 1); |
| 55 | var processId = agent.pid.substring(0, agent.pid.indexOf('@')); |
| 56 | |
| 57 | var url = '//' + agent.hostname + ':' + port; |
| 58 | |
| 59 | if (includeProcessId) { |
| 60 | url += '/' + processId; |
| 61 | } |
| 62 | |
| 63 | return url; |
| 64 | } |
| 65 | |
| 66 | function leadingMasterURLPrefix(leader_info) { |
| 67 | if (leader_info) { |