Skip to content

Commit 41e0095

Browse files
committed
update metrics functions :
- remove returned object, not used - remove addTcpConnection function, not used
1 parent 0e94768 commit 41e0095

File tree

1 file changed

+1
-43
lines changed

1 file changed

+1
-43
lines changed

src/streaming/models/MetricsModel.js

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
import Constants from '../constants/Constants';
3232
import MetricsConstants from '../constants/MetricsConstants';
3333
import MetricsList from '../vo/MetricsList';
34-
import TCPConnection from '../vo/metrics/TCPConnection';
3534
import {HTTPRequest, HTTPRequestTrace} from '../vo/metrics/HTTPRequest';
3635
import TrackSwitch from '../vo/metrics/RepresentationSwitch';
3736
import BufferLevel from '../vo/metrics/BufferLevel';
@@ -121,20 +120,6 @@ function MetricsModel() {
121120
}
122121
}
123122

124-
function addTcpConnection(mediaType, tcpid, dest, topen, tclose, tconnect) {
125-
let vo = new TCPConnection();
126-
127-
vo.tcpid = tcpid;
128-
vo.dest = dest;
129-
vo.topen = topen;
130-
vo.tclose = tclose;
131-
vo.tconnect = tconnect;
132-
133-
pushAndNotify(mediaType, MetricsConstants.TCP_CONNECTION, vo);
134-
135-
return vo;
136-
}
137-
138123
function appendHttpTrace(httpRequest, s, d, b) {
139124
let vo = new HTTPRequestTrace();
140125

@@ -211,8 +196,6 @@ function MetricsModel() {
211196
}
212197

213198
pushAndNotify(mediaType, MetricsConstants.HTTP_REQUEST, vo);
214-
215-
return vo;
216199
}
217200

218201
function addRepresentationSwitch(mediaType, t, mt, to, lto) {
@@ -229,8 +212,6 @@ function MetricsModel() {
229212
}
230213

231214
pushAndNotify(mediaType, MetricsConstants.TRACK_SWITCH, vo);
232-
233-
return vo;
234215
}
235216

236217
function pushAndNotify(mediaType, metricType, metricObject) {
@@ -244,8 +225,6 @@ function MetricsModel() {
244225
vo.level = level;
245226

246227
pushAndNotify(mediaType, MetricsConstants.BUFFER_LEVEL, vo);
247-
248-
return vo;
249228
}
250229

251230
function addBufferState(mediaType, state, target) {
@@ -254,8 +233,6 @@ function MetricsModel() {
254233
vo.state = state;
255234

256235
pushAndNotify(mediaType, MetricsConstants.BUFFER_STATE, vo);
257-
258-
return vo;
259236
}
260237

261238
function addDVRInfo(mediaType, currentTime, mpd, range) {
@@ -265,8 +242,6 @@ function MetricsModel() {
265242
vo.manifestInfo = mpd;
266243

267244
pushAndNotify(mediaType, MetricsConstants.DVR_INFO, vo);
268-
269-
return vo;
270245
}
271246

272247
function addDroppedFrames(mediaType, quality) {
@@ -277,12 +252,10 @@ function MetricsModel() {
277252
vo.droppedFrames = quality.droppedVideoFrames;
278253

279254
if (list.length > 0 && list[list.length - 1] == vo) {
280-
return list[list.length - 1];
255+
return;
281256
}
282257

283258
pushAndNotify(mediaType, MetricsConstants.DROPPED_FRAMES, vo);
284-
285-
return vo;
286259
}
287260

288261
function addSchedulingInfo(mediaType, t, type, startTime, availabilityStartTime, duration, quality, range, state) {
@@ -301,8 +274,6 @@ function MetricsModel() {
301274
vo.state = state;
302275

303276
pushAndNotify(mediaType, MetricsConstants.SCHEDULING_INFO, vo);
304-
305-
return vo;
306277
}
307278

308279
function addRequestsQueue(mediaType, loadingRequests, executedRequests) {
@@ -330,8 +301,6 @@ function MetricsModel() {
330301

331302
pushMetrics(Constants.STREAM, MetricsConstants.MANIFEST_UPDATE, vo);
332303
metricAdded(mediaType, MetricsConstants.MANIFEST_UPDATE, vo);
333-
334-
return vo;
335304
}
336305

337306
function updateManifestUpdateInfo(manifestUpdate, updatedFields) {
@@ -355,10 +324,7 @@ function MetricsModel() {
355324

356325
manifestUpdate.streamInfo.push(vo);
357326
metricUpdated(manifestUpdate.mediaType, MetricsConstants.MANIFEST_UPDATE_STREAM_INFO, manifestUpdate);
358-
359-
return vo;
360327
}
361-
return null;
362328
}
363329

364330
function addManifestUpdateRepresentationInfo(manifestUpdate, id, index, streamIndex, mediaType, presentationTimeOffset, startNumber, fragmentInfoType) {
@@ -375,10 +341,7 @@ function MetricsModel() {
375341

376342
manifestUpdate.representationInfo.push(vo);
377343
metricUpdated(manifestUpdate.mediaType, MetricsConstants.MANIFEST_UPDATE_TRACK_INFO, manifestUpdate);
378-
379-
return vo;
380344
}
381-
return null;
382345
}
383346

384347
function addPlayList(vo) {
@@ -395,24 +358,19 @@ function MetricsModel() {
395358
}
396359

397360
pushAndNotify(type, MetricsConstants.PLAY_LIST, vo);
398-
399-
return vo;
400361
}
401362

402363
function addDVBErrors(vo) {
403364
let type = Constants.STREAM;
404365

405366
pushAndNotify(type, MetricsConstants.DVB_ERRORS, vo);
406-
407-
return vo;
408367
}
409368

410369
instance = {
411370
clearCurrentMetricsForType: clearCurrentMetricsForType,
412371
clearAllCurrentMetrics: clearAllCurrentMetrics,
413372
getReadOnlyMetricsFor: getReadOnlyMetricsFor,
414373
getMetricsFor: getMetricsFor,
415-
addTcpConnection: addTcpConnection,
416374
addHttpRequest: addHttpRequest,
417375
addRepresentationSwitch: addRepresentationSwitch,
418376
addBufferLevel: addBufferLevel,

0 commit comments

Comments
 (0)