HUE-9194 [useradmin] Get active users per instance

Review Request #14860 — Created March 11, 2020 and submitted

yingc
hue
master
HUE-9194
johan, ranade, romain, weixia
commit bd5f803241f56e021adc5eb107edf22efdab1b38 (HEAD -> active_users)
Author: Romain <romain.rigaux@gmail.com>
Date:   Thu Mar 12 12:26:58 2020 -0700

    HUE-9194 [useradmin] Set active_users_per_instance callback correctly

:100644 100644 c10cd5f545... a4ec73faa2... M    apps/useradmin/src/useradmin/metrics.py
:100644 100644 0e0b3c3f18... 135a141784... M    apps/useradmin/src/useradmin/tests.py
:100644 100644 5f3b745ae6... 7f7abb91db... M    desktop/core/src/desktop/lib/metrics/views.py

commit d9435dcab2922c848dc73725d263ad505761e90c
Author: Ying Chen <yingchen@cloudera.com>
Date:   Wed Mar 11 00:55:55 2020 -0700

    HUE-9194 [useradmin] Get active users per instance

:100644 100644 eadcc265e5... c10cd5f545... M    apps/useradmin/src/useradmin/metrics.py
:100644 100644 6c14ca3401... 9f1a21ac72... M    apps/useradmin/src/useradmin/middleware.py
:000000 100644 0000000000... 278ac96477... A    apps/useradmin/src/useradmin/migrations/0004_userprofile_hostname.py
:100644 100644 f50ab485e4... 24436ee039... M    apps/useradmin/src/useradmin/models.py
:100644 100644 4889e0ed09... 0e0b3c3f18... M    apps/useradmin/src/useradmin/tests.py
:100644 100644 fe8f652454... 5f3b745ae6... M    desktop/core/src/desktop/lib/metrics/views.py


  • 0
  • 0
  • 8
  • 0
  • 8
Description From Last Updated
yingc
yingc
romain
  1. Nice stuff! Mostly nits comments

  2. apps/useradmin/src/useradmin/metrics.py (Diff revision 1)
     
     

    Use get_localhost_name() util?

  3. apps/useradmin/src/useradmin/metrics.py (Diff revision 1)
     
     

    ... per instance'

  4. apps/useradmin/src/useradmin/metrics.py (Diff revision 1)
     
     

    And if one day we can truly load balance between Hue instances (e.g. with Task Server) we could revert to need only active_users() so this is good.

  5. apps/useradmin/src/useradmin/models.py (Diff revision 1)
     
     

    Each time a model is changed, we need to add DB migrations:

    ./build/env/bin/hue makemigrations useradmin

    and git add them

  6. apps/useradmin/src/useradmin/tests.py (Diff revision 1)
     
     

    Nice one!

    Was wondering too: should be add one to check that the metrics appears in https://github.com/cloudera/hue/blob/master/desktop/core/src/desktop/lib/metrics/views.py ?

    1. Seems patch with socket.getfqdn doesn't help when calling c.get('/desktop/metrics/', dict(format='json')). The metrics seems got increased, is it a way to reset and force update to call active_users_per_instance?

  7. 
      
yingc
romain
  1. 
      
  2. Nit:

    request.GET.get("format", "")

    -->

    request.GET.get("format")

  3. 
      
yingc
yingc
romain
yingc
yingc
Review request changed

Status: Closed (submitted)

Loading...