-
Notifications
You must be signed in to change notification settings - Fork 1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ROV - The licode tool for inspection and app-level stats #1362
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really like this new component!
I left some comments, mostly related to an alternative use of Promises, but feel free to ignore them if they don't make sense.
Also, I'm not sure if using ROV instead of rov for the folder name follows our current naming convention for folder and so on, since we have lots of them in small case. But it's up to you.
@@ -24,6 +24,7 @@ describe('Erizo Agent', () => { | |||
}; | |||
|
|||
beforeEach(() => { | |||
global.config = { logger: { configFile: true } }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to enable logs for UTs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I just needed global.config
to be present correctly for the ROV componets, otherwise tests will fail. I noticed that's what we did for erizoController and ErizoJS so I followed that pattern.
erizo_controller/ROV/rovClient.js
Outdated
this.components.erizoAgents.forEach((agent) => { | ||
erizoListPromises.push(agent.runAndGetPromise('console.log(context.toJSON())')); | ||
}); | ||
Promise.all(erizoListPromises).then((erizoResults) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider something like:
this._establishComponentConnections(this.components.erizoAgents).then(() => {
...
return Promise.all(erizoListPromises);
}).then((erizoResults) => {
...
resolve();
}).catch(() => {
...
});
erizo_controller/ROV/rovClient.js
Outdated
|
||
runInComponentList(command, componentList) { | ||
return new Promise((resolve, reject) => { | ||
this.connectToComponentList(componentList).then(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider something like:
runInComponentList(command, componentList) {
return this.connectToComponentList(componentList).then(() => {
...
return Promise.all(runPromises);
});
}
}); | ||
} | ||
|
||
connectToComponentList(componentList) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider:
connectToComponentList(componentList) {
...
return Promise.all(connectPromises);
}
return this.sessions; | ||
} | ||
|
||
connectToSession(componentId) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider:
connectToSession(componentId) {
...
if (this.sessions.has(componentId)) {
return Promise.resolve();
}
...
return rovConnection.connect().then(() => {
...
return Promise.resolve();
});
}
}); | ||
} | ||
|
||
closeAllSessions() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider:
closeAllSessions() {
...
return Promise.all(closePromises).then() => {
...
return Promise.resolve();
});
}
this.log = logger; | ||
} | ||
|
||
getTotalRooms() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider:
getTotalRooms() {
...
return this.rovClient.runInComponentList(...).then((result) => {
...
return Promise.resolve();
});
}
}); | ||
} | ||
|
||
getTotalClients() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider something similar to what I propose for getTotalRooms()
}); | ||
} | ||
|
||
getActiveProcesses() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just return Promise.resolve() here if you want to give it a Promise-like interface.
}); | ||
} | ||
|
||
getTotalPublishersAndSubscribers() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is an alternative way, similar to what I proposed before.
Description
This PR implements ROV - a way to inspect licode components and gathering app-level stats for prometheus.
This works by allowing running remote REPL sessions in all erizo server-side components (erizoController, erizoAgent and erizoJS). The main components are:
[] It needs and includes Unit Tests
Changes in Client or Server public APIs
[] It includes documentation for these changes in
/doc
.