mirror of
				https://github.com/zulip/zulip.git
				synced 2025-11-04 05:53:43 +00:00 
			
		
		
		
	[schema] Collect data on when users are active on site.
These engagement data will be useful both for making pretty graphs of how addicted our users are as well as for allowing us to check whether a new deployment is actually using the product or not. This measures "number of minutes during which each user had checked the app within the previous 15 minutes". It should correctly not count server-initiated reloads. It's possible that we should use something less aggressive than mousemove; I'm a little torn on that because you really can check the app for new messages without doing anything active. This is somewhat tested but there are a few outstanding issues: * Mobile apps don't report these data. It should be as easy as having them send in update_active_status queries with new_user_input=true. * The semantics of this should be better documented (e.g. the management script should print out the spec above)x. (imported from commit ec8b2dc96b180e1951df00490707ae916887178e)
This commit is contained in:
		@@ -681,6 +681,11 @@ class UserActivity(models.Model):
 | 
			
		||||
    class Meta:
 | 
			
		||||
        unique_together = ("user_profile", "client", "query")
 | 
			
		||||
 | 
			
		||||
class UserActivityInterval(models.Model):
 | 
			
		||||
    user_profile = models.ForeignKey(UserProfile)
 | 
			
		||||
    start = models.DateTimeField('start time', db_index=True)
 | 
			
		||||
    end = models.DateTimeField('end time', db_index=True)
 | 
			
		||||
 | 
			
		||||
class UserPresence(models.Model):
 | 
			
		||||
    user_profile = models.ForeignKey(UserProfile)
 | 
			
		||||
    client = models.ForeignKey(Client)
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user