MCPcopy Index your code
hub / github.com/scality/cloudserver / pushStats

Function pushStats

lib/management/push.js:117–138  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

115 }
116
117 function pushStats(options) {
118 if (process.env.PUSH_STATS === 'false') {
119 return;
120 }
121 const fromURL = `http://${cloudServerHost}:${cloudServerPort}/_/report`;
122 const fromOptions = {
123 json: true,
124 headers: {
125 'x-scal-report-token': process.env.REPORT_TOKEN,
126 'x-scal-report-skip-cache': Boolean(options && options.noCache),
127 },
128 };
129 request.get(fromURL, fromOptions, (err, response, body) => {
130 if (err) {
131 _logError(err, 'failed to get metrics report', 'pushStats');
132 return;
133 }
134 ws.send(ChannelMessageV0.encodeMetricsReportMessage(body),
135 err => _logError(err, 'failed to send metrics report message',
136 'pushStats'));
137 });
138 }
139
140 function closeChannel(channelId) {
141 const socket = socketsByChannelId[channelId];

Callers 1

startWSManagementClientFunction · 0.70

Calls 3

_logErrorFunction · 0.85
sendMethod · 0.80

Tested by

no test coverage detected