-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: add statistic tracking to agent-hub #204
Conversation
packages/@best/agent-frontend/src/client/modules/view/dashboard/dashboard.css
Outdated
Show resolved
Hide resolved
packages/@best/agent-frontend/src/client/modules/view/dashboard/dashboard.js
Outdated
Show resolved
Hide resolved
private addStatusChangeListener = (agent: Agent) => { | ||
agent.on('status-changed', ({ newValue }: { newValue: AgentStatus }) => { | ||
if (newValue === AgentStatus.Idle) { | ||
this.emit('idle-agent', agent); | ||
} else if (newValue === AgentStatus.Offline) { | ||
setTimeout(() => { |
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.
@jodarove can you triple check this logic make sure it makes sense from within the algorithm you created?
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.
🚢
@diervo I do not have permission to merge into the repository, so I'll need someone to hit that merge button once it is time to merge with all the required approval. |
I will release something EOD |
Thank you @ineedfat!! Keep them coming :) |
Details
Added stats tracking with StatsManager to agent-hub:
For now it begins tracking statistics like number of active/pending clients, total jobs in queue, and active/idle/offline agents by listening to specific log events. This will give us better insight into the server load, and therefore, be able to autoscale better in the cloud.
Added new behavior to remove agents that are offline for more than 30 minutes:
Previously, agent-hub has no way to remove offline clients, and after discussing with Jose, I've introduced a new behavior to remove clients that are offline for more than 30 minutes.
Modified front-end to display the new stats introduced by StatsManager
Does this PR introduce a breaking change?