aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--client/src/app/+admin/admin-routing.module.ts4
-rw-r--r--client/src/app/+admin/admin.module.ts8
-rw-r--r--client/src/app/+admin/index.ts5
-rw-r--r--client/src/app/+admin/request-schedulers/index.ts4
-rw-r--r--client/src/app/+admin/request-schedulers/request-schedulers-stats/index.ts1
-rw-r--r--client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.html (renamed from client/src/app/+admin/requests/request-stats/request-stats.component.html)0
-rw-r--r--client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.scss (renamed from client/src/app/+admin/requests/request-stats/request-stats.component.scss)0
-rw-r--r--client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.ts (renamed from client/src/app/+admin/requests/request-stats/request-stats.component.ts)16
-rw-r--r--client/src/app/+admin/request-schedulers/request-schedulers.component.ts (renamed from client/src/app/+admin/requests/requests.component.ts)2
-rw-r--r--client/src/app/+admin/request-schedulers/request-schedulers.routes.ts (renamed from client/src/app/+admin/requests/requests.routes.ts)10
-rw-r--r--client/src/app/+admin/request-schedulers/shared/index.ts2
-rw-r--r--client/src/app/+admin/request-schedulers/shared/request-schedulers-stats-attributes.model.ts (renamed from client/src/app/+admin/requests/shared/request-stats-attributes.model.ts)4
-rw-r--r--client/src/app/+admin/request-schedulers/shared/request-schedulers.service.ts (renamed from client/src/app/+admin/requests/shared/request.service.ts)14
-rw-r--r--client/src/app/+admin/requests/index.ts4
-rw-r--r--client/src/app/+admin/requests/request-stats/index.ts1
-rw-r--r--client/src/app/+admin/requests/shared/index.ts2
-rw-r--r--server/controllers/api/index.ts4
-rw-r--r--server/controllers/api/request-schedulers.ts (renamed from server/controllers/api/requests.ts)22
-rw-r--r--server/tests/api/check-params/index.js2
-rw-r--r--server/tests/api/check-params/request-schedulers.js (renamed from server/tests/api/check-params/requests.js)4
-rw-r--r--server/tests/api/index.js2
-rw-r--r--server/tests/api/request-schedulers.js (renamed from server/tests/api/requests.js)4
-rw-r--r--server/tests/real-world/real-world.js4
-rw-r--r--server/tests/utils/request-schedulers.js (renamed from server/tests/utils/requests-stats.js)0
-rw-r--r--shared/models/request-scheduler.model.ts10
25 files changed, 62 insertions, 67 deletions
diff --git a/client/src/app/+admin/admin-routing.module.ts b/client/src/app/+admin/admin-routing.module.ts
index 839913135..bcc94a9f3 100644
--- a/client/src/app/+admin/admin-routing.module.ts
+++ b/client/src/app/+admin/admin-routing.module.ts
@@ -3,7 +3,7 @@ import { RouterModule, Routes } from '@angular/router'
3 3
4import { AdminComponent } from './admin.component' 4import { AdminComponent } from './admin.component'
5import { FriendsRoutes } from './friends' 5import { FriendsRoutes } from './friends'
6import { RequestsRoutes } from './requests' 6import { RequestSchedulersRoutes } from './request-schedulers'
7import { UsersRoutes } from './users' 7import { UsersRoutes } from './users'
8import { VideoAbusesRoutes } from './video-abuses' 8import { VideoAbusesRoutes } from './video-abuses'
9 9
@@ -18,7 +18,7 @@ const adminRoutes: Routes = [
18 pathMatch: 'full' 18 pathMatch: 'full'
19 }, 19 },
20 ...FriendsRoutes, 20 ...FriendsRoutes,
21 ...RequestsRoutes, 21 ...RequestSchedulersRoutes,
22 ...UsersRoutes, 22 ...UsersRoutes,
23 ...VideoAbusesRoutes 23 ...VideoAbusesRoutes
24 ] 24 ]
diff --git a/client/src/app/+admin/admin.module.ts b/client/src/app/+admin/admin.module.ts
index 9ecce5dc3..e4ba8e5b7 100644
--- a/client/src/app/+admin/admin.module.ts
+++ b/client/src/app/+admin/admin.module.ts
@@ -3,7 +3,7 @@ import { NgModule } from '@angular/core'
3import { AdminComponent } from './admin.component' 3import { AdminComponent } from './admin.component'
4import { AdminRoutingModule } from './admin-routing.module' 4import { AdminRoutingModule } from './admin-routing.module'
5import { FriendsComponent, FriendAddComponent, FriendListComponent, FriendService } from './friends' 5import { FriendsComponent, FriendAddComponent, FriendListComponent, FriendService } from './friends'
6import { RequestsComponent, RequestStatsComponent, RequestService } from './requests' 6import { RequestSchedulersComponent, RequestSchedulersStatsComponent, RequestSchedulersService } from './request-schedulers'
7import { UsersComponent, UserAddComponent, UserListComponent, UserService } from './users' 7import { UsersComponent, UserAddComponent, UserListComponent, UserService } from './users'
8import { VideoAbusesComponent, VideoAbuseListComponent } from './video-abuses' 8import { VideoAbusesComponent, VideoAbuseListComponent } from './video-abuses'
9import { SharedModule } from '../shared' 9import { SharedModule } from '../shared'
@@ -21,8 +21,8 @@ import { SharedModule } from '../shared'
21 FriendAddComponent, 21 FriendAddComponent,
22 FriendListComponent, 22 FriendListComponent,
23 23
24 RequestsComponent, 24 RequestSchedulersComponent,
25 RequestStatsComponent, 25 RequestSchedulersStatsComponent,
26 26
27 UsersComponent, 27 UsersComponent,
28 UserAddComponent, 28 UserAddComponent,
@@ -38,7 +38,7 @@ import { SharedModule } from '../shared'
38 38
39 providers: [ 39 providers: [
40 FriendService, 40 FriendService,
41 RequestService, 41 RequestSchedulersService,
42 UserService 42 UserService
43 ] 43 ]
44}) 44})
diff --git a/client/src/app/+admin/index.ts b/client/src/app/+admin/index.ts
index 11e2587c0..b628a3662 100644
--- a/client/src/app/+admin/index.ts
+++ b/client/src/app/+admin/index.ts
@@ -1,6 +1 @@
1export * from './friends'
2export * from './requests'
3export * from './users'
4export * from './admin-routing.module'
5export * from './admin.module' export * from './admin.module'
6export * from './admin.component'
diff --git a/client/src/app/+admin/request-schedulers/index.ts b/client/src/app/+admin/request-schedulers/index.ts
new file mode 100644
index 000000000..87b72e8c7
--- /dev/null
+++ b/client/src/app/+admin/request-schedulers/index.ts
@@ -0,0 +1,4 @@
1export * from './request-schedulers-stats'
2export * from './shared'
3export * from './request-schedulers.component'
4export * from './request-schedulers.routes'
diff --git a/client/src/app/+admin/request-schedulers/request-schedulers-stats/index.ts b/client/src/app/+admin/request-schedulers/request-schedulers-stats/index.ts
new file mode 100644
index 000000000..a3323e6be
--- /dev/null
+++ b/client/src/app/+admin/request-schedulers/request-schedulers-stats/index.ts
@@ -0,0 +1 @@
export * from './request-schedulers-stats.component'
diff --git a/client/src/app/+admin/requests/request-stats/request-stats.component.html b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.html
index 4508ab4c2..4508ab4c2 100644
--- a/client/src/app/+admin/requests/request-stats/request-stats.component.html
+++ b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.html
diff --git a/client/src/app/+admin/requests/request-stats/request-stats.component.scss b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.scss
index b2c413259..b2c413259 100644
--- a/client/src/app/+admin/requests/request-stats/request-stats.component.scss
+++ b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.scss
diff --git a/client/src/app/+admin/requests/request-stats/request-stats.component.ts b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.ts
index 140aaf47e..4e3fabc64 100644
--- a/client/src/app/+admin/requests/request-stats/request-stats.component.ts
+++ b/client/src/app/+admin/request-schedulers/request-schedulers-stats/request-schedulers-stats.component.ts
@@ -2,22 +2,22 @@ import { Component, OnInit, OnDestroy } from '@angular/core'
2 2
3import { NotificationsService } from 'angular2-notifications' 3import { NotificationsService } from 'angular2-notifications'
4 4
5import { RequestService, RequestSchedulerStatsAttributes } from '../shared' 5import { RequestSchedulersService, RequestSchedulerStatsAttributes } from '../shared'
6import { RequestScheduler } from '../../../../../../shared' 6import { RequestSchedulerStats } from '../../../../../../shared'
7 7
8@Component({ 8@Component({
9 selector: 'my-request-stats', 9 selector: 'my-request-schedulers-stats',
10 templateUrl: './request-stats.component.html', 10 templateUrl: './request-schedulers-stats.component.html',
11 styleUrls: [ './request-stats.component.scss' ] 11 styleUrls: [ './request-schedulers-stats.component.scss' ]
12}) 12})
13export class RequestStatsComponent implements OnInit, OnDestroy { 13export class RequestSchedulersStatsComponent implements OnInit, OnDestroy {
14 statsTitles = { 14 statsTitles = {
15 requestScheduler: 'Basic request scheduler', 15 requestScheduler: 'Basic request scheduler',
16 requestVideoEventScheduler: 'Video events request scheduler', 16 requestVideoEventScheduler: 'Video events request scheduler',
17 requestVideoQaduScheduler: 'Quick and dirty video updates request scheduler' 17 requestVideoQaduScheduler: 'Quick and dirty video updates request scheduler'
18 } 18 }
19 19
20 stats: RequestScheduler 20 stats: RequestSchedulerStats
21 21
22 private intervals: { [ id: string ]: number } = { 22 private intervals: { [ id: string ]: number } = {
23 requestScheduler: null, 23 requestScheduler: null,
@@ -33,7 +33,7 @@ export class RequestStatsComponent implements OnInit, OnDestroy {
33 33
34 constructor ( 34 constructor (
35 private notificationsService: NotificationsService, 35 private notificationsService: NotificationsService,
36 private requestService: RequestService 36 private requestService: RequestSchedulersService
37 ) { } 37 ) { }
38 38
39 ngOnInit () { 39 ngOnInit () {
diff --git a/client/src/app/+admin/requests/requests.component.ts b/client/src/app/+admin/request-schedulers/request-schedulers.component.ts
index 88a90fa4e..5444d6ea5 100644
--- a/client/src/app/+admin/requests/requests.component.ts
+++ b/client/src/app/+admin/request-schedulers/request-schedulers.component.ts
@@ -3,5 +3,5 @@ import { Component } from '@angular/core'
3@Component({ 3@Component({
4 template: '<router-outlet></router-outlet>' 4 template: '<router-outlet></router-outlet>'
5}) 5})
6export class RequestsComponent { 6export class RequestSchedulersComponent {
7} 7}
diff --git a/client/src/app/+admin/requests/requests.routes.ts b/client/src/app/+admin/request-schedulers/request-schedulers.routes.ts
index 84db3fea8..4961c646b 100644
--- a/client/src/app/+admin/requests/requests.routes.ts
+++ b/client/src/app/+admin/request-schedulers/request-schedulers.routes.ts
@@ -1,12 +1,12 @@
1import { Routes } from '@angular/router' 1import { Routes } from '@angular/router'
2 2
3import { RequestsComponent } from './requests.component' 3import { RequestSchedulersComponent } from './request-schedulers.component'
4import { RequestStatsComponent } from './request-stats' 4import { RequestSchedulersStatsComponent } from './request-schedulers-stats'
5 5
6export const RequestsRoutes: Routes = [ 6export const RequestSchedulersRoutes: Routes = [
7 { 7 {
8 path: 'requests', 8 path: 'requests',
9 component: RequestsComponent, 9 component: RequestSchedulersComponent,
10 children: [ 10 children: [
11 { 11 {
12 path: '', 12 path: '',
@@ -15,7 +15,7 @@ export const RequestsRoutes: Routes = [
15 }, 15 },
16 { 16 {
17 path: 'stats', 17 path: 'stats',
18 component: RequestStatsComponent, 18 component: RequestSchedulersStatsComponent,
19 data: { 19 data: {
20 meta: { 20 meta: {
21 title: 'Request stats' 21 title: 'Request stats'
diff --git a/client/src/app/+admin/request-schedulers/shared/index.ts b/client/src/app/+admin/request-schedulers/shared/index.ts
new file mode 100644
index 000000000..1a0174409
--- /dev/null
+++ b/client/src/app/+admin/request-schedulers/shared/index.ts
@@ -0,0 +1,2 @@
1export * from './request-schedulers-stats-attributes.model'
2export * from './request-schedulers.service'
diff --git a/client/src/app/+admin/requests/shared/request-stats-attributes.model.ts b/client/src/app/+admin/request-schedulers/shared/request-schedulers-stats-attributes.model.ts
index 394acc73d..6e19a0e44 100644
--- a/client/src/app/+admin/requests/shared/request-stats-attributes.model.ts
+++ b/client/src/app/+admin/request-schedulers/shared/request-schedulers-stats-attributes.model.ts
@@ -1,11 +1,11 @@
1import { RequestSchedulerAttributes as FormatedRequestSchedulerAttributes } from '../../../../../../shared' 1import { RequestSchedulerStatsAttributes as FormatedRequestSchedulerStatsAttributes } from '../../../../../../shared'
2 2
3export interface Request { 3export interface Request {
4 request: any 4 request: any
5 to: any 5 to: any
6} 6}
7 7
8export class RequestSchedulerStatsAttributes implements FormatedRequestSchedulerAttributes { 8export class RequestSchedulerStatsAttributes implements FormatedRequestSchedulerStatsAttributes {
9 requestsLimitPods: number 9 requestsLimitPods: number
10 requestsLimitPerPod: number 10 requestsLimitPerPod: number
11 milliSecondsInterval: number 11 milliSecondsInterval: number
diff --git a/client/src/app/+admin/requests/shared/request.service.ts b/client/src/app/+admin/request-schedulers/shared/request-schedulers.service.ts
index 53682b111..e9b166f78 100644
--- a/client/src/app/+admin/requests/shared/request.service.ts
+++ b/client/src/app/+admin/request-schedulers/shared/request-schedulers.service.ts
@@ -3,27 +3,27 @@ import { Observable } from 'rxjs/Observable'
3import 'rxjs/add/operator/catch' 3import 'rxjs/add/operator/catch'
4import 'rxjs/add/operator/map' 4import 'rxjs/add/operator/map'
5 5
6import { RequestScheduler } from '../../../../../../shared' 6import { RequestSchedulerStats } from '../../../../../../shared'
7import { AuthHttp, RestExtractor } from '../../../shared' 7import { AuthHttp, RestExtractor } from '../../../shared'
8import { RequestSchedulerStatsAttributes } from './request-stats-attributes.model' 8import { RequestSchedulerStatsAttributes } from './request-schedulers-stats-attributes.model'
9 9
10@Injectable() 10@Injectable()
11export class RequestService { 11export class RequestSchedulersService {
12 private static BASE_REQUEST_URL = API_URL + '/api/v1/requests/' 12 private static BASE_REQUEST_URL = API_URL + '/api/v1/request-schedulers/'
13 13
14 constructor ( 14 constructor (
15 private authHttp: AuthHttp, 15 private authHttp: AuthHttp,
16 private restExtractor: RestExtractor 16 private restExtractor: RestExtractor
17 ) {} 17 ) {}
18 18
19 getStats (): Observable<RequestScheduler> { 19 getStats (): Observable<RequestSchedulerStats> {
20 return this.authHttp.get(RequestService.BASE_REQUEST_URL + 'stats') 20 return this.authHttp.get(RequestSchedulersService.BASE_REQUEST_URL + 'stats')
21 .map(this.restExtractor.extractDataGet) 21 .map(this.restExtractor.extractDataGet)
22 .map(this.buildRequestObjects) 22 .map(this.buildRequestObjects)
23 .catch((res) => this.restExtractor.handleError(res)) 23 .catch((res) => this.restExtractor.handleError(res))
24 } 24 }
25 25
26 private buildRequestObjects (data: RequestScheduler) { 26 private buildRequestObjects (data: RequestSchedulerStats) {
27 const requestSchedulers = {} 27 const requestSchedulers = {}
28 28
29 Object.keys(data).forEach(requestSchedulerName => { 29 Object.keys(data).forEach(requestSchedulerName => {
diff --git a/client/src/app/+admin/requests/index.ts b/client/src/app/+admin/requests/index.ts
deleted file mode 100644
index d96a893c3..000000000
--- a/client/src/app/+admin/requests/index.ts
+++ /dev/null
@@ -1,4 +0,0 @@
1export * from './request-stats'
2export * from './shared'
3export * from './requests.component'
4export * from './requests.routes'
diff --git a/client/src/app/+admin/requests/request-stats/index.ts b/client/src/app/+admin/requests/request-stats/index.ts
deleted file mode 100644
index 740c401bb..000000000
--- a/client/src/app/+admin/requests/request-stats/index.ts
+++ /dev/null
@@ -1 +0,0 @@
1export * from './request-stats.component'
diff --git a/client/src/app/+admin/requests/shared/index.ts b/client/src/app/+admin/requests/shared/index.ts
deleted file mode 100644
index 857fe9d29..000000000
--- a/client/src/app/+admin/requests/shared/index.ts
+++ /dev/null
@@ -1,2 +0,0 @@
1export * from './request-stats-attributes.model'
2export * from './request.service'
diff --git a/server/controllers/api/index.ts b/server/controllers/api/index.ts
index ac3972ac6..3abe9bcf8 100644
--- a/server/controllers/api/index.ts
+++ b/server/controllers/api/index.ts
@@ -6,7 +6,7 @@ import { clientsRouter } from './clients'
6import { configRouter } from './config' 6import { configRouter } from './config'
7import { podsRouter } from './pods' 7import { podsRouter } from './pods'
8import { remoteRouter } from './remote' 8import { remoteRouter } from './remote'
9import { requestsRouter } from './requests' 9import { requestSchedulerRouter } from './request-schedulers'
10import { usersRouter } from './users' 10import { usersRouter } from './users'
11import { videosRouter } from './videos' 11import { videosRouter } from './videos'
12 12
@@ -16,7 +16,7 @@ apiRouter.use('/clients', clientsRouter)
16apiRouter.use('/config', configRouter) 16apiRouter.use('/config', configRouter)
17apiRouter.use('/pods', podsRouter) 17apiRouter.use('/pods', podsRouter)
18apiRouter.use('/remote', remoteRouter) 18apiRouter.use('/remote', remoteRouter)
19apiRouter.use('/requests', requestsRouter) 19apiRouter.use('/request-schedulers', requestSchedulerRouter)
20apiRouter.use('/users', usersRouter) 20apiRouter.use('/users', usersRouter)
21apiRouter.use('/videos', videosRouter) 21apiRouter.use('/videos', videosRouter)
22apiRouter.use('/ping', pong) 22apiRouter.use('/ping', pong)
diff --git a/server/controllers/api/requests.ts b/server/controllers/api/request-schedulers.ts
index 5718b59b7..8dd849007 100644
--- a/server/controllers/api/requests.ts
+++ b/server/controllers/api/request-schedulers.ts
@@ -8,29 +8,29 @@ import {
8 getRequestVideoEventScheduler 8 getRequestVideoEventScheduler
9} from '../../lib' 9} from '../../lib'
10import { authenticate, ensureIsAdmin } from '../../middlewares' 10import { authenticate, ensureIsAdmin } from '../../middlewares'
11import { RequestSchedulerAttributes } from '../../../shared' 11import { RequestSchedulerStatsAttributes } from '../../../shared'
12 12
13const requestsRouter = express.Router() 13const requestSchedulerRouter = express.Router()
14 14
15requestsRouter.get('/stats', 15requestSchedulerRouter.get('/stats',
16 authenticate, 16 authenticate,
17 ensureIsAdmin, 17 ensureIsAdmin,
18 getStatsRequests 18 getRequestSchedulersStats
19) 19)
20 20
21// --------------------------------------------------------------------------- 21// ---------------------------------------------------------------------------
22 22
23export { 23export {
24 requestsRouter 24 requestSchedulerRouter
25} 25}
26 26
27// --------------------------------------------------------------------------- 27// ---------------------------------------------------------------------------
28 28
29function getStatsRequests (req: express.Request, res: express.Response, next: express.NextFunction) { 29function getRequestSchedulersStats (req: express.Request, res: express.Response, next: express.NextFunction) {
30 parallel({ 30 parallel({
31 requestScheduler: buildRequestSchedulerFunction(getRequestScheduler()), 31 requestScheduler: buildRequestSchedulerStats(getRequestScheduler()),
32 requestVideoQaduScheduler: buildRequestSchedulerFunction(getRequestVideoQaduScheduler()), 32 requestVideoQaduScheduler: buildRequestSchedulerStats(getRequestVideoQaduScheduler()),
33 requestVideoEventScheduler: buildRequestSchedulerFunction(getRequestVideoEventScheduler()) 33 requestVideoEventScheduler: buildRequestSchedulerStats(getRequestVideoEventScheduler())
34 }, function (err, result) { 34 }, function (err, result) {
35 if (err) return next(err) 35 if (err) return next(err)
36 36
@@ -40,12 +40,12 @@ function getStatsRequests (req: express.Request, res: express.Response, next: ex
40 40
41// --------------------------------------------------------------------------- 41// ---------------------------------------------------------------------------
42 42
43function buildRequestSchedulerFunction (requestScheduler: AbstractRequestScheduler) { 43function buildRequestSchedulerStats (requestScheduler: AbstractRequestScheduler) {
44 return function (callback) { 44 return function (callback) {
45 requestScheduler.remainingRequestsCount(function (err, count) { 45 requestScheduler.remainingRequestsCount(function (err, count) {
46 if (err) return callback(err) 46 if (err) return callback(err)
47 47
48 const result: RequestSchedulerAttributes = { 48 const result: RequestSchedulerStatsAttributes = {
49 totalRequests: count, 49 totalRequests: count,
50 requestsLimitPods: requestScheduler.limitPods, 50 requestsLimitPods: requestScheduler.limitPods,
51 requestsLimitPerPod: requestScheduler.limitPerPod, 51 requestsLimitPerPod: requestScheduler.limitPerPod,
diff --git a/server/tests/api/check-params/index.js b/server/tests/api/check-params/index.js
index 527ab65a9..1ba16ff32 100644
--- a/server/tests/api/check-params/index.js
+++ b/server/tests/api/check-params/index.js
@@ -4,7 +4,7 @@
4require('./pods') 4require('./pods')
5require('./remotes') 5require('./remotes')
6require('./users') 6require('./users')
7require('./requests') 7require('./request-schedulers')
8require('./videos') 8require('./videos')
9require('./video-abuses') 9require('./video-abuses')
10require('./video-blacklists') 10require('./video-blacklists')
diff --git a/server/tests/api/check-params/requests.js b/server/tests/api/check-params/request-schedulers.js
index 0ce5582d6..9ba0df730 100644
--- a/server/tests/api/check-params/requests.js
+++ b/server/tests/api/check-params/request-schedulers.js
@@ -9,8 +9,8 @@ const loginUtils = require('../../utils/login')
9const usersUtils = require('../../utils/users') 9const usersUtils = require('../../utils/users')
10const serversUtils = require('../../utils/servers') 10const serversUtils = require('../../utils/servers')
11 11
12describe('Test requests API validators', function () { 12describe('Test request schedulers stats API validators', function () {
13 const path = '/api/v1/requests/stats' 13 const path = '/api/v1/request-schedulers/stats'
14 let server = null 14 let server = null
15 let userAccessToken = null 15 let userAccessToken = null
16 16
diff --git a/server/tests/api/index.js b/server/tests/api/index.js
index cc86a3d3b..7404d7d88 100644
--- a/server/tests/api/index.js
+++ b/server/tests/api/index.js
@@ -9,6 +9,6 @@ require('./single-pod')
9require('./video-abuse') 9require('./video-abuse')
10require('./video-blacklist') 10require('./video-blacklist')
11require('./multiple-pods') 11require('./multiple-pods')
12require('./requests') 12require('./request-schedulers')
13require('./friends-advanced') 13require('./friends-advanced')
14require('./video-transcoder') 14require('./video-transcoder')
diff --git a/server/tests/api/requests.js b/server/tests/api/request-schedulers.js
index 8762163af..c5c443f14 100644
--- a/server/tests/api/requests.js
+++ b/server/tests/api/request-schedulers.js
@@ -12,9 +12,9 @@ const podsUtils = require('../utils/pods')
12const serversUtils = require('../utils/servers') 12const serversUtils = require('../utils/servers')
13const videosUtils = require('../utils/videos') 13const videosUtils = require('../utils/videos')
14 14
15describe('Test requests stats', function () { 15describe('Test requests schedulers stats', function () {
16 const requestSchedulerNames = [ 'requestScheduler', 'requestVideoQaduScheduler', 'requestVideoEventScheduler' ] 16 const requestSchedulerNames = [ 'requestScheduler', 'requestVideoQaduScheduler', 'requestVideoEventScheduler' ]
17 const path = '/api/v1/requests/stats' 17 const path = '/api/v1/request-schedulers/stats'
18 let servers = [] 18 let servers = []
19 19
20 function uploadVideo (server, callback) { 20 function uploadVideo (server, callback) {
diff --git a/server/tests/real-world/real-world.js b/server/tests/real-world/real-world.js
index 3ac13f053..ea189c5f2 100644
--- a/server/tests/real-world/real-world.js
+++ b/server/tests/real-world/real-world.js
@@ -13,7 +13,7 @@ const loginUtils = require('../utils/login')
13const podsUtils = require('../utils/pods') 13const podsUtils = require('../utils/pods')
14const serversUtils = require('../utils/servers') 14const serversUtils = require('../utils/servers')
15const videosUtils = require('../utils/videos') 15const videosUtils = require('../utils/videos')
16const requestStatsUtils = require('../utils/requests-stats') 16const requestSchedulersUtils = require('../utils/request-schedulers')
17 17
18program 18program
19 .option('-c, --create [weight]', 'Weight for creating videos') 19 .option('-c, --create [weight]', 'Weight for creating videos')
@@ -344,7 +344,7 @@ function isThereAwaitingRequests (servers, callback) {
344 344
345 // Check is each server has awaiting requestq 345 // Check is each server has awaiting requestq
346 each(servers, function (server, callbackEach) { 346 each(servers, function (server, callbackEach) {
347 requestStatsUtils.getRequestsStats(server, server.accessToken, function (err, res) { 347 requestSchedulersUtils.getRequestsStats(server, server.accessToken, function (err, res) {
348 if (err) throw err 348 if (err) throw err
349 349
350 const stats = res.body 350 const stats = res.body
diff --git a/server/tests/utils/requests-stats.js b/server/tests/utils/request-schedulers.js
index 16835ce47..16835ce47 100644
--- a/server/tests/utils/requests-stats.js
+++ b/server/tests/utils/request-schedulers.js
diff --git a/shared/models/request-scheduler.model.ts b/shared/models/request-scheduler.model.ts
index f94ccfcab..8df184a09 100644
--- a/shared/models/request-scheduler.model.ts
+++ b/shared/models/request-scheduler.model.ts
@@ -4,7 +4,7 @@ export type RequestVideoQaduType = 'likes' | 'dislikes' | 'views'
4 4
5export type RequestVideoEventType = 'likes' | 'dislikes' | 'views' 5export type RequestVideoEventType = 'likes' | 'dislikes' | 'views'
6 6
7export type RequestSchedulerAttributes = { 7export type RequestSchedulerStatsAttributes = {
8 totalRequests: number 8 totalRequests: number
9 requestsLimitPods: number 9 requestsLimitPods: number
10 requestsLimitPerPod: number 10 requestsLimitPerPod: number
@@ -12,8 +12,8 @@ export type RequestSchedulerAttributes = {
12 milliSecondsInterval: number 12 milliSecondsInterval: number
13} 13}
14 14
15export interface RequestScheduler { 15export interface RequestSchedulerStats {
16 requestScheduler: RequestSchedulerAttributes 16 requestScheduler: RequestSchedulerStatsAttributes
17 requestVideoQaduScheduler: RequestSchedulerAttributes 17 requestVideoQaduScheduler: RequestSchedulerStatsAttributes
18 requestVideoEventScheduler: RequestSchedulerAttributes 18 requestVideoEventScheduler: RequestSchedulerStatsAttributes
19} 19}