This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jupyter nbconvert notebook_name.ipynb --to slides --reveal-prefix https://cdnjs.cloudflare.com/ajax/libs/reveal.js/3.3.0 | |
| # Using the built in nbconvert server won't work behind a proxy. | |
| # Let's use a simple python server to do that. | |
| python -m SimpleHTTPServer |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| req = Request(method, uri, json=data, auth=auth) | |
| prepped_request = req.prepare() | |
| print prepped_request.url | |
| print prepped_request.headers | |
| print prepped_request.text |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from celery.task.control import inspect | |
| i = inspect() | |
| registered = i.registered() | |
| active_workers = registered.keys() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from django.conf import settings | |
| from treeherder.events.publisher import JobStatusPublisher | |
| p = JobStatusPublisher(settings.BROKER_URL) | |
| p.publish( | |
| 1,# job_id | |
| 1,# resultset_id | |
| 'mozilla-inbound', # repo | |
| 'completed' # status | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="http://cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js"></script> | |
| <script> | |
| // Create SocketIO instance, connect | |
| var socket = io.connect('http://local.treeherder.mozilla.org:8005/events'); | |
| // Add a connect listener | |
| socket.on('connect',function() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import simplejson as json | |
| from celery import task | |
| import time | |
| from treeherder.model.derived import JobsModel | |
| from treeherder.log_parser.artifactbuildercollection import ArtifactBuilderCollection | |
| import profile | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import pstats | |
| # in the ipython shell this returns a list | |
| # containing the output of the shell command ls | |
| # I generated many profile files, one per log parsed. | |
| # all the file names were prefixed with parse_log | |
| profiles = !ls parse_log* | |
| # read the first file in the list | |
| stats = pstats.Stats(profiles.pop()) |