I seem to remember a discussion about how to get the count of online users for each tenant using SignalR. Can anyone point me to the correct discussion? I have searched this forum and the github pages to no avail.
6 Answer(s)
-
0
Hi @bobingham
You can use IOnlineClientManager interface and get a Tenant's online clients similar to https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp/RealTime/OnlineClientManager.cs#L118
You just need to use a similar query excluding
c.UserId == user.UserId
condition. -
0
Hi @ismcagdas, Here is my query for getting summary data for the client. If I iterate around the result how do I get the number of online clients for each tenant?
public async Task<List<GetTenantSummaryDataForHostDashboard_Output>> GetTenantSummaryData(GetHostDashboardDataInput input) { var query = await _sQLRepository.GetTenantSummaryDataForHostDashboard(input.From, input.To, input.UserId, 0); var model = ObjectMapper.Map<List<GetTenantSummaryDataForHostDashboard_Output>>(query.ToList()); return model; }
-
0
hi @bobingham
By default, the Online client is stored in memory (InMemoryOnlineClientStore). Can only be aggregated in memory.
-
0
It would be useful to be able to control the number of concurrent users per login. This request from @bobingham is what I'm looking for too. https://github.com/aspnetzero/aspnet-zero-core/issues/1414
-
0
So we have no idea of how to get the count of online uses for each tenant? Is this an impossible request or is there something we can do to facilitate?
-
0
Hi @bobingham, if you need to retrieve online user count for each tenant in the list, you will need to loop through the list and call
IOnlineClientManager.GetAllClients().Where(c => c.TenantId == eachTenantId).Count()