Skip to content

Commit

Permalink
Merge branch 'docker-optimize' of github.com:hacktobeer/turbinia into…
Browse files Browse the repository at this point in the history
… docker-optimize
  • Loading branch information
hacktobeer committed Aug 1, 2023
2 parents 3b310c5 + 758cb5c commit 1d5a24a
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 18 deletions.
4 changes: 2 additions & 2 deletions turbinia/processors/google_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from six.moves import urllib

from libcloudforensics.providers.gcp.internal import project as gcp_project
from prometheus_client import Gauge
from prometheus_client import Counter
from turbinia import config
from turbinia import TurbiniaException

Expand All @@ -35,7 +35,7 @@
ATTACH_SLEEP_TIME = 3
DETACH_SLEEP_TIME = 5

turbinia_nonexisting_disk_path = Gauge(
turbinia_nonexisting_disk_path = Counter(
'turbinia_nonexisting_disk_path',
'Total number of non existing disk paths after attempts to attach')

Expand Down
4 changes: 2 additions & 2 deletions turbinia/processors/mount_local.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
import filelock
import re

from prometheus_client import Gauge
from prometheus_client import Counter
from turbinia import config
from turbinia import TurbiniaException

log = logging.getLogger('turbinia')

RETRY_MAX = 10

turbinia_failed_loop_device_detach = Gauge(
turbinia_failed_loop_device_detach = Counter(
'turbinia_failed_loop_device_detach',
'Total number of loop devices failed to detach')

Expand Down
17 changes: 9 additions & 8 deletions turbinia/task_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from datetime import datetime
import time

from prometheus_client import Gauge
from prometheus_client import Counter

import turbinia
from turbinia import workers
Expand Down Expand Up @@ -60,20 +60,21 @@
SERVER_TASK_TIMEOUT_BUFFER = 86400

# Define metrics
turbinia_server_tasks_total = Gauge(
turbinia_server_tasks_total = Counter(
'turbinia_server_tasks_total', 'Turbinia Server Total Tasks')
turbinia_server_tasks_completed_total = Gauge(
turbinia_server_tasks_completed_total = Counter(
'turbinia_server_tasks_completed_total',
'Total number of completed server tasks')
turbinia_jobs_total = Gauge('turbinia_jobs_total', 'Total number jobs created')
turbinia_jobs_completed_total = Gauge(
turbinia_jobs_total = Counter(
'turbinia_jobs_total', 'Total number jobs created')
turbinia_jobs_completed_total = Counter(
'turbinia_jobs_completed_total', 'Total number jobs resolved')
turbinia_server_request_total = Gauge(
turbinia_server_request_total = Counter(
'turbinia_server_request_total', 'Total number of requests received.')
turbinia_server_task_timeout_total = Gauge(
turbinia_server_task_timeout_total = Counter(
'turbinia_server_task_timeout_total',
'Total number of Tasks that have timed out on the Server.')
turbinia_result_success_invalid = Gauge(
turbinia_result_success_invalid = Counter(
'turbinia_result_success_invalid',
'The result returned from the Task had an invalid success status of None')

Expand Down
1 change: 1 addition & 0 deletions turbinia/tcelery.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def setup(self):
self.app = celery.Celery(
'turbinia', broker=config.CELERY_BROKER, backend=config.CELERY_BACKEND)
self.app.conf.update(
broker_connection_retry_on_startup=True,
task_default_queue=config.INSTANCE_ID,
accept_content=['json'],
task_acks_late=True,
Expand Down
12 changes: 6 additions & 6 deletions turbinia/workers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
import uuid
import filelock

from prometheus_client import CollectorRegistry, Gauge, Histogram
from prometheus_client import CollectorRegistry, Counter, Histogram
from turbinia import __version__, config
from turbinia.config import DATETIME_FORMAT
from turbinia.evidence import evidence_decode
Expand All @@ -56,19 +56,19 @@
log = logging.getLogger('turbinia')

registry = CollectorRegistry()
turbinia_worker_tasks_started_total = Gauge(
turbinia_worker_tasks_started_total = Counter(
'turbinia_worker_tasks_started_total',
'Total number of started worker tasks', registry=registry)
turbinia_worker_tasks_completed_total = Gauge(
turbinia_worker_tasks_completed_total = Counter(
'turbinia_worker_tasks_completed_total',
'Total number of completed worker tasks', registry=registry)
turbinia_worker_tasks_queued_total = Gauge(
turbinia_worker_tasks_queued_total = Counter(
'turbinia_worker_tasks_queued_total', 'Total number of queued worker tasks',
registry=registry)
turbinia_worker_tasks_failed_total = Gauge(
turbinia_worker_tasks_failed_total = Counter(
'turbinia_worker_tasks_failed_total', 'Total number of failed worker tasks',
registry=registry)
turbinia_worker_tasks_timeout_total = Gauge(
turbinia_worker_tasks_timeout_total = Counter(
'turbinia_worker_tasks_timeout_total',
'Total number of worker tasks timed out.', registry=registry)

Expand Down

0 comments on commit 1d5a24a

Please sign in to comment.