This repository has been archived by the owner on Nov 22, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It makes pulse_actions a bit easier to comprehend by removing a lot of boiler plate. It also gives the ability of replaying messages.
- Loading branch information
Showing
17 changed files
with
4,347 additions
and
350 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
*.pyc | ||
*.egg-info/* | ||
*.swp | ||
*.txt | ||
# Packages | ||
dist | ||
.idea/ | ||
venv/ | ||
.tox/ | ||
.cache/ | ||
.coverage | ||
requirements.txt |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
worker1: python pulse_actions/worker.py --topic-base backfilling --dry-run | ||
worker2: python pulse_actions/worker.py --topic-base resultset_actions,manual_backfill,runnable --debug | ||
worker2: python pulse_actions/worker.py --config-file configs/production_config.json --dry-run False |
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"applabel": "['resultset_actions', 'manual_backfill', 'runnable']", | ||
"durable": "true", | ||
"sources": { | ||
"resultset_actions": { | ||
"exchange": "exchange/treeherder/v1/resultset-actions", | ||
"topic": "#.#" | ||
}, | ||
"manual_backfill": { | ||
"exchange": "exchange/treeherder/v1/job-actions", | ||
"topic": "buildbot.#.backfill" | ||
}, | ||
"runnable": { | ||
"exchange": "exchange/treeherder/v1/resultset-runnable-job-actions", | ||
"topic": "#" | ||
} | ||
} | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{u'project': u'try', u'buildernames': [u'Android 4.3 armv7 API 15+ try opt test crashtest-1', u'Android 4.3 armv7 API 15+ try opt test crashtest-2', u'Android 4.3 armv7 API 15+ try debug test crashtest-1', u'Android 4.3 armv7 API 15+ try debug test crashtest-2', u'Android 4.3 armv7 API 15+ try debug test crashtest-3', u'Android 4.3 armv7 API 15+ try debug test crashtest-4'], u'version': 1, u'requester': u'cmanchester@mozilla.com', u'resultset_id': u'87913'} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import logging | ||
|
||
LOG = None | ||
|
||
|
||
def setup_logging(logging_level): | ||
global LOG | ||
if LOG: | ||
return LOG | ||
# Let's use the root logger | ||
LOG = logging.getLogger() | ||
LOG.setLevel(logging.DEBUG) | ||
|
||
format = '%(asctime)s %(name)s\t %(levelname)s:\t %(message)s' | ||
formatter = logging.Formatter(format, datefmt='%H:%M:%S') | ||
# Handler 1 - Store all INFO messages in a specific file | ||
# This logging.txt file will *only* show messages for that same day as Heroku | ||
# dynos restart every day - Use papertrail for more details. | ||
fh = logging.FileHandler('logging.txt') | ||
fh.setLevel(logging.INFO) | ||
fh.setFormatter(formatter) | ||
LOG.addHandler(fh) | ||
|
||
# Handler 2 - Store all DEBUG messages in a specific file | ||
fh = logging.FileHandler('logging_debug.txt') | ||
fh.setLevel(logging.DEBUG) | ||
fh.setFormatter(formatter) | ||
LOG.addHandler(fh) | ||
|
||
# Handler 3 - Output to console (this is the output for Papertrail) | ||
console = logging.StreamHandler() | ||
console.setLevel(logging_level) | ||
formatter = logging.Formatter('%(name)s\t %(levelname)s:\t %(message)s') | ||
console.setFormatter(formatter) | ||
LOG.addHandler(console) | ||
|
||
LOG.info("Console output logs %s level messages." % logging.getLevelName(logging_level)) | ||
|
||
# Reduce logging for other noisy modules | ||
logging.getLogger("requests").setLevel(logging.WARNING) | ||
logging.getLogger("amqp").setLevel(logging.WARNING) |
Oops, something went wrong.