1.登录数据库
[root@node1 ~]# mongo localhost:27017 > show dbs; admin 0.000GB dashboarddb 0.001GB local 0.000GB > use dashboarddb switched to db dashboarddb > show tables; collectors builds_summary events reviews feature historic_user_metrics builds dashboards user-metrics commits
2.数据表信息
builds_summary表
> db.builds_summary.find() { "_id" : ObjectId("5bfa8b5ba7b11b0006631220"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "all-ok", "repoName" : "all-ok", "statusMap" : { "Success" : NumberLong(2) }, "totalBuilds" : NumberLong(2), "totalDuration" : 0 } { "_id" : ObjectId("5bfa8b5ca7b11b0006631221"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "dynamic", "repoName" : "dynamic", "statusMap" : { "Success" : NumberLong(2) }, "totalBuilds" : NumberLong(2), "totalDuration" : 0 } { "_id" : ObjectId("5bfa8b5ca7b11b0006631222"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "failed-integration", "repoName" : "failed-integration", "statusMap" : { "Success" : NumberLong(1), "Failure" : NumberLong(1) }, "totalBuilds" : NumberLong(2), "totalDuration" : 0 } { "_id" : ObjectId("5bfa8b5ca7b11b0006631223"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "failed-master", "repoName" : "failed-master", "statusMap" : { "Failure" : NumberLong(1), "Success" : NumberLong(1) }, "totalBuilds" : NumberLong(2), "totalDuration" : 0 } { "_id" : ObjectId("5bfa8b5ca7b11b0006631224"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "MirrorGate", "repoName" : "mirrorgate-jenkins-plugin", "statusMap" : { "Success" : NumberLong(3), "Failure" : NumberLong(1) }, "totalBuilds" : NumberLong(4), "totalDuration" : 40320440 } { "_id" : ObjectId("5bfa8b5ca7b11b0006631225"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "MirrorGate", "repoName" : "mirrorgate-app", "statusMap" : { "Success" : NumberLong(6), "Failure" : NumberLong(2), "Unstable" : NumberLong(1) }, "totalBuilds" : NumberLong(9), "totalDuration" : 32388820 } { "_id" : ObjectId("5bfa8b5ca7b11b0006631226"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "MirrorGate", "repoName" : "jira-collector", "statusMap" : { "Success" : NumberLong(1) }, "totalBuilds" : NumberLong(1), "totalDuration" : 23452230 } { "_id" : ObjectId("5bfa8b5ca7b11b0006631227"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "MirrorGate", "repoName" : "design", "statusMap" : { "Success" : NumberLong(1) }, "totalBuilds" : NumberLong(1), "totalDuration" : 23452340 } { "_id" : ObjectId("5bfa8b5ca7b11b0006631228"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "no-master", "repoName" : "no-master", "statusMap" : { "Failure" : NumberLong(1), "Success" : NumberLong(1) }, "totalBuilds" : NumberLong(2), "totalDuration" : 0 } { "_id" : ObjectId("5bfa8b5ca7b11b0006631229"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "only-branch", "repoName" : "only-branch", "statusMap" : { "Failure" : NumberLong(1) }, "totalBuilds" : NumberLong(1), "totalDuration" : 0 } { "_id" : ObjectId("5bfa8b5ca7b11b000663122a"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "two-and-one-failed-master", "repoName" : "failed", "statusMap" : { "Failure" : NumberLong(1) }, "totalBuilds" : NumberLong(1), "totalDuration" : 0 } { "_id" : ObjectId("5bfa8b5ca7b11b000663122b"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.BuildSummary", "timestamp" : NumberLong("1543104000000"), "projectName" : "two-and-one-failed-master", "repoName" : "ok", "statusMap" : { "Success" : NumberLong(1) }, "totalBuilds" : NumberLong(1), "totalDuration" : 0 }
events表
> db.events.find() { "_id" : ObjectId("5bfa8da0a7b11b000663122d"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.Event", "timestamp" : NumberLong("1543146912780"), "eventTypeCollectionId" : ObjectId("5bfa8d5aa7b11b000663122c"), "eventType" : "DETAIL" } { "_id" : ObjectId("5bfa8f47a7b11b000663122e"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.Event", "timestamp" : NumberLong("1543147335073"), "eventTypeCollectionId" : ObjectId("5bfa8d5aa7b11b000663122c"), "eventType" : "DETAIL" }
reviews表
> db.reviews.find() { "_id" : ObjectId("5bfa8b31645898022b01e92f"), "appname" : "moods", "starrating" : 3.5, "platform" : "Android", "amount" : 20 } { "_id" : ObjectId("5bfa8b31645898022b01e930"), "appname" : "moods", "starrating" : 4.3, "platform" : "IOS", "amount" : 10 } { "_id" : ObjectId("5bfa8b31645898022b01e931"), "timestamp" : 1542282289193, "appname" : "moods", "authorName" : "Kike", "starrating" : 3, "comment" : "Pufff!", "platform" : "IOS" } { "_id" : ObjectId("5bfa8b31645898022b01e932"), "timestamp" : 1542714289193, "appname" : "moods", "authorName" : "Kike", "starrating" : 4, "comment" : "It's now beter!", "platform" : "IOS" } { "_id" : ObjectId("5bfa8b31645898022b01e933"), "timestamp" : 1542282289193, "appname" : "moods", "authorName" : "Kike", "starrating" : 5, "comment" : "Awesome!", "platform" : "Android" } { "_id" : ObjectId("5bfa8b31645898022b01e934"), "timestamp" : 1541418289193, "appname" : "moods", "authorName" : "Ana", "starrating" : 4, "comment" : "Buen diseño", "platform" : "Android", "amount" : 1 } { "_id" : ObjectId("5bfa8b31645898022b01e935"), "timestamp" : 1542887089193, "appname" : "moods", "authorName" : "Ana", "starrating" : 4, "comment" : "Buen diseño", "platform" : "Android" } { "_id" : ObjectId("5bfa8b31645898022b01e936"), "timestamp" : 1539690289193, "appname" : "moods", "authorName" : "kike", "starrating" : 4, "comment" : "Consume mucho", "platform" : "Android" }
feature表
> db.feature.find() { "_id" : ObjectId("5bfa8b31645898022b01e807"), "sId" : "430210", "sNumber" : "DOST05-47", "sName" : "[ISW] Build failure rate", "sTypeName" : "Story", "sStatus" : "Backlog", "dEstimate" : 3, "sSprintID" : "1225", "sSprintName" : "MIRRORGATE_SP4", "sSprintAssetState" : "ACTIVE", "sprintBeginDate" : ISODate("2018-11-18T11:44:49.083Z"), "sprintEndDate" : ISODate("2018-12-06T11:44:49.083Z"), "sProjectId" : null, "sProjectName" : "MirrorGate", "collectorId" : "mirrorgate-collectors-jira", "keywords" : [ "MirrorGate" ] } { "_id" : ObjectId("5bfa8b31645898022b01e808"), "sId" : "46093", "sNumber" : "DOST05-90", "sName" : "SPIKE: Analyze the cost of migrating", "sTypeName" : "Story", "sStatus" : "Backlog", "dEstimate" : 3, "sSprintID" : "1225", "sSprintName" : "MIRRORGATE_SP4", "sSprintAssetState" : "ACTIVE", "sprintBeginDate" : ISODate("2018-11-18T11:44:49.083Z"), "sprintEndDate" : ISODate("2018-12-06T11:44:49.083Z"), "sProjectId" : null, "sProjectName" : "MirrorGate", "collectorId" : "mirrorgate-collectors-jira", "keywords" : [ "MirrorGate" ] } { "_id" : ObjectId("5bfa8b31645898022b01e809"), "sId" : "46095", "sNumber" : "DOST05-92", "sName" : "Login", "sTypeName" : "Story", "sStatus" : "Backlog", "dEstimate" : 8, "sSprintID" : "1225", "sSprintName" : "MIRRORGATE_SP4", "sSprintAssetState" : "ACTIVE", "sprintBeginDate" : ISODate("2018-11-18T11:44:49.083Z"), "sprintEndDate" : ISODate("2018-12-06T11:44:49.083Z"), "sProjectId" : null, "sProjectName" : "MirrorGate", "collectorId" : "mirrorgate-collectors-jira", "keywords" : [ "MirrorGate" ] } { "_id" : ObjectId("5bfa8b31645898022b01e80a"), "sId" : "46094", "sNumber" : "DOST05-91", "sName" : "Distribute application", "sTypeName" : "Story", "sStatus" : "Backlog", "dEstimate" : 5, "sSprintID" : "1225", "sSprintName" : "MIRRORGATE_SP4", "sSprintAssetState" : "ACTIVE", "sprintBeginDate" : ISODate("2018-11-18T11:44:49.083Z"), "sprintEndDate" : ISODate("2018-12-06T11:44:49.083Z"), "sProjectId" : null, "sProjectName" : "MirrorGate", "collectorId" : "mirrorgate-collectors-jira", "keywords" : [ "MirrorGate" ] }
builds表
> db.builds.find() { "_id" : ObjectId("5bfa8b31645898022b01e908"), "timestamp" : 1543139089149, "number" : null, "buildUrl" : "http://fake.url", "startTime" : 0, "endTime" : 0, "duration" : 0, "buildStatus" : "Success", "startedBy" : null, "projectName" : "all-ok", "repoName" : "all-ok", "branch" : "master", "keywords" : [ "http://fake.url", "all-ok", "all-ok" ] } { "_id" : ObjectId("5bfa8b31645898022b01e909"), "timestamp" : 1543139089149, "number" : null, "buildUrl" : "http://fake.url", "startTime" : 0, "endTime" : 0, "duration" : 0, "buildStatus" : "Success", "startedBy" : null, "projectName" : "all-ok", "repoName" : "all-ok", "branch" : "develop", "keywords" : [ "http://fake.url", "all-ok", "all-ok" ] } { "_id" : ObjectId("5bfa8b31645898022b01e90b"), "timestamp" : 1543139089161, "number" : null, "buildUrl" : "http://fake.url", "startTime" : 0, "endTime" : 0, "duration" : 0, "buildStatus" : "Success", "startedBy" : null, "projectName" : "dynamic", "repoName" : "dynamic", "branch" : "master", "keywords" : [ "http://fake.url", "dynamic", "dynamic" ] } { "_id" : ObjectId("5bfa8b31645898022b01e90c"), "timestamp" : 1543139089161, "number" : null, "buildUrl" : "http://fake.url", "startTime" : 0, "endTime" : 0, "duration" : 0, "buildStatus" : "Success", "startedBy" : null, "projectName" : "dynamic", "repoName" : "dynamic", "branch" : "develop", "keywords" : [ "http://fake.url", "dynamic", "dynamic" ] } { "_id" : ObjectId("5bfa8b31645898022b01e90e"), "timestamp" : "aaa", "number" : null, "buildUrl" : "http://fake.url", "startTime" : 0, "endTime" : 0, "duration" : 0, "buildStatus" : "Success", "startedBy" : null, "projectName" : "errored", "repoName" : "errored", "branch" : "master", "keywords" : [ "http://fake.url", "errored", "errored" ] } { "_id" : ObjectId("5bfa8b31645898022b01e910"), "timestamp" : 1543139089166, "number" : null, "buildUrl" : "http://fake.url", "startTime" : 0, "endTime" : 0, "duration" : 0, "buildStatus" : "Success", "startedBy" : null, "projectName" : "failed-integration", "repoName" : "failed-integration", "branch" : "master", "keywords" : [ "http://fake.url", "failed-integration", "failed-integration" ] }
dashboards表
> db.dashboards.find() { "_id" : ObjectId("5bfa8b31645898022b01e7ff"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.Dashboard", "name" : "mirrorgate", "logoUrl" : "/mirrorgate/img/logo.png", "type" : "Custom", "columns" : [ [ "bugs", "current-sprint", "next-sprint" ], [ "scm-metrics", "builds", "buildsstats" ], [ "program-increment" ], [ "markets", "reviews", "user-metrics", "operations" ] ], "codeRepos" : [ "mirrorgate-app", "MirrorGate", "jira-collector", "design" ], "applications" : [ ], "analyticViews" : [ "1234123" ], "boards" : [ "MirrorGate" ], "lastTimeUsed" : NumberLong("1543147032285"), "programIncrement" : "MG[0-9]{2}", "skin" : "classic", "marketsStatsDays" : 7, "gitRepos" : [ "ssh://git@fake.com:fake/repo1.git" ] } { "_id" : ObjectId("5bfa8b31645898022b01e800"), "_class" : "com.bbva.arq.devops.ae.mirrorgate.model.Dashboard", "name" : "all-the-stuff", "displayName" : "All the indicators", "logoUrl" : "/mirrorgate/img/logo.png", "columns" : [ [ "scm-metrics", "current-sprint", "bugs" ], [ "program-increment", "next-sprint" ], [ "builds", "buildsstats" ], [ "markets", "reviews", "user-metrics", "operations-metrics" ], [ "alerts" ] ], "codeRepos" : [ "mirrorgate-app", "MirrorGate", "jira-collector", "design" ], "applications" : [ "moods" ], "analyticViews" : [ "1234123" ], "boards" : [ "MirrorGate" ], "slackTeam" : "All", "lastTimeUsed" : NumberLong("1543147249260"), "programIncrement" : "MG02", "urlAlerts" : "alerts", "skin" : "classic", "marketsStatsDays" : 7 } { "_id" : ObjectId("5bfa8b31645898022b01e801"), "name" : "program-increment", "displayName" : "Program Increment", "codeRepos" : [ "mirrorgate-app", "MirrorGate", "jira-collector", "design" ], "boards" : [ "MirrorGate2" ], "programIncrement" : "2017_PI03" } { "_id" : ObjectId("5bfa8b31645898022b01e802"), "name" : "nothing" } { "_id" : ObjectId("5bfa8b31645898022b01e803"), "name" : "empty", "codeRepos" : [ ], "applications" : [ ], "boards" : [ ] }
user-metrics表
> db.user-metrics.find() 2018-11-25T07:23:13.142-0500 ReferenceError: metrics is not defined
commits表
> db.commits.find() { "_id" : ObjectId("5bfa8b31645898022b01e942"), "id" : "1234123", "repository" : "ssh://git@fake.com:fake/repo1.git", "timestamp" : 1518009865, "branches" : { "refs/remotes/origin/master" : 1519231554 } } { "_id" : ObjectId("5bfa8b31645898022b01e943"), "id" : "1234124", "repository" : "ssh://git@fake.com:fake/repo1.git", "timestamp" : 1518009865, "branches" : { "refs/remotes/origin/master" : 1519231554 } }