Comments (5)
Well it has been a while. This is a feature that requires a lot of time so I thought I'd give a kind of status update.
I want to avoid changing the communication protocol because of backwards compatibility (I think that atm, you can use any version of the web files with any plugin version). Testing will reveal whether that is actually necessary.
The idea of showing only the top-100 is already implemented locally (haven't committed yet), and that already fixes the general browser lag. For the lag when sorting, I have two options I will be trying, in order:
- Optimise sorting in js. Change in communication is not necessary but may improve performance further
- Pre-sort all stats/columns on server. Requires a non-backwards-compatible change in the communication protocol. Since this just moves the performance hit to the server, some extra things are needed to prevent causing server lag:
- Cache stats and sorting server-side: don't re-sort data for 30 seconds or so
- Custom sorting algorithm that takes advantage of the fact that only stats for online players need to be re-sorted
So things are coming, but they will take some time 😊
from webstats.
It works very well. Thank you!
from webstats.
Heyo!
Thanks for the suggestion. I'm not quite sure what you mean though. Currently you can sort by clicking on any stat's header, that way you can see who are the top players for a given stat.
Do you mean that it would indicate where the top-100 ends, and give every player an index (1 to 100)?
And with sheets, do you mean dividing them up in pages, like with < prev
and next >
controls?
Thank you for the tip on https! If I read things correctly, doing reverse proxy is something that needs to be set up manually in the web server configuration right? I would want to support https automatically in-plugin, but adding a note about reverse proxy to the readme can be a nice first step! (once I read into it a bit more)
from webstats.
The main issue I encountered is on the MySQL function. For example, I want to display the players' stats in a relatively large table (more than 10k rows). The page will contain too much data and cause the browser to lag. If the plugin can pre-sort the stats and only send the top players' data, then the issue can be solved. However, this solution might force the site to display different stats in different sheets.
And yes, the following code is an example.
location /stats.json {
proxy_pass http://ip:port/stats.json;
}
location /online.json {
proxy_pass http://ip:port/online.json;
}
from webstats.
It turns out that the first option was already enough and it was not necessary to change the communication protocol 🎉!
Here are the things that changed to improve performance (roughly ordered from most to least performance impact):
- Add pagination, by default only show 100 players at a time
- Optimise sorting method
- Add option to hide player heads
- When showing player heads, do not load images on hidden pages
You can use the latest js and html files which work just fine with the current jar and performance should be good now! I tested with 10k randomly generated entries on my laptop and the page was pretty responsive, let me know if it works for you as well!
from webstats.
Related Issues (20)
- How to create? And step-by-step config generator HOT 14
- Column ordering does not seem to work HOT 2
- Zero-values gives errors or empty cells HOT 8
- TypeError: this.rows.get(...) is undefined HOT 3
- Column unit display improvements
- Warn about soon-to-expire TLS certificate
- Discord webhook does not update HOT 5
- Set icon for Discord Webhook HOT 1
- Webpage show nothing but Compact, hide players and "loading..." HOT 7
- Custom player names and server row improvements HOT 7
- SkinsRestorer integration
- Command to remove stored placeholders for player
- Stats not updating HOT 11
- Question about serve-webpage HOT 1
- Config item to define "empty" text per placeholder
- I don't have any data of players's stats HOT 2
- Automatic TLS certificate renewal using acme.sh
- SkinRestorerAPI not initialized HOT 6
- disabling skins breaks the website HOT 2
- https issue HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from webstats.