Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New diagnose command diagnoses system (not so robust) #4136

Merged
merged 4 commits into from
Jul 27, 2015

Conversation

benjaoming
Copy link
Contributor

Example:

✗ bin/kalite diagnose

KA Lite diagnostics

Calculating diagnostics...

KA LITE VERSION:      0.14.0
PYTHON:               2.7.6 (default, Mar 22 2014, 22:59:56) 
                      [GCC 4.8.2]
PLATFORM:             Linux
                      hostname
                      3.16.0-38-generic
                      #52~14.04.1-Ubuntu SMP Fri May 8 09:43:57 UTC 2015
                      x86_64
SERVER ADDRESS:       http://192.168.40.148:8008/
SERVER ADDRESS:       http://127.0.0.1:8008/
SERVER STATUS:        OK, running
INSTALLED IN:         code/ka-lite/kalite
CONTENT ROOT:         code/ka-lite/content
CONTENT SIZE:         3.0 MB
USER DATABASE:        code/ka-lite/kalite/database/data.sqlite
ASSESSMENT DATABASE:  code/ka-lite/content/assessmentitems.sqlite
DEVICE NAME:          hostname
DEVICE UUID:          60d28ba6c1d9593b8f9c6b61d1ae7935
DEVICE REGISTERED:    True
DEVICE SYNCED:        10 times
ZONE:                 Zone for public key MIIBCgKCAQEA1o91D7UGvm8wfovNq92h6Uzxm9C5QDXRl43268

@benjaoming
Copy link
Contributor Author

Marking this a release blocker because I want the ka-lite-gtk UI to depend on it, hope that's okay.

@benjaoming
Copy link
Contributor Author

On a further note: Since 0.15 should move kalitectl, I would like to keep the function here for now. Later, if needed, we could create a utility function that outputs raw data for other views, like a web page, to utilize.

@benjaoming benjaoming mentioned this pull request Jul 22, 2015
11 tasks
@jamalex
Copy link
Member

jamalex commented Jul 22, 2015

DEVICE SYNCED: 10 times

This won't be so meaningful, since we limit the number of locally stored syncsessions to 10. Perhaps "LAST SYNCED" and "LAST SYNC RESULTS" (success, failed, etc). Perhaps it could list "RECORDS IN PURGATORY" or something, too.

ZONE: Zone for public key MIIBCgKCAQEA1o91D7UGvm8wfovNq92h6Uzxm9C5QDXRl43268

Looks like it's using the name (which in some cases could be ambiguous); Zone ID would be better (zone.id).

@@ -592,6 +605,85 @@ def status():
}


def diagnose():
"""

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@jamalex
Copy link
Member

jamalex commented Jul 22, 2015

A couple notes, then looks good to merge as a first pass. Thanks!

@benjaoming
Copy link
Contributor Author

DEVICE SYNCED: 10 times

This won't be so meaningful, since we limit the number of locally stored syncsessions to 10.

In that case, we should remove it here?

➜  ka-lite git:(info-command) ✗ ack-grep --html num_times_synced kalite
kalite/control_panel/templates/control_panel/partials/_device_table.html
35:                                {% if device.num_times_synced != None %}<a href="{% url 'device_management' zone_id=zone_id device_id=id %}">{% endif %}
38:                                {% if device.num_times_synced != None %}</a>{% endif %}
41:                                {% if device.num_times_synced != None %}
42:                                    {{ device.num_times_synced }}

@benjaoming
Copy link
Contributor Author

✗ bin/kalite diagnose

KA Lite diagnostics

Calculating diagnostics...

KA LITE VERSION:      0.14.0
PYTHON:               2.7.6 (default, Mar 22 2014, 22:59:56) 
                      [GCC 4.8.2]
PLATFORM:             Linux-3.16.0-38-generic-x86_64-with-Ubuntu-14.04-trusty
SERVER ADDRESS:       http://192.168.40.148:8008/
SERVER ADDRESS:       http://127.0.0.1:8008/
SERVER STATUS:        OK, running
INSTALLED IN:         code/ka-lite/kalite
CONTENT ROOT:         code/ka-lite/content
CONTENT SIZE:         3.0 MB
USER DATABASE:        code/ka-lite/kalite/database/data.sqlite
ASSESSMENT DATABASE:  code/ka-lite/content/assessmentitems.sqlite
DEVICE NAME:          hostname
DEVICE ID:            60d28ba6c1d9593b8f9c6b61d1ae7935
DEVICE REGISTERED:    True
SYNCED:               2015-07-21 02:19:05.435716
SYNC RESULT:          OK
ZONE ID:              756ae3bfefe4439fa6602a983607f40a

@jamalex
Copy link
Member

jamalex commented Jul 22, 2015

In that case, we should remove it here?

Most of those are just checking whether it was synced at all, which is still useful. The "# Times Synced" column isn't so useful, but let's leave it for now -- we need to rethink those pages in general at some point, as the UX is bad.

@jamalex
Copy link
Member

jamalex commented Jul 22, 2015

USER DATABASE: code/ka-lite/kalite/database/data.sqlite

Are these absolute/relative paths? Why no leading /?

@jamalex
Copy link
Member

jamalex commented Jul 22, 2015

Beauty! Looks good to merge, if it's been testing in IS_SOURCE = False mode as well?

@benjaoming
Copy link
Contributor Author

No, but I think it might be relevant to look at it in relation to calls from another user, something like

KALITE_HOME=/home/otheruser/.kalite kalite diagnose

@benjaoming
Copy link
Contributor Author

Yes, that works, too!

➜  ~  KALITE_HOME=/var/ka-lite/.kalite kalite diagnose

KA Lite diagnostics

Calculating diagnostics...

KA LITE VERSION:      0.14.0
PYTHON:               2.7.6 (default, Mar 22 2014, 22:59:56) 
                      [GCC 4.8.2]
PLATFORM:             Linux-3.16.0-38-generic-x86_64-with-Ubuntu-14.04-trusty
SERVER ADDRESS:       http://127.0.0.1:8008/
SERVER STATUS:        OK, running
INSTALLED IN:         /home/benjamin/.virtualenvs/kalite_pip/local/lib/python2.7/site-packages/ka_lite-0.14.0-py2.7.egg/kalite
CONTENT ROOT:         /var/ka-lite/.kalite/content
CONTENT SIZE:         0 bytes
USER DATABASE:        /var/ka-lite/.kalite/database/data.sqlite
ASSESSMENT DATABASE:  /var/ka-lite/.kalite/content/assessmentitems.sqlite
DEVICE NAME:          hostname
DEVICE ID:            5eaa4d250e4654938b5986f1840ed48e
DEVICE REGISTERED:    False
SYNCED:               Never
SYNC RESULT:          -
ZONE ID:              Unset

@benjaoming
Copy link
Contributor Author

Merging this because it's harmless and we can do improvements in new issues.

benjaoming added a commit that referenced this pull request Jul 27, 2015
New diagnose command diagnoses system (not so robust)
@benjaoming benjaoming merged commit c18831a into learningequality:0.14.x Jul 27, 2015
@benjaoming benjaoming removed the has PR label Jul 27, 2015
@benjaoming benjaoming deleted the info-command branch August 19, 2015 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants