User Licensing - improvements

wayne2
Community Explorer

Hi All,

 

I am writing a PowerBI dashboard report to pick up the number of total users in our instance, and then later split that by sub-account.  I have the total number working but its so slow and takes about 30-45 min per refresh.  Wont be a problem once published as it will happen overnight, but while I am developing and testing its so painful.  I am hoping the brains trust may have some ideas on how to improve this.

So we spoke to Canvas and they essentially use the Last User Access report to guage the number of active users over the last 12 months.  I did some testing and authentication logs dont give me the right information but page views does.

So this is what I have

  • Call /api/v1/accounts/[accountid]/users
  • I then go through each user in the table and call /api/v1/users/[userid]/page_views
    • The results are sorted in descending order so I only return the first results (ie, per_page=1)
  • I then filter out the created_at field for anything over 365 days old

As I said this works, but its so slow as I am iterating through each user and I cant filter it down first as I dont have any information I can use from the users table to filter on.  If anyone can see an easier way, I would appreciate it.

Lastly I will need to then work out what sub-account they belong to.  The obvious answer is look at what course they are enrolled in.  Obviously some may be enrolled in more than 1 course.  Anyway if anyone has any advice that may save me some time before I start on that trail i would greatly appreciate it too.

Thank you 🙂

0 Likes