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

Remove Confluence specific task ratio formatter #13

Closed
cgbystrom opened this issue Jan 10, 2012 · 6 comments
Closed

Remove Confluence specific task ratio formatter #13

cgbystrom opened this issue Jan 10, 2012 · 6 comments
Assignees

Comments

@cgbystrom
Copy link
Member

Domain specific code for formatting the task ratio output for Confluence is a bit too specific to keep in Locust.

@ghost ghost assigned cgbystrom Jan 10, 2012
@heyman
Copy link
Member

heyman commented Jan 10, 2012

I agree. It could maybe reside in some contrib package.

However, I do think it's better to have the print_task_ratio code in a separate module than in an inline function in main.py.

@cgbystrom
Copy link
Member Author

I would say such code does not belong even in a contrib package. However outputting say JSON to do whatever might be more appropriate. Then you could write your 30 line Python script to transform that into whatever you please.

Maybe there's a better place for it but the reason I inlined that function was that it was only used in one place. With such small resulting file, I felt it really didn't justify its own module.

@heyman
Copy link
Member

heyman commented Jan 10, 2012

Yeah, I think you're right that the confluence stuff shouldn't be in the repo at all.

I definitely think it should be in a separate module though. Namespacing is nice and the code has little to do with anything else in main.py. If not because of anything else, keeping the main module clean is an argument in itself. Also - like with your JSON idea - I'm pretty sure we'll want to add more stuff for inspecting the locust "run schedules" sooner or later.

@cgbystrom
Copy link
Member Author

Of course, that is what namespaces are for. But when content is less than 20 lines long and only referenced in one place, a separate module is rarely justified.

On a side note: if we should continue with the current naming scheme, I like the name "brain" for "run schedules" .

@heyman
Copy link
Member

heyman commented Jan 10, 2012

IMHO, the purpose of a part of code is more important than the number of lines, when deciding if it should go into a separate module, even though I agree that size does matter :). I.e. I wouldn't like to merge our exception module into any of the other modules.

Anyway, I liked your idea of outputting the task ratio in JSON format, and I've now implemented it. I put that code, together with the print_task_ratio into it's own module again. The commits are: bc2992b and 1ee00c8.

I love the "brain" naming!

@cgbystrom
Copy link
Member Author

The exception module has a place because it's used from many places. Maybe even for working around circular imports. Oh well, enough bikeshedding.

cpennington added a commit to cpennington/locust that referenced this issue Aug 31, 2015
Add event for allowing plugins to handle reconfiguration events trigg…
pancaprima pushed a commit to pancaprima/locust that referenced this issue Oct 23, 2017
Prima bugfix timer doesn't work smoothly
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

No branches or pull requests

2 participants