Skip to content
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

Merged
merged 2 commits into from
Oct 9, 2019
Merged

Conversation

ineedfat
Copy link
Contributor

@ineedfat ineedfat commented Sep 27, 2019

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

Sep-26-2019 17-07-33

Does this PR introduce a breaking change?

  • Yes
  • [ X] No

packages/@best/agent-frontend/src/server/manager.ts 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(() => {
Copy link
Contributor

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?

Copy link
Contributor

@diervo diervo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚢

@ineedfat
Copy link
Contributor Author

ineedfat commented Oct 9, 2019

🚢

@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.

@diervo
Copy link
Contributor

diervo commented Oct 9, 2019

I will release something EOD

@diervo diervo merged commit 929ff5d into salesforce:master Oct 9, 2019
@diervo
Copy link
Contributor

diervo commented Oct 9, 2019

Thank you @ineedfat!! Keep them coming :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants