Skip to content

Commit

Permalink
Fix month length generalisation (#170)
Browse files Browse the repository at this point in the history
Day of Month fixes to:
- iris.json
- activity_view.json
- provider_view.json
- resource_manager.json
  • Loading branch information
RedProkofiev authored Feb 22, 2024
1 parent 9c25900 commit 5a0949d
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 20 deletions.
8 changes: 4 additions & 4 deletions dashboards/iris/activity_view.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/2628000) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400)) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "D",
"select": [
[
Expand Down Expand Up @@ -377,7 +377,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((WallDuration)/2628000) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((WallDuration)/(DAYOFMONTH(LAST_DAY(Date))*86400)) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "C",
"select": [
[
Expand Down Expand Up @@ -552,7 +552,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((CpuDuration)/2628000) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((CpuDuration)/(DAYOFMONTH(LAST_DAY(Date))*86400)) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "C",
"select": [
[
Expand Down Expand Up @@ -700,7 +700,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"Month\",\n VO,\n Site,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/2628000) as \"Average Core Usage\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1, 2, 3\nORDER BY Date desc, VO, Site",
"rawSql": "SELECT\n Date as \"Month\",\n VO,\n Site,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400)) as \"Average Core Usage\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1, 2, 3\nORDER BY Date desc, VO, Site",
"refId": "A",
"select": [
[
Expand Down
8 changes: 4 additions & 4 deletions dashboards/iris/iris.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\r\n Date as \"time\",\r\n IFNULL(SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/2628000 / day(max(UpdateTime)) * day(date(last_day(max(UpdateTime)))), 0) AS \"Estimated Total Usage\"\r\nFROM VCombinedSummaries\r\nWHERE\r\n MONTH(Date) = MONTH(CURRENT_DATE())\r\n and YEAR(Date) = YEAR(CURRENT_DATE())\r\n and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)",
"rawSql": "SELECT\r\n Date as \"time\",\r\n IFNULL(SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400) / day(max(UpdateTime)) * day(date(last_day(max(UpdateTime)))), 0) AS \"Estimated Total Usage\"\r\nFROM VCombinedSummaries\r\nWHERE\r\n MONTH(Date) = MONTH(CURRENT_DATE())\r\n and YEAR(Date) = YEAR(CURRENT_DATE())\r\n and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)",
"refId": "P",
"select": [
[
Expand Down Expand Up @@ -357,7 +357,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/2628000) as \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400)) as \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "D",
"select": [
[
Expand Down Expand Up @@ -1242,7 +1242,7 @@
"hide": false,
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n Site,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/2628000) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n Site,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400)) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "C",
"select": [
[
Expand Down Expand Up @@ -2095,7 +2095,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/2628000) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n VO,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400)) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "A",
"select": [
[
Expand Down
12 changes: 6 additions & 6 deletions dashboards/iris/provider_view.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,13 +162,13 @@
],
"metricColumn": "Project",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n Project,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/2628000) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n Project,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400)) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "D",
"select": [
[
{
"params": [
"(WallDuration*CpuCount)/2628000"
"(WallDuration*CpuCount)/(DAYOFMONTH(LAST_DAY(Date))*86400)"
],
"type": "column"
},
Expand All @@ -180,7 +180,7 @@
},
{
"params": [
"Elapsed time * Number of processors / 2628000"
"Elapsed time * Number of processors / (DAYOFMONTH(LAST_DAY(Date))*86400)"
],
"type": "alias"
}
Expand Down Expand Up @@ -401,7 +401,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n Site,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/2628000) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n Site,\n SUM((WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400)) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "D",
"select": [
[
Expand Down Expand Up @@ -584,7 +584,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n Site,\n SUM((WallDuration)/2628000) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n Site,\n SUM((WallDuration)/(DAYOFMONTH(LAST_DAY(Date))*86400)) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "C",
"select": [
[
Expand Down Expand Up @@ -764,7 +764,7 @@
"group": [],
"metricColumn": "none",
"rawQuery": true,
"rawSql": "SELECT\n Date as \"time\",\n Site,\n SUM((CpuDuration)/2628000) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"rawSql": "SELECT\n Date as \"time\",\n Site,\n SUM((CpuDuration)/(DAYOFMONTH(LAST_DAY(Date))*86400)) AS \"\"\nFROM VCombinedSummaries\nWHERE\n $__timeFilter(Date) and Project in ($Project) and Site in ($Site) and VO in ($VO) and SourceSchema in ($Source) and VOGroup in ($VOGroup)\nGROUP BY 1,2\nORDER BY Date",
"refId": "C",
"select": [
[
Expand Down
Loading

0 comments on commit 5a0949d

Please sign in to comment.