diff --git a/src/main/java/com/nike/cerberus/jobs/KpiMetricsProcessingJob.java b/src/main/java/com/nike/cerberus/jobs/KpiMetricsProcessingJob.java index cd16a79a5..22a3aa066 100644 --- a/src/main/java/com/nike/cerberus/jobs/KpiMetricsProcessingJob.java +++ b/src/main/java/com/nike/cerberus/jobs/KpiMetricsProcessingJob.java @@ -80,15 +80,18 @@ public void processKpiMetrics() { int numSDBs = safeDepositBoxService.getTotalNumberOfSafeDepositBoxes(); int numDataNodes = secureDataService.getTotalNumberOfDataNodes(); int numKeyValuePairs = secureDataService.getTotalNumberOfKeyValuePairs(); + int numFiles = secureDataService.getTotalNumberOfFiles(); - log.info("Number of IAM roles: {}, Owner Groups: {}, Non-Owner Groups: {}, Total Unique Groups: {}, SDBs: {}, Nodes: {}, Key/Value Pairs: {}", + log.info("Number of IAM roles: {}, Owner Groups: {}, Non-Owner Groups: {}, Total Unique Groups: {}, SDBs: {}, " + + "Nodes: {}, Key/Value Pairs: {}, Number of Secure Files: {}", numUniqueIamRoles, numUniqueOwnerGroups, numUniqueNonOwnerGroups, totalUniqueUserGroups, numSDBs, numDataNodes, - numKeyValuePairs); + numKeyValuePairs, + numFiles); metricsService.setGaugeValue("numberOfUniqueIamRoles", numUniqueIamRoles); metricsService.setGaugeValue("numberOfUniqueOwnerGroups", numUniqueOwnerGroups); @@ -97,6 +100,7 @@ public void processKpiMetrics() { metricsService.setGaugeValue("numberOfSdbs", numSDBs); metricsService.setGaugeValue("numberOfDataNodes", numDataNodes); metricsService.setGaugeValue("numberOfKeyValuePairs", numKeyValuePairs); + metricsService.setGaugeValue("numberOfFiles", numFiles); } } diff --git a/src/main/java/com/nike/cerberus/service/SecureDataService.java b/src/main/java/com/nike/cerberus/service/SecureDataService.java index 86d63b1b8..e595c2102 100644 --- a/src/main/java/com/nike/cerberus/service/SecureDataService.java +++ b/src/main/java/com/nike/cerberus/service/SecureDataService.java @@ -440,4 +440,8 @@ public Map parseSecretMetadata(SecureData secureData) { return secretMetadata; } + + public int getTotalNumberOfFiles() { + return secureDataDao.countByType(SecureDataType.FILE); + } }