Raised This Month: $404 Target: $400
 101% 

Solved Time Played plugin based off Dr. McKay's Player Analytics


Post New Thread Reply   
 
Thread Tools Display Modes
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 10-14-2016 , 15:32   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #11

Quote:
Originally Posted by Deathknife View Post
Try this. Uses mysql config 'timeplayed'
Thank you, will test in a couple hours when I get home!
__________________
sneaK is offline
AeroAcrobat
AlliedModders Donor
Join Date: Apr 2011
Location: lives in a circus
Old 10-14-2016 , 15:47   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #12

TF2:


Too bad it takes a while (30-60 sec.) until the message appears but I guess that's not the plugins fault.
__________________
AeroAcrobat is offline
Deathknife
Senior Member
Join Date: Aug 2014
Old 10-14-2016 , 16:12   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #13

Quote:
Originally Posted by AeroAcrobat View Post
TF2:


Too bad it takes a while (30-60 sec.) until the message appears but I guess that's not the plugins fault.
How do other plugins compare w/ same host?

You can try increasing query priority, line 126.
__________________
Deathknife is offline
Arkarr
Veteran Member
Join Date: Sep 2012
Location: Just behind my PC screen
Old 10-14-2016 , 16:26   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #14

Too late haha, good job ;)
__________________
Arkarr is offline
AeroAcrobat
AlliedModders Donor
Join Date: Apr 2011
Location: lives in a circus
Old 10-14-2016 , 17:08   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #15

I've added an index on the auth field. Query duration went from 90 seconds to 0.01 seconds.

Code:
No auth index
+------+-------------+------------------+------+---------------+------+---------+------+---------+-------------+
| id   | select_type | table            | type | possible_keys | key  |  key_len | ref  | rows    | Extra       |
+------+-------------+------------------+------+---------------+------+---------+------+---------+-------------+
|    1 | PRIMARY     | player_analytics | ALL  | NULL          | NULL |  NULL    | NULL | 5986079 | Using where |
|    2 | SUBQUERY    | player_analytics | ALL  | NULL          | NULL |  NULL    | NULL | 5986079 | Using where |
+------+-------------+------------------+------+---------------+------+---------+------+---------+-------------+

With auth index
+------+-------------+------------------+------+---------------+------+---------+-------+------+------------------------------------+
| id   | select_type | table            | type | possible_keys | key  |  key_len | ref   | rows | Extra                              |
+------+-------------+------------------+------+---------------+------+---------+-------+------+------------------------------------+
|    1 | PRIMARY     | player_analytics | ref  | auth          | auth |  99      | const |   64 | Using index condition              |
|    2 | SUBQUERY    | player_analytics | ref  | auth          | auth |  99      | const |   64 | Using index condition; Using where |
+------+-------------+------------------+------+---------------+------+---------+-------+------+------------------------------------+
__________________
AeroAcrobat is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 10-14-2016 , 17:18   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #16

Quote:
Originally Posted by AeroAcrobat View Post
I've added an index on the auth field. Query duration went from 90 seconds to 0.01 seconds.

Spoiler
Sorry, could you explain how to accomplish this, is this a plugin change and/or a database change?
__________________
sneaK is offline
pcmaster
AlliedModders Donor
Join Date: Sep 2009
Old 10-14-2016 , 17:30   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #17

Quote:
Originally Posted by blackhawk74 View Post
Sorry, could you explain how to accomplish this, is this a plugin change and/or a database change?
It's a database change, the following SQL should be enough:
CREATE INDEX pa_auth ON player_analytics(auth);
__________________
pcmaster is offline
AeroAcrobat
AlliedModders Donor
Join Date: Apr 2011
Location: lives in a circus
Old 10-14-2016 , 19:41   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #18

Forgot to add:
When you say /sm_timeplayed the console output is:
Unknown command: sm_timeplayed

@
blackhawk74
What pcmaster said.
__________________
AeroAcrobat is offline
Deathknife
Senior Member
Join Date: Aug 2014
Old 10-14-2016 , 20:10   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #19

Quote:
Originally Posted by AeroAcrobat View Post
I've added an index on the auth field. Query duration went from 90 seconds to 0.01 seconds.
That's great.

Quote:
Originally Posted by AeroAcrobat View Post
Forgot to add:
When you say /sm_timeplayed the console output is:
Unknown command: sm_timeplayed
I edited my previous post with that fixed.
__________________
Deathknife is offline
sneaK
SourceMod Moderator
Join Date: Feb 2015
Location: USA
Old 10-14-2016 , 20:54   Re: Time Played plugin based off Dr. McKay's Player Analytics
Reply With Quote #20

Works wonderfully, thank you very much!
__________________
sneaK is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 11:17.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode