stop writing database rows that are eating up a bunch of disk.

master
Chris Veilleux 2022-11-23 16:37:42 -06:00
parent 625a9fd9d3
commit e10ac91cde
2 changed files with 9 additions and 4 deletions

View File

@ -36,5 +36,6 @@ class DeviceMetricsEndpoint(PublicEndpoint):
core_metric = CoreMetric(
device_id=self.device_id, metric_type=metric, metric_value=self.request.json
)
core_metrics_repo = CoreMetricRepository(self.db)
core_metrics_repo.add(core_metric)
# Writing metrics from devices is being deactivated to enable
# core_metrics_repo = CoreMetricRepository(self.db)
# core_metrics_repo.add(core_metric)

View File

@ -97,8 +97,12 @@ def add_api_metric(http_status):
http_status=int(http_status),
url=global_context.url,
)
metric_repository = ApiMetricsRepository(global_context.db)
metric_repository.add(api_metric)
# Writing the API metrics to the database is disabled here to facilitate
# reducing the size of the production database. Uncomment the below to
# reactivate.
#
# metric_repository = ApiMetricsRepository(global_context.db)
# metric_repository.add(api_metric)
def update_device_last_contact():