Author Topic: Overall Stats Ranking  (Read 24639 times)

0 Members and 1 Guest are viewing this topic.

Offline bejacob

  • Full Member
  • ***
  • Posts: 246
  • Last Login:June 03, 2025, 05:27:34 am
Overall Stats Ranking
« on: April 10, 2019, 09:26:49 pm »
Curious if there is any plan to change the TBD on the ranking of the overall stats part of the page. Not something that matters as I would consider it a low priority. Just wondering.

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4475
  • Last Login:May 02, 2025, 03:12:41 pm
  • I like C++
Re: Overall Stats Ranking
« Reply #1 on: July 11, 2019, 01:37:26 pm »
There's been a GitHub issue for some time now. It pops back up in discussion every now again, but making a fix never seems to gain much traction.
Quote from: Thing342
FYI: doing this only from the web side results in massive queries that take awhile to process.
Doesn't seem to me this should matter too much, at least in the case of a "Distance Traveled" ranking; we already use a query to get that very same info on http://travelmapping.net/stat.php
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline yakra

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 4475
  • Last Login:May 02, 2025, 03:12:41 pm
  • I like C++
Re: Overall Stats Ranking
« Reply #2 on: July 13, 2019, 08:04:56 pm »
I see what Thing342 means now. The query I'm using takes 1.3s, compared with 0.16s for the next slowest I saw, with everything else < 0.1s.
Double that, for one active & one active+preview query, and ouch.

I'll leave this on my own mirror of the site, maybe even make a commit to a separate branch, but not open a pull request just yet.
Eventually I may look into extra tables that can be created during the site update process to speed up the queries.
« Last Edit: July 13, 2019, 08:50:17 pm by yakra »
Sri Syadasti Syadavaktavya Syadasti Syannasti Syadasti Cavaktavyasca Syadasti Syannasti Syadavatavyasca Syadasti Syannasti Syadavaktavyasca

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2930
  • Last Login:Today at 06:59:13 am
Re: Overall Stats Ranking
« Reply #3 on: June 07, 2024, 09:02:56 pm »
I've got an implementation of the rankings on the user pages installed on the staging site (https://tmstage.teresco.org).  It's really slow, but I think it's worth that tradeoff.  I have some ideas how to improve efficiency but they likely involve new values being stored in the DB and changes to the site update process to compute and store those values.

Let me know what you think in this thread or in the relevant GitHub issue (https://github.com/TravelMapping/Web/issues/91) and I will decide if and when to get this over on the main site.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2930
  • Last Login:Today at 06:59:13 am
Re: Overall Stats Ranking
« Reply #4 on: June 08, 2024, 11:40:52 am »
I think I've got a way to fix the efficiency in the works (and a fix for the incorrect percentages now being shown on tmstage for routes traveled and clinched).

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2930
  • Last Login:Today at 06:59:13 am
Re: Overall Stats Ranking
« Reply #5 on: June 08, 2024, 02:30:15 pm »
A more efficient version has been tested on the development and staging servers, so I am installing on the main site.  Let me know if you see any problems with it.

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 5180
  • Last Login:Today at 01:50:50 pm
Re: Overall Stats Ranking
« Reply #6 on: June 08, 2024, 02:50:47 pm »
A more efficient version has been tested on the development and staging servers, so I am installing on the main site.  Let me know if you see any problems with it.

Thanks. I'm currently #3 for routes traveled and routes clinched. mapcat is #1 for both, vespertine #2, oscar #4, charliezeb #5.

HOWEVER: Distance traveled is fukced up now! mapcat is indicated being #21 only! https://travelmapping.net/user/?u=mapcat&units=miles I'm #13 instead of #14.
« Last Edit: June 08, 2024, 03:01:37 pm by michih »

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2930
  • Last Login:Today at 06:59:13 am
Re: Overall Stats Ranking
« Reply #7 on: June 08, 2024, 03:22:13 pm »
Thanks - I see the problem, hopefully a quick fix this evening.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2930
  • Last Login:Today at 06:59:13 am
Re: Overall Stats Ranking
« Reply #8 on: June 08, 2024, 04:19:24 pm »
Better?

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 5180
  • Last Login:Today at 01:50:50 pm
Re: Overall Stats Ranking
« Reply #9 on: June 09, 2024, 11:47:21 am »
Yep, thanks :)

Offline cenlaroads

  • TM Collaborator
  • Jr. Member
  • *****
  • Posts: 66
  • Last Login:Today at 02:18:27 pm
Re: Overall Stats Ranking
« Reply #10 on: June 02, 2025, 11:24:30 pm »
Would it be possible to add the ability to see a list of all users ranked by routes traveled and routes clinched, like we can for distance traveled?

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2930
  • Last Login:Today at 06:59:13 am
Re: Overall Stats Ranking
« Reply #11 on: June 03, 2025, 08:12:48 am »
Would it be possible to add the ability to see a list of all users ranked by routes traveled and routes clinched, like we can for distance traveled?

Are you thinking of something like this?  Update the table on

https://travelmapping.net/stat.php

to have the same information as the table at the bottom of pages like

https://travelmapping.net/user/region.php?units=miles&u=terescoj&rg=NY

where you can reorder the tables by traveled routes or clinched routes.

As you can see, the rank numbers remain tied to the distance traveled but maybe that would be ok for the stat page too as a start.

The DB has some design flaws that make some things, like ranking users by various criteria, inefficient.  Some day I'd like to redesign it if I ever learn enough about database design to do it properly.

Offline cenlaroads

  • TM Collaborator
  • Jr. Member
  • *****
  • Posts: 66
  • Last Login:Today at 02:18:27 pm
Re: Overall Stats Ranking
« Reply #12 on: June 03, 2025, 09:42:02 am »
Yes, basically that page, but for traveled routes and clinched routes for all regions, either on the same page or their own page.  I think that the rank numbers being tied to the distance traveled would be ok at first.

Offline Jim

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 2930
  • Last Login:Today at 06:59:13 am
Re: Overall Stats Ranking
« Reply #13 on: June 03, 2025, 01:04:57 pm »
I think the fairly straightforward addition is to add 2 columns to each of the user.php stat.php page's tables for number of (connected) routes traveled and number of routes clinched.

Added to an open GitHub issue:

https://github.com/TravelMapping/Web/issues/791
« Last Edit: June 03, 2025, 03:14:54 pm by Jim »

Offline michih

  • TM Collaborator
  • Hero Member
  • *****
  • Posts: 5180
  • Last Login:Today at 01:50:50 pm
Re: Overall Stats Ranking
« Reply #14 on: June 03, 2025, 01:23:20 pm »
Are you thinking of something like this?  Update the table on

https://travelmapping.net/stat.php

to have the same information as the table at the bottom of pages like

https://travelmapping.net/user/region.php?units=miles&u=terescoj&rg=NY

Seconded.