Skip to content

Instantly share code, notes, and snippets.

@rhelmer
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhelmer/4aa2110086c8808970bd to your computer and use it in GitHub Desktop.
Save rhelmer/4aa2110086c8808970bd to your computer and use it in GitHub Desktop.
diff --git a/l10ninsp/steps.py b/l10ninsp/steps.py
index ce2b011..c5981ce 100644
--- a/l10ninsp/steps.py
+++ b/l10ninsp/steps.py
@@ -24,6 +24,7 @@ from cStringIO import StringIO
from bb2mbdb.utils import timeHelper
import logger, util
+import elasticsearch
class ResultRemoteCommand(LoggedRemoteCommand):
"""
@@ -133,6 +134,14 @@ class ResultRemoteCommand(LoggedRemoteCommand):
if k in summary])
self.logs['stdio'].addEntry(5, json.dumps(result, indent=2))
self.addSummary(summary)
+ # TODO where to put settings?
+ ES_COMPARE_HOST = 'localhost:9200/'
+ ES_COMPARE_INDEX = 'elmo-comparisons'
+ es = elasticsearch.Elasticsearch(hosts=ES_COMPARE_HOST)
+ # TODO auto id OK here?
+ es.index(index=ES_COMPARE_INDEX, body=json.dumps(result),
+ doc_type='comparison')
+ logger.debug('remoteUpdate',
+ 'inserted into Elasticsearch')
def addStats(self, stats):
self.ensureDBRun()
@rhelmer
Copy link
Author

rhelmer commented Aug 20, 2014

can't use auto-id, needs to match the run database object

@rhelmer
Copy link
Author

rhelmer commented Aug 20, 2014

master-ball has a local.py for configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment