DevOps仪表盘Hygieia.zip

  • P6_141121
    了解作者
  • 20.2MB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-19 23:55
    上传日期
Hygieia是单一的,可配置的,易于使用的仪表盘,他可以看见接近整个传输管道的实时状态。工作方式特点:There are some excellent commercial ALM tools that allow one to visualize traceability between stories, code, tests and builds, however, they do not cross over from build to deploymentThere are some good commercial Operations tools that provide visibility into server and application run time health, metrics, analytics etc. however they do not provide visibility into the development and build activitiesOpen source tools/frameworks such as Grafana provide generic framework to build a dashboard, however, collecting data from the numerous DevOps tools is still the challenge.软件截图:Team Level Dashboard"Product" or "Program" Level Dashboard (Hygieia 2.0 feature)
Hygieia-master.zip
内容介绍
package com.capitalone.dashboard.collector; import com.capitalone.dashboard.misc.HygieiaException; import com.capitalone.dashboard.model.CollectionMode; import com.capitalone.dashboard.model.Comment; import com.capitalone.dashboard.model.Commit; import com.capitalone.dashboard.model.CommitStatus; import com.capitalone.dashboard.model.CommitType; import com.capitalone.dashboard.model.GitHubGraphQLQuery; import com.capitalone.dashboard.model.GitHubPaging; import com.capitalone.dashboard.model.GitHubParsed; import com.capitalone.dashboard.model.GitHubRateLimit; import com.capitalone.dashboard.model.GitHubRepo; import com.capitalone.dashboard.model.GitRequest; import com.capitalone.dashboard.model.MergeEvent; import com.capitalone.dashboard.model.Review; import com.capitalone.dashboard.util.Encryption; import com.capitalone.dashboard.util.EncryptionException; import com.capitalone.dashboard.util.Supplier; import org.apache.commons.codec.binary.Base64; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.math.NumberUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.joda.time.DateTime; import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.parser.JSONParser; import org.json.simple.parser.ParseException; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.http.HttpEntity; import org.springframework.http.HttpHeaders; import org.springframework.http.HttpMethod; import org.springframework.http.ResponseEntity; import org.springframework.stereotype.Component; import org.springframework.web.client.RestClientException; import org.springframework.web.client.RestOperations; import java.net.MalformedURLException; import java.nio.charset.StandardCharsets; import java.util.ArrayList; import java.util.Comparator; import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; import java.util.Objects; import java.util.regex.Pattern; import java.util.stream.Collectors; /** * GitHubClient implementation that uses SVNKit to fetch information about * Subversion repositories. */ @Component @SuppressWarnings("PMD.ExcessiveClassLength") public class DefaultGitHubClient implements GitHubClient { private static final Log LOG = LogFactory.getLog(DefaultGitHubClient.class); private final GitHubSettings settings; private final RestOperations restOperations; private List<Commit> commits; private List<GitRequest> pullRequests; private List<GitRequest> issues; private Map<String, String> ldapMap; private final List<Pattern> commitExclusionPatterns = new ArrayList<>(); private static final int FIRST_RUN_HISTORY_DEFAULT = 14; public class RedirectedStatus { private boolean isRedirected = false; private String redirectedUrl = null; RedirectedStatus() {} RedirectedStatus(boolean isRedirected, String redirectedUrl) { this.isRedirected = isRedirected; this.redirectedUrl = redirectedUrl; } String getRedirectedUrl() { return this.redirectedUrl; } boolean isRedirected() { return this.isRedirected; } } @Autowired public DefaultGitHubClient(GitHubSettings settings, Supplier<RestOperations> restOperationsSupplier) { this.settings = settings; this.restOperations = restOperationsSupplier.get(); if (!CollectionUtils.isEmpty(settings.getNotBuiltCommits())) { settings.getNotBuiltCommits().stream().map(regExStr -> Pattern.compile(regExStr, Pattern.CASE_INSENSITIVE)).forEach(commitExclusionPatterns::add); } } private int getFetchCount(boolean firstRun) { if (firstRun) return 100; return settings.getFetchCount(); } @Override public List<Commit> getCommits() { return commits; } @Override public List<GitRequest> getPulls() { return pullRequests; } @Override public List<GitRequest> getIssues() { return issues; } protected void setLdapMap(Map<String, String> ldapMap) { this.ldapMap = ldapMap; } protected Map<String, String> getLdapMap() { return ldapMap; } @Override @SuppressWarnings("PMD.ExcessiveMethodLength") public void fireGraphQL(GitHubRepo repo, boolean firstRun, Map<Long, String> existingPRMap, Map<Long, String> existingIssueMap) throws RestClientException, MalformedURLException, HygieiaException { // format URL String repoUrl = (String) repo.getOptions().get("url"); GitHubParsed gitHubParsed = new GitHubParsed(repoUrl); commits = new LinkedList<>(); pullRequests = new LinkedList<>(); issues = new LinkedList<>(); ldapMap = new HashMap<>(); long historyTimeStamp = getTimeStampMills(getRunDate(repo, firstRun, false)); String decryptedPassword = decryptString(repo.getPassword(), settings.getKey()); String personalAccessToken = (String) repo.getOptions().get("personalAccessToken"); String decryptPersonalAccessToken = decryptString(personalAccessToken, settings.getKey()); boolean alldone = false; GitHubPaging dummyPRPaging = isThereNewPRorIssue(gitHubParsed, repo, decryptedPassword, decryptPersonalAccessToken, existingPRMap, "pull", firstRun); GitHubPaging dummyIssuePaging = isThereNewPRorIssue(gitHubParsed, repo, decryptedPassword, decryptPersonalAccessToken, existingIssueMap, "issue", firstRun); GitHubPaging dummyCommitPaging = new GitHubPaging(); dummyCommitPaging.setLastPage(false); JSONObject query = buildQuery(true, firstRun, false, gitHubParsed, repo, dummyCommitPaging, dummyPRPaging, dummyIssuePaging); int loopCount = 1; while (!alldone) { LOG.debug("Executing loop " + loopCount + " for " + gitHubParsed.getOrgName() + "/" + gitHubParsed.getRepoName()); JSONObject data = getDataFromRestCallPost(gitHubParsed, repo, decryptedPassword, decryptPersonalAccessToken, query); if (data != null) { JSONObject repository = (JSONObject) data.get("repository"); GitHubPaging pullPaging = processPullRequest((JSONObject) repository.get("pullRequests"), repo, existingPRMap, historyTimeStamp); LOG.debug("--- Processed " + pullPaging.getCurrentCount() + " of total " + pullPaging.getTotalCount() + " pull requests"); GitHubPaging issuePaging = processIssues((JSONObject) repository.get("issues"), gitHubParsed, existingIssueMap, historyTimeStamp); LOG.debug("--- Processed " + issuePaging.getCurrentCount() + " of total " + issuePaging.getTotalCount() + " issues"); GitHubPaging commitPaging = processCommits((JSONObject) repository.get("ref"), repo); LOG.debug("--- Processed " + commitPaging.getCurrentCount() + " commits"); alldone = pullPaging.isLastPage() && commitPaging.isLastPage() && issuePaging.isLastPage(); query = buildQuery(false, firstRun, false, gitHubParsed, repo, commitPaging, pullPaging, issuePaging); loopCount++; } } LOG.info("-- Collected " + commits.size() + " Commits, " + pullRequests.size() + " Pull Requests, " + issues.size() + " Issues since " + getRunDate(repo, firstRun, false)); if (firstRun) { connectCommitToPulls(); return; } List<GitRequest> allMergedPrs = pullRequests.stream().filter(pr -> "merged".equalsIgnoreCase(pr.getState())).collect(Collectors.toList()); if (CollectionUtils.isEmpty(allMergedPrs)) { connectCommitToPulls(); return; }
评论
    相关推荐
    • devops-netology
      发展论 terraform目录中要引用的文件: 目录和子目录命名为.terraform * /.terraform/ 包含名称.tfstate * .tfstate .tfstate。 这些是特定的文件 crash.log .terraformrc terraform.rc ...
    • devops_l
      地址簿教程 本教程教您一些基本概念。 它是学习入门的快速阅读,而不是有关如何设计应用程序的示例。 请注意,此示例使用并要求Java 8才能运行。 从命令行运行示例 $ mvn jetty:run 打开 在IntelliJ IDEA 14中导入 ...
    • GSA_FSS19_DevOps:FSS19现代化IaC和应用代码的临时回购
      FSS-19基础设施! 推荐的IDE VS代码 代码格式化程序插件:更漂亮的
    • ping-devops:PingIdentity DevOps命令行工具
      有关更多信息,请参见。
    • DevOps-Demo
      地址簿教程 ==================== 本教程将教您一些基本概念。它是学习入门的快速阅读,而不是有关如何设计应用程序的示例。请注意,此示例使用Java 8,并且需要Java 8才能运行。 从命令行运行示例 ...
    • devops-netology
      该存储库包含“ .gitignore”,因此将适用以下规则。 隐藏在目录“ .terraform”中的所有文件和目录都将被忽略。 “ .terraform”可以位于任何文件夹中。 任何目录中所有文件扩展名为“ .tfstate”的文件都将被...
    • devops
      在这个项目(使用AWS和Kubernetes进行大规模微服务)中,我应用了在本课程中获得的技能来运行机器学习微服务API,并且在所有项目工作中都使用了AWS cloud9 IDE。 有一个经过预先训练的sklearn模型,已经过训练,可以...
    • devops-netology
      文件将被忽略:Terraform本地目录.tfstate文件崩溃日志文件crash.log tfvars文件,其中可以包含正在发送的数据,例如密码,私钥和其他机密。 覆盖文件,因为它们通常用于本地覆盖资源,因此未选中override....
    • security-devops
      在这个项目中,您将有机会通过完成一个电子商务应用程序来演示您在本课程中学习的安全性和DevOps技能。 您将从整个应用程序的模板开始,目标是采用此模板并添加适当的身份验证和授权控件,以便用户只能访问其数据,...
    • GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
      guassdb100在redhat上安装包,单机部署的包,安装步骤请看我的文中介绍,经过大量实验搭建总结出来的文档