Stats based off the last 100 hands.

Forum for users that want to write their own custom queries against the PT database either via the Structured Query Language (SQL) or using the PT3 custom stats/reports interface.

Moderator: Moderators

Re: Stats based off the last 100 hands.

Postby Kevweiser » Thu Dec 18, 2008 3:30 pm

Ironically, I recently stumbled upon this already and it turns out that some of them do work. I'm playing around with them and I'm already pretty certain it's doable. I'm let u know if I get it working.
Kevweiser
 
Posts: 52
Joined: Wed Jul 09, 2008 1:44 pm

Re: Stats based off the last 100 hands.

Postby kraada » Thu Dec 18, 2008 3:34 pm

Thanks you, please, please do.
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Stats based off the last 100 hands.

Postby Kevweiser » Thu Dec 18, 2008 4:09 pm

Here we go:
sum(if[holdem_hand_player_statistics.date_played > (now() - interval '15 MINUTES'),1,0])

This will count the number of hands that have occured in the last 15 minutes. It can easily be translated over to other custom stats.
Kevweiser
 
Posts: 52
Joined: Wed Jul 09, 2008 1:44 pm

Re: Stats based off the last 100 hands.

Postby kraada » Thu Dec 18, 2008 4:28 pm

Does this actually update properly?

If you update the cache, then wait 20 minutes, do you still only have hands from the last 15 minutes?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Stats based off the last 100 hands.

Postby Kevweiser » Thu Dec 18, 2008 4:49 pm

Looks like I jumped the gun. I tried refreshing after not playing for 30 minutes and the hands were still showing. What exactly is in the cache?
Kevweiser
 
Posts: 52
Joined: Wed Jul 09, 2008 1:44 pm

Re: Stats based off the last 100 hands.

Postby kraada » Thu Dec 18, 2008 4:53 pm

When the cache update runs, it builds the data for all of the stats you've built so you can get them later a lot faster.

With that stat, if you wait 15 minutes before caching though the cache should come up empty for everybody, then if you don't update the cache the stat might function properly?
kraada
Moderator
 
Posts: 54431
Joined: Wed Mar 05, 2008 2:32 am
Location: NY

Re: Stats based off the last 100 hands.

Postby Kevweiser » Thu Dec 18, 2008 5:14 pm

Ok, this is strange. When I change the expression from '15 MINUTES' to '2 DAYS':
sum(if[holdem_hand_player_statistics.date_played > (now() - interval '2 DAYS'),1,0])

I can sit there and press the refresh button every couple of minutes and watch the number of hands decrease. I assume this is because there are more hands that are over 2 days old that are being filtered. Then I change the expression to:
sum(if[holdem_hand_player_statistics.date_played > (now() - interval '15 MINUTES'),1,0])

And I only see hands from a recent session... but it's from about an hour ago. So for some reason it does not work for minutes, but appears to be working for days. Any insight? Is the Cache only used for the HUD? I haven't tested this in the HUD yet.
Kevweiser
 
Posts: 52
Joined: Wed Jul 09, 2008 1:44 pm

Re: Stats based off the last 100 hands.

Postby Kevweiser » Thu Dec 18, 2008 5:29 pm

Ok, I think I've discovered an issue, but I'm not sure why it's happening. It appears that the dateplayed field on the hand is incorrect. I appears to be ahead by 5 hours. My theory is that the dateplayed field is being calculated by Postgre, and that maybe Postgre is offsetting because it thinks I'm in a different timezone than I am? I don't know how to check that in Postgre.
Kevweiser
 
Posts: 52
Joined: Wed Jul 09, 2008 1:44 pm

Re: Stats based off the last 100 hands.

Postby Kevweiser » Thu Dec 18, 2008 5:35 pm

Ok, now I changed the expression to:
sum(if[datefix_fromutc[ holdem_hand_player_statistics.date_played ] > (now() - interval '15 minutes'),1,0])

This seems to have fixed the 5 hour offset issue. I still need to re-cache and test in the HUD.
Kevweiser
 
Posts: 52
Joined: Wed Jul 09, 2008 1:44 pm

Re: Stats based off the last 100 hands.

Postby Kevweiser » Thu Dec 18, 2008 6:03 pm

This doesn't work in the HUD. But it does work in the tabs... I assume this has something to do with teh Cache? Is there a documentation or a thread that gives a good description of how the Cache works?
Kevweiser
 
Posts: 52
Joined: Wed Jul 09, 2008 1:44 pm

PreviousNext

Return to Custom Stats, Reports, and SQL [Read Only]

Who is online

Users browsing this forum: No registered users and 7 guests

cron
highfalutin