Skip to content

Commit

Permalink
save hourly ml predictions separately
Browse files Browse the repository at this point in the history
  • Loading branch information
slasher125 committed May 13, 2022
1 parent b704f1b commit 0b2db38
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/handlers/triggerEnrichment.js
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,14 @@ const main = async () => {
const key = 'enriched/dataEnriched.json';
dataEnriched = dataEnriched.sort((a, b) => b.tvlUsd - a.tvlUsd);
await writeToS3(bucket, key, dataEnriched);

// also save to other "folder" where we keep track of hourly predictions (this will be used
// for ML dashboard performance monitoring)
const timestamp = new Date(
Math.floor(Date.now() / 1000 / 60 / 60) * 60 * 60 * 1000
).toISOString();
const keyPredictions = `predictions-hourly/dataEnriched_${timestamp}.json`;
await writeToS3(bucket, keyPredictions, dataEnriched);
};

////// helper functions
Expand Down

0 comments on commit 0b2db38

Please sign in to comment.