m0r13 / mclogalyzer

Minecraft Server Log Analyzer
GNU General Public License v3.0
44 stars 20 forks source link

Use statistic figures #17

Open VikingScientist opened 9 years ago

VikingScientist commented 9 years ago

Creates a series of figures displaying the following use statistic:

The figures are created as static images using matplotlib and stored in the "img" folder.

In addition to figures, PvP kills and deaths are added to user statistics.

minecraft server log statistics - mozilla firefox_001 minecraft server log statistics - mozilla firefox_002 minecraft server log statistics - mozilla firefox_003

The figures are disabled by default, and is toggled on by the "--figures" flag. The creation of figures is now typically the most time-consuming part of the script.

VikingScientist commented 9 years ago

This might break design philosophy of the script as it is no longer a simple one-runnable-file which produces a single output html file. It now produces a series of output images which increases the maintenance complexity . Current expected issues:

These should be fixable if the pull request isn't immediately discarded due to design choices as mentioned above.

johnwoltman commented 9 years ago

That is really cool. I haven't look at the code yet but it could be a command line option so that people who don't want to worry about matplotlib don't have to install it. I'm definitely going to use this on my server, although I might experiment with making smaller plots.

lalligood commented 9 years ago

Let me share the same sentiments as J Woltman. Wow. Seriously nice work! Can't wait to start running mclogalyzer with these enhancements on my server B-)

--Lance

On Fri, Jul 10, 2015 at 11:50 AM, J Woltman notifications@github.com wrote:

That is really cool. I haven't look at the code yet but it could be a command line option so that people who don't want to worry about matplotlib don't have to install it. I'm definitely going to use this on my server.

— Reply to this email directly or view it on GitHub https://github.com/m0r13/mclogalyzer/pull/17#issuecomment-120442198.

m0r13 commented 9 years ago

Wow, that looks great! Thank you very much! I'm really starting to regret that me and my friends don't really have the time anymore for our little server.

I guess I can live with this change, as long as the script is still as simple usable as intended in the beginning. You are already doing that with the optional --figures flag, that's good. We might need some more documentation and have to mention the possible issues you also mentioned (location of img directory, file permissions etc.). I'll have a proper look at this really soon and merge your stuff.

I'm also thinking about a command line option to anonymize some of the output data (random names instead of nicks for example) so we could host some example stats. Is there maybe someone who wants to help with some interesting server logs? :)

VikingScientist commented 9 years ago

Thanks for the kind words :) I've added a lot of documentation in 1961894ba9c1d9547fa2d9f9c935f932f3686dc3 which should help anyone serious about reading the submitted code. To generate a html version of the documentation type

epydoc mclogalyzer/mclogalyzer.py

Regarding the issues listed in my previous comment then I sort of have an idea on how to fix them and would rather they be fixed than warned about. You could generate multiple sets of figures intended for different screen resolutions and you could put the "img" folder in the same folder as the output html file is placed. Will work on commits with respect to this next.

Don't know if matplotlib is a tough dependency to require or not. I did not have to install anything on my computer, and even if needs to be installed it might be easily accesible. I really don't know. Would be nice if this was enabled by default, but that particular problem I'll leave up to others to figure out.

m0r13 commented 9 years ago

Sorry that I didn't answer anymore, at the moment I'm quite busy with exams and don't have much time right now... I will have a closer look at that in a few weeks.

Wouldn't it be possible to use some kind of javascript framework to plot the server data in the browser instead of rendering it statically with matplotlib?

wraithan commented 8 years ago

A stopgap to using a JS renderer and just using the code as is, is base64 encoding the image data and inlining it into the HTML. This gets you back to single file without having to move to JS rendering. JS rendering and mouse overs and such can then be a next step feature.

That said, compiling this data to JSON and rendering in the front end with something advanced like d3, or something simple flot, highcharts, or rickshaw shouldn't be too difficult.

m0r13 commented 8 years ago

I would prefer directly using a Javascript library and not hazzling around with those images. However it's difficult for me to maintain this project at the moment. I don't have a Minecraft server anymore, so I'm not actively using this tool and also don't have current log files I can test the tool with. If there is someone who wants to work a bit more on this tool, I would be glad.

VikingScientist commented 8 years ago

On my initial creation, I could not figure out how to do direct rendering in php/javascript/html/whatever without including some form of external library; i.e. http://www.sitepoint.com/15-best-javascript-charting-libraries/. I figured that out of the two: external library and create the image folder, the latter was the lesser evil. It should be easy to revert this decision as all the data points is nicely stored in lists and arrays within the UserStats and ServerStats objects, while all image-generating code is found within the make_plots() function. One would just replace the make_plots function with some javascript-generating code based on the already accessible data sets and this would be enough.

I don't have much time to work on this, so if anyone want to contribute they are more than welcome. If not, then I might revisit this during my next vacation.

What javascript library would be preferred? How do you include these in a good copyright licence-correct fashion?