简体   繁体   中英

Total number of live sessions on GAE

Is there a way to count total number of active sessions (eg in 10 minutes) on Google App Engine (Python)?

I want to show something on frontpage like, This site currently haz 200 people online

Considering the distributed nature of GAE, I don't think you can do this directly.

You can store visits in the database (with timestamp) and query this (use a cookie to check if a user is already counted, avoid writing on each request!).

Alternatively, you can use some external service that uses included javascript or image that counts this for you, much like how analytics works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM