Skip to content

Commit

Permalink
address review
Browse files Browse the repository at this point in the history
  • Loading branch information
relud committed Nov 20, 2024
1 parent c7457c8 commit fe18969
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 8 deletions.
3 changes: 3 additions & 0 deletions bin/setup_services.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@

set -euo pipefail

# wait for dev services to start up
./bin/waitfor_services.sh

# Drop and re-create the breakpad database with tables, stored procedures,
# types, indexes, and keys; also bulk-loads static data for some lookup tables
/app/bin/setup_postgres.sh
Expand Down
8 changes: 1 addition & 7 deletions bin/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,7 @@ PYTHON="$(which python)"

echo ">>> wait for services to be ready"

waitfor --verbose --conn-only "${DATABASE_URL}"
waitfor --verbose "${LEGACY_ELASTICSEARCH_URL}"
waitfor --verbose "http://${PUBSUB_EMULATOR_HOST}"
waitfor --verbose "${STORAGE_EMULATOR_HOST}/storage/v1/b"
waitfor --verbose --codes={200,404} "${SENTRY_DSN}"
# wait for this last because it's slow to start
waitfor --verbose --timeout=30 "${ELASTICSEARCH_URL}"
./bin/waitfor_services.sh

echo ">>> build queue things and db things"

Expand Down
21 changes: 21 additions & 0 deletions bin/waitfor_services.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

# Usage: bin/waitfor_services.sh
#
# Waits for dev services to start up.
#
# Note: This should be called from inside a container.

set -euo pipefail

waitfor --verbose --conn-only "${DATABASE_URL}"
waitfor --verbose "${LEGACY_ELASTICSEARCH_URL}"
waitfor --verbose "http://${PUBSUB_EMULATOR_HOST}"
waitfor --verbose "${STORAGE_EMULATOR_HOST}/storage/v1/b"
waitfor --verbose --codes={200,404} "${SENTRY_DSN}"
# wait for this last because it's slow to start
waitfor --verbose --timeout=30 "${ELASTICSEARCH_URL}"
2 changes: 1 addition & 1 deletion socorro/external/es/supersearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def _format(aggregation):
return aggregation

for i, bucket in enumerate(aggregation["buckets"]):
if bucket["key"] in (True, False):
if isinstance(bucket["key"], bool):
# Restore es 1.4 format for boolean terms as string
term = "T" if bucket["key"] else "F"
elif "key_as_string" in bucket:
Expand Down
24 changes: 24 additions & 0 deletions socorro/statsd_metrics.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,30 @@ socorro.processor.es.save_processed_crash:
description: |
Timer for how long it takes to save the processed crash to Elasticsearch.
socorro.processor.legacy_es.crash_document_size:
type: "histogram"
description: |
Size of crash document. In bytes.
socorro.processor.legacy_es.index:
type: "histogram"
description: |
Total time it took to index the crash document in Elasticsearch.
socorro.processor.legacy_es.indexerror:
type: "incr"
description: |
Counter for errors when indexing a document in Elasticsearch.
Tags:
* ``error``: the error code indicating what happened
socorro.processor.legacy_es.save_processed_crash:
type: "timing"
description: |
Timer for how long it takes to save the processed crash to Elasticsearch.
socorro.processor.ingestion_timing:
type: "timing"
description: |
Expand Down

0 comments on commit fe18969

Please sign in to comment.