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

Add Agent connection status icons #1482

Merged
merged 2 commits into from
May 31, 2016

Conversation

dsander
Copy link
Collaborator

@dsander dsander commented May 6, 2016

This adds icons the the Agent tables which give an indication if and how the agent is connected in the Agent network.

screenshot 2016-05-06 10 58 24

Since I was able to eliminate a n+1 query (superseded by #1486) the change should not impact the performance, as long as more then 3 Agents are shown it should even be faster then before.

Thanks to kreuzwerker.de who are paying me to work on this in the context of the research project 'Digitale Kuratierungstechnologien' of which they are a part of.

@dsander dsander force-pushed the feature/agent-icons branch 2 times, most recently from 25cee9f to aa71c8e Compare May 13, 2016 09:29
@cantino
Copy link
Member

cantino commented May 16, 2016

Cool idea!

I find the arrows a bit confusing. I wonder how to indicate coming in vs. going out more clearly. I kind of want an arrow going into a box vs. coming out of it, maybe?

private

def links_counter_cache(agents)
@counter_cache ||= {}.tap do |cache|
Copy link
Member

Choose a reason for hiding this comment

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

The variable @counter_cache isn't conditioned on agents. It it possible for this method to be called more than once with a different set of agents, causing cache pollution?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The cache would not be polluted because it's only set once per request, but calling it with a different agents array it could incorrectly return nil if the agents was not present in the first array. I added agents.__id__ as an additional cache key.

@dsander
Copy link
Collaborator Author

dsander commented May 17, 2016

I find the arrows a bit confusing. I wonder how to indicate coming in vs. going out more clearly. I kind of want an arrow going into a box vs. coming out of it, maybe?

Yeah, it wasn't easy to find icons that match well. Do you mean like the icon that is currently used for the commanding Agents?

@cantino
Copy link
Member

cantino commented May 18, 2016

Yes, the commanding one flipped left / right seems to make sense for the agents that create and receive events. I'm not sure what to then use for commanding ;)

@cantino
Copy link
Member

cantino commented May 18, 2016

Is this fairly performant? We could consider not showing control links if it sped it up.

@dsander
Copy link
Collaborator Author

dsander commented May 18, 2016

Yes, the commanding one flipped left / right seems to make sense for the agents that create and receive events. I'm not sure what to then use for commanding ;)

I think I don't follow, do you think about two icons for agents that send and receive or a combination of login and logout (http://getbootstrap.com/components/)? We could use the flipped new-window for commanding agents.

Performance wise it should be hard to notice, before it was fixed we had a n+1 for the agent event count on every agent table page and nobody complained about it :). What was n+1 before is would now be three extra query for every page.

@cantino
Copy link
Member

cantino commented May 19, 2016

Yes, I think login and logout make sense for events coming in and going out.

@dsander
Copy link
Collaborator Author

dsander commented May 23, 2016

screenshot 2016-05-23 09 33 03

I like how the icons are more consistent, but at the same time I see it as a problem as it makes the actions harder to distinguish from each other.

@cantino
Copy link
Member

cantino commented May 24, 2016

Yea, it feels a bit cluttered. When the emit and receive are combined into the pair of arrows, does it look better to you?

@dsander
Copy link
Collaborator Author

dsander commented May 25, 2016

Yes that makes it a bit cleaner. What I don't like is that it is really hard to see the difference between receiving and emitting agents. Maybe we should add a feedback-wanted label for pull requests that would benefit from more opinions or suggestions?

screenshot 2016-05-25 10 39 03

@cantino
Copy link
Member

cantino commented May 26, 2016

I agree that it's a bit hard to tell the difference between emitting and receiving events. Maybe we need help from a graphic designer?

@cantino
Copy link
Member

cantino commented May 26, 2016

I do think we could try rolling it out, though, and see what people think.


def links_counter_cache(agents)
@counter_cache ||= {}
@counter_cache[agents.__id__] ||= {}.tap do |cache|
Copy link
Member

Choose a reason for hiding this comment

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

Random question: is __id__ the same as object_id?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

As far as I know it is.

@dsander
Copy link
Collaborator Author

dsander commented May 27, 2016

I do think we could try rolling it out, though, and see what people think.

Sounds good to me, maybe we get some additional feedback over the weekend. I think a mix of the first and last approach could work:

screenshot 2016-05-27 12 54 12

@cantino
Copy link
Member

cantino commented May 29, 2016

I could get used to this design. Emit vs. receive aren't intuitive for me (left vs right), but I'm sure my brain would get used to it. Or maybe a graphic designer will show up.

@dsander dsander force-pushed the feature/agent-icons branch from 098f45d to 02d6421 Compare May 31, 2016 10:34
@dsander dsander force-pushed the feature/agent-icons branch from 02d6421 to 506a708 Compare May 31, 2016 10:35
@dsander
Copy link
Collaborator Author

dsander commented May 31, 2016

Cool, thanks for the feedback and reviews! It's funny how brains work differently when it comes to intuition :)

@dsander dsander merged commit 30fcfe1 into huginn:master May 31, 2016
@dsander dsander deleted the feature/agent-icons branch May 31, 2016 11:15
@cantino
Copy link
Member

cantino commented Jun 5, 2016

Nice :)

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

Successfully merging this pull request may close these issues.

2 participants