Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
CohenIdo committed May 22, 2024
1 parent 4864325 commit 41ebf91
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,8 @@ export const getCloudSecurityUsageRecord = async ({
}: CloudSecurityMeteringCallbackInput): Promise<UsageRecord[] | undefined> => {
try {
const searchFrom = getSearchStartDate(lastSuccessfulReport);

const foo = await indexHasDataInDateRange(esClient, cloudSecuritySolution, searchFrom);
logger.error(`is index contains data: ${foo}`);
if (!(await indexHasDataInDateRange(esClient, cloudSecuritySolution, searchFrom))) return;

const periodSeconds = Math.floor((new Date().getTime() - searchFrom.getTime()) / 1000);
Expand All @@ -266,6 +267,8 @@ export const getCloudSecurityUsageRecord = async ({
searchFrom
);

logger.error(`Assest Aggregation: ${assetCountAggregations}`);

const usageRecords = await getUsageRecords(
assetCountAggregations,
cloudSecuritySolution,
Expand All @@ -276,6 +279,8 @@ export const getCloudSecurityUsageRecord = async ({
logger
);

logger.error(`usage records: ${usageRecords}`);

return usageRecords;
} catch (err) {
logger.error(`Failed to fetch ${cloudSecuritySolution} metering data ${err}`);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ export class SecurityUsageReportingTask {
return { state: taskInstance.state, runAt: new Date() };
}

this.logger.debug(`received usage records: ${JSON.stringify(usageRecords)}`);
this.logger.error(`received usage records: ${JSON.stringify(usageRecords)}`);

let usageReportResponse: Response | undefined;

Expand Down

0 comments on commit 41ebf91

Please sign in to comment.