Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #163 from Nike-Inc/add_file_kpis
Browse files Browse the repository at this point in the history
Add KPI for total number of files stored in Cerberus
  • Loading branch information
sdford authored May 31, 2018
2 parents c49aac6 + 1c0a8e8 commit 221b4c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -97,6 +100,7 @@ public void processKpiMetrics() {
metricsService.setGaugeValue("numberOfSdbs", numSDBs);
metricsService.setGaugeValue("numberOfDataNodes", numDataNodes);
metricsService.setGaugeValue("numberOfKeyValuePairs", numKeyValuePairs);
metricsService.setGaugeValue("numberOfFiles", numFiles);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,8 @@ public Map<String, String> parseSecretMetadata(SecureData secureData) {

return secretMetadata;
}

public int getTotalNumberOfFiles() {
return secureDataDao.countByType(SecureDataType.FILE);
}
}

0 comments on commit 221b4c6

Please sign in to comment.