Skip to content

Commit

Permalink
add the testdata of 3 metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
Zzzzzhuzhiwei committed Aug 11, 2023
1 parent 7ef01f2 commit d1a1217
Show file tree
Hide file tree
Showing 19 changed files with 1,156 additions and 2 deletions.
14 changes: 12 additions & 2 deletions test/data.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ const option = {
endMonth: 12,
};

const orderOptions = ['ASC','DESC'];
const limitOptions = ['each', 'all'];
const orderOptions = ['DESC'];
const limitOptions = ['all'];
const limitOptions1 = [3];
const groupTimeRangeOptions = ['year', 'quarter', 'month'];
const groupByOptions = [null, 'org'];
Expand All @@ -51,8 +51,18 @@ const delay = async (ms) => {
groupTimeRange,
groupBy,
};
// issues_new
const issues_new_file_name = `issues_new_${order}_${limit}_${limitOption}_${groupBy}_${groupTimeRange}`.toLowerCase();
validate_data(openDigger.metric.chaoss.issuesNew,'issues_new',issues_new_file_name);
// issues_closed
const issues_closed_file_name = `issues_closed_${order}_${limit}_${limitOption}_${groupBy}_${groupTimeRange}`.toLowerCase();
validate_data(openDigger.metric.chaoss.issuesClosed,'issues_closed',issues_closed_file_name);
// code_change_commits
const code_change_commits_file_name = `code_change_commits_${order}_${limit}_${limitOption}_${groupBy}_${groupTimeRange}`.toLowerCase();
validate_data(openDigger.metric.chaoss.codeChangeCommits,'code_change_commits',code_change_commits_file_name);
// issues_and_change_request_active
const issues_and_change_request_active_file_name = `issues_and_change_request_active_${order}_${limit}_${limitOption}_${groupBy}_${groupTimeRange}`.toLowerCase();
validate_data(openDigger.metric.chaoss.issuesAndChangeRequestActive,'issues_and_change_request_active',issues_and_change_request_active_file_name);
await delay(1000);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"sql":"\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('month', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(count, 2),\n toUInt32(dateDiff('month', toDate('2015-1-1'), time))) AS commits_count\nFROM\n(\n SELECT\n toStartOfMonth(created_at) AS time,\n repo_id AS id, argMax(repo_name, time) AS name,\n COUNT(arrayJoin(push_commits.message)) AS count\n FROM gh_events\n WHERE type = 'PushEvent' AND (org_id IN [1342004]) AND created_at >= toDate('2015-1-1') AND created_at < dateAdd(month, 1, toDate('2016-12-1'))\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY commits_count[-1] DESC\n LIMIT 3",
"modifiedOption": {
"orgIds": [
1342004
],
"startYear": 2015,
"endYear": 2016,
"startMonth": 1,
"endMonth": 12,
"order": "DESC",
"limit": 3,
"limitOption": "all",
"groupTimeRange": "month",
"groupBy": null
},
"code_change_commits_desc_3_all_null_month": [
{
"id": "19979068",
"name": "google/rekall-profiles",
"count": [
"6",
"12",
"14",
"42",
"16",
"24",
"6",
"30",
"18",
"8",
"6",
"11",
"15",
"33",
"18",
"5",
"30",
"16",
"23",
"11",
"6",
"7",
"22",
"666"
]
},
{
"id": "9304637",
"name": "google/ggrc-core",
"count": [
"0",
"0",
"0",
"885",
"588",
"230",
"489",
"502",
"423",
"227",
"503",
"489",
"361",
"401",
"433",
"426",
"403",
"653",
"423",
"350",
"674",
"499",
"731",
"571"
]
},
{
"id": "51965089",
"name": "google/amphtml",
"count": [
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"0",
"141",
"240",
"136",
"419",
"453",
"568",
"429",
"583",
"819",
"526"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
{
"sql":"\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('quarter', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(count, 2),\n toUInt32(dateDiff('quarter', toStartOfQuarter(toDate('2015-1-1')), time))) AS commits_count\nFROM\n(\n SELECT\n toStartOfQuarter(created_at) AS time,\n repo_id AS id, argMax(repo_name, time) AS name,\n COUNT(arrayJoin(push_commits.message)) AS count\n FROM gh_events\n WHERE type = 'PushEvent' AND (org_id IN [1342004]) AND created_at >= toDate('2015-1-1') AND created_at < dateAdd(month, 1, toDate('2016-12-1'))\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY commits_count[-1] DESC\n LIMIT 3",
"modifiedOption": {
"orgIds": [
1342004
],
"startYear": 2015,
"endYear": 2016,
"startMonth": 1,
"endMonth": 12,
"order": "DESC",
"limit": 3,
"limitOption": "all",
"groupTimeRange": "quarter",
"groupBy": null
},
"code_change_commits_desc_3_all_null_quarter": [
{
"id": "51965089",
"name": "google/amphtml",
"count": [
"0",
"0",
"0",
"0",
"141",
"795",
"1450",
"1928"
]
},
{
"id": "9304637",
"name": "google/ggrc-core",
"count": [
"0",
"1703",
"1414",
"1219",
"1195",
"1482",
"1447",
"1801"
]
},
{
"id": "19249835",
"name": "google/WebFundamentals",
"count": [
"342",
"660",
"1531",
"1134",
"774",
"539",
"1878",
"1307"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"sql":"\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('year', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(count, 2),\n toUInt32(dateDiff('year', toStartOfYear(toDate('2015-1-1')), time))) AS commits_count\nFROM\n(\n SELECT\n toStartOfYear(created_at) AS time,\n repo_id AS id, argMax(repo_name, time) AS name,\n COUNT(arrayJoin(push_commits.message)) AS count\n FROM gh_events\n WHERE type = 'PushEvent' AND (org_id IN [1342004]) AND created_at >= toDate('2015-1-1') AND created_at < dateAdd(month, 1, toDate('2016-12-1'))\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY commits_count[-1] DESC\n LIMIT 3",
"modifiedOption": {
"orgIds": [
1342004
],
"startYear": 2015,
"endYear": 2016,
"startMonth": 1,
"endMonth": 12,
"order": "DESC",
"limit": 3,
"limitOption": "all",
"groupTimeRange": "year",
"groupBy": null
},
"code_change_commits_desc_3_all_null_year": [
{
"id": "9304637",
"name": "google/ggrc-core",
"count": [
"4336",
"5925"
]
},
{
"id": "19249835",
"name": "google/WebFundamentals",
"count": [
"3667",
"4498"
]
},
{
"id": "51965089",
"name": "google/amphtml",
"count": [
"0",
"4314"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"sql":"\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('month', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(count, 2),\n toUInt32(dateDiff('month', toDate('2015-1-1'), time))) AS commits_count\nFROM\n(\n SELECT\n toStartOfMonth(created_at) AS time,\n org_id AS id, argMax(org_login, time) AS name,\n COUNT(arrayJoin(push_commits.message)) AS count\n FROM gh_events\n WHERE type = 'PushEvent' AND (org_id IN [1342004]) AND created_at >= toDate('2015-1-1') AND created_at < dateAdd(month, 1, toDate('2016-12-1'))\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY commits_count[-1] DESC\n LIMIT 3",
"modifiedOption": {
"orgIds": [
1342004
],
"startYear": 2015,
"endYear": 2016,
"startMonth": 1,
"endMonth": 12,
"order": "DESC",
"limit": 3,
"limitOption": "all",
"groupTimeRange": "month",
"groupBy": "org"
},
"code_change_commits_desc_3_all_org_month": [
{
"id": "1342004",
"name": "google",
"count": [
"4220",
"4964",
"5997",
"7825",
"7173",
"5726",
"7837",
"8141",
"7895",
"7548",
"5143",
"5550",
"5363",
"5472",
"5527",
"5227",
"5447",
"7053",
"6856",
"7091",
"6943",
"7243",
"6261",
"6731"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
{
"sql":"\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('quarter', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(count, 2),\n toUInt32(dateDiff('quarter', toStartOfQuarter(toDate('2015-1-1')), time))) AS commits_count\nFROM\n(\n SELECT\n toStartOfQuarter(created_at) AS time,\n org_id AS id, argMax(org_login, time) AS name,\n COUNT(arrayJoin(push_commits.message)) AS count\n FROM gh_events\n WHERE type = 'PushEvent' AND (org_id IN [1342004]) AND created_at >= toDate('2015-1-1') AND created_at < dateAdd(month, 1, toDate('2016-12-1'))\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY commits_count[-1] DESC\n LIMIT 3",
"modifiedOption": {
"orgIds": [
1342004
],
"startYear": 2015,
"endYear": 2016,
"startMonth": 1,
"endMonth": 12,
"order": "DESC",
"limit": 3,
"limitOption": "all",
"groupTimeRange": "quarter",
"groupBy": "org"
},
"code_change_commits_desc_3_all_org_quarter": [
{
"id": "1342004",
"name": "google",
"count": [
"15181",
"20724",
"23873",
"18241",
"16362",
"17727",
"20890",
"20235"
]
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"sql":"\nSELECT\n id,\n argMax(name, time) AS name,\n groupArrayInsertAt(\n 0,\n toUInt32(dateDiff('year', toDate('2015-1-1'), toDate('2016-12-1'))) + 1)(ROUND(count, 2),\n toUInt32(dateDiff('year', toStartOfYear(toDate('2015-1-1')), time))) AS commits_count\nFROM\n(\n SELECT\n toStartOfYear(created_at) AS time,\n org_id AS id, argMax(org_login, time) AS name,\n COUNT(arrayJoin(push_commits.message)) AS count\n FROM gh_events\n WHERE type = 'PushEvent' AND (org_id IN [1342004]) AND created_at >= toDate('2015-1-1') AND created_at < dateAdd(month, 1, toDate('2016-12-1'))\n GROUP BY id, time\n \n)\nGROUP BY id\nORDER BY commits_count[-1] DESC\n LIMIT 3",
"modifiedOption": {
"orgIds": [
1342004
],
"startYear": 2015,
"endYear": 2016,
"startMonth": 1,
"endMonth": 12,
"order": "DESC",
"limit": 3,
"limitOption": "all",
"groupTimeRange": "year",
"groupBy": "org"
},
"code_change_commits_desc_3_all_org_year": [
{
"id": "1342004",
"name": "google",
"count": [
"78019",
"75214"
]
}
]
}
Loading

0 comments on commit d1a1217

Please sign in to comment.