Your data. Anywhere you go.

New Relic for iOS or Android


Download on the App Store    Android App on Google play


New Relic Insights App for iOS


Download on the App Store


Learn more

Close icon

Current Active users/sessions as a number/count

nrql
insights

#1

I have used this nrql query

SELECT uniquecount(session) FROM PageView WHERE appName = ‘appName’ since 10 minutes ago

to get the sessions created in last 10 min but I am looking for the current Active users as a number, not as time series that I can get from pre defined metrics


Active Users as a Number
#2

Duplicate


Here is the NRQL I used to get the no of sessions from last 10 minutes.

SELECT uniquecount(session) FROM PageView WHERE appName = ‘iRePORT (PROD)’ since 10 minutes ago
this gives me the new sessions created in last 10 minutes but, I am looking for the number of active users/sessions currently.

Just as a count not as a series that I can get in Metrics.

Thanks,
Ram


#3

Hey @SaiRam! It appears you posted this questions twice. I went ahead and moved them into the same thread so we can get a targeted answer and information on this doesn’t spread out. :blush:

Hopefully someone will be along soon to help with your Insights question!


#4

The query you posted doesn’t include a timeseries statement and should be just a number.

This part needs clarification.


#5

I meant there are pre defined metrics with time series. I want just the count of active users at current.


#6

Your query returns a number. You have to decide what makes a session “active” if you don’t simply assume activity in the last 10 minutes qualifies them as “active”.


#7

how many people currently are on my site?


#8

So, you need to decide how you decide from what you see in the data you have in new relic tells you those people are “on your site”. Get what I mean?


#9

Isn’t there any query that gives the count?


#10

Actually, I am just looking for the Current users count on the site using NRQL.
I need help with the query.


#11

How do you define “current user”?

I have 30 tabs open on my browser. They have been open for 6 hours. Am I a current user on all 30?


#12

if you are on the site for 6 hours, still you are a current user and based on the uniquecount(session) I believe new relic consider 30 tabs as 1?

If I am on site for 6 hours using 3 different browsers, the current users are 3?

As long as you are on the site, you are a current user.It doesn’t matter how many hours, as long as you on the site with one session, you consider as current


#13

Ok, so you want to identify the users with uniquecount(session) from ? Browserinteraction? Ajaxrequest? Pageview? What time window? What tells you that a session started 6 hours ago ended 20 minutes ago?


#14

yes but I need a NRQL query, that just give number of current users.
as I defined the current users that how many on site regardless of time.


#15

Do you think you can get close to writing an NRQL query based on the points discussed so far?

Do you need to exclude sessions from synthetic monitors or similar?


#16

I believe so. But isn’t there any pre defined metric for that?


#17

No, there is no predefined metric for current users.


#18

Where u able to plot any query for your requirement?


#19

Hey @Tulsan.Kapil - I think @SaiRam’s original query was probably the closest we can get with out of the box attributes. Custom attributes can probably help you get that metric in a better way, however out of the box you can query on the Session count.

SELECT uniqueCount(session) FROM PageView WHERE appName = ‘appName’ since 10 minutes ago