Skip to content

Commit cae5a5c

Browse files
1 parent 0182e8f commit cae5a5c

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

tools/spectral/ipa/metrics/metricS3Upload.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,15 @@ import { getS3Client, getS3FilePath } from './utils/dataDumpUtils.js';
1010
* @param filePath file path to the metrics collection results, uses config.js by default
1111
*/
1212
export async function uploadMetricCollectionDataToS3(filePath = config.defaultMetricCollectionResultsFilePath) {
13+
console.log('Creating S3 Client...');
1314
const client = getS3Client();
1415
const formattedDate = new Date().toISOString().split('T')[0];
16+
17+
console.log('Loading metrics collection data from', filePath);
1518
const metricsCollectionData = JSON.parse(fs.readFileSync(filePath, 'utf8'));
1619
const table = tableFromJSON(metricsCollectionData);
1720

21+
console.log('Getting S3 file path...');
1822
const s3fileProps = getS3FilePath();
1923
const command = new PutObjectCommand({
2024
Bucket: s3fileProps.bucketName,
@@ -23,6 +27,7 @@ export async function uploadMetricCollectionDataToS3(filePath = config.defaultMe
2327
});
2428

2529
try {
30+
console.log('Dumping data to S3...');
2631
const response = await client.send(command);
2732
console.log(response);
2833
} catch (caught) {

tools/spectral/ipa/metrics/utils/dataDumpUtils.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import dotenv from 'dotenv';
33
import { S3Client } from '@aws-sdk/client-s3';
44

55
function loadS3Config() {
6+
console.log('Loading S3 config...');
7+
68
if (existsSync('.env') && !process.env.S3_BUCKET_PREFIX) {
79
dotenv.config();
810
}

0 commit comments

Comments
 (0)