Skip to content

Commit

Permalink
Fixing a little bug in uploaded blob reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
ktuite committed Dec 13, 2024
1 parent aa85e3f commit 76c86cf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/model/query/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ const countXmlOnlyFormDefs = () => ({ oneFirst }) => oneFirst(sql`
const countBlobFiles = () => ({ one }) => one(sql`
SELECT
COUNT(*) AS total_blobs,
COUNT(CASE WHEN "s3_status" = 'uploaded' THEN 1 END) AS uploaded_blobs
SUM(CASE WHEN "s3_status" = 'uploaded' THEN 1 ELSE 0 END) AS uploaded_blobs
FROM blobs`);

const countResetFailedToPending = () => ({ oneFirst }) => oneFirst(sql`
Expand Down Expand Up @@ -891,7 +891,7 @@ const previewMetrics = () => (({ Analytics }) => runSequentially([
metrics.system.num_xml_only_form_defs = xmlDefs;
metrics.system.uses_external_blob_store = Analytics.blobStoreExternal(config.get('default.external.s3blobStore'));
metrics.system.num_blob_files = blobFiles.total_blobs;
metrics.system.num_blob_files_on_s3 = blobFiles.total_blobs;
metrics.system.num_blob_files_on_s3 = blobFiles.uploaded_blobs;
metrics.system.num_reset_failed_to_pending_count = resetFailedToPending;

return metrics;
Expand Down

0 comments on commit 76c86cf

Please sign in to comment.