开发者

Total number of live sessions on GAE

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

I want to show something on frontpa开发者_JAVA百科ge 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜