Skip to content

Instantly share code, notes, and snippets.

@maurodoglio
maurodoglio / observer.js
Created December 6, 2012 20:59
Mauro's observer
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<script type="text/javascript">
var Model = function(){};
Model.prototype = {
'value' : null,
@maurodoglio
maurodoglio / observer.js
Created December 7, 2012 10:30
Mauro's observer - updated to create two models
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>My js observer</title>
<script type="text/javascript">
"use strict";
var Model = function(){
this.observers = [];
this.value = null
@maurodoglio
maurodoglio / gist:6548820
Created September 13, 2013 10:07
This is the list of commands I used to read a list of files containing profiling data. It was run inside a ipython shell
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())
@maurodoglio
maurodoglio / gist:6548889
Created September 13, 2013 10:14
This is a modified version of treeherder/log_parser/tasks.py that profiles the execution of a parse_log run. It generates one profile file per task run. You can directly use it in your development environment with the process_objects periodic task running
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
@maurodoglio
maurodoglio / treeherder_socketio_client.html
Created December 20, 2013 17:11
treeherder socketio client example
<!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() {
@maurodoglio
maurodoglio / send_event.py
Created June 17, 2014 18:04
Job completed event
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
)
from celery.task.control import inspect
i = inspect()
registered = i.registered()
active_workers = registered.keys()
req = Request(method, uri, json=data, auth=auth)
prepped_request = req.prepare()
print prepped_request.url
print prepped_request.headers
print prepped_request.text
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@maurodoglio
maurodoglio / export_regression_bugs.ipynb
Created May 23, 2016 14:33
Regression bugs export notebook
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.