diff --git a/dashboards/iris/activity_view.json b/dashboards/iris/activity_view.json index e60a6fa..7b184d1 100644 --- a/dashboards/iris/activity_view.json +++ b/dashboards/iris/activity_view.json @@ -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": [ [ @@ -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": [ [ @@ -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": [ [ @@ -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": [ [ diff --git a/dashboards/iris/iris.json b/dashboards/iris/iris.json index bcb7c62..f60a232 100644 --- a/dashboards/iris/iris.json +++ b/dashboards/iris/iris.json @@ -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": [ [ @@ -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": [ [ @@ -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": [ [ @@ -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": [ [ diff --git a/dashboards/iris/provider_view.json b/dashboards/iris/provider_view.json index e4d5069..0ab0704 100644 --- a/dashboards/iris/provider_view.json +++ b/dashboards/iris/provider_view.json @@ -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" }, @@ -180,7 +180,7 @@ }, { "params": [ - "Elapsed time * Number of processors / 2628000" + "Elapsed time * Number of processors / (DAYOFMONTH(LAST_DAY(Date))*86400)" ], "type": "alias" } @@ -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": [ [ @@ -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": [ [ @@ -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": [ [ diff --git a/dashboards/iris/resource_manager.json b/dashboards/iris/resource_manager.json index 20b1413..d31c5e0 100644 --- a/dashboards/iris/resource_manager.json +++ b/dashboards/iris/resource_manager.json @@ -155,7 +155,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT t1.VO, t2.Previous, t1.Projected, (IFNULL(t1.Projected, 0) - IFNULL(t2.Previous, 0)) as 'Difference'\n\nFROM\n\n(SELECT\n VO,\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/2628000 / day(max(UpdateTime)) * day(date(last_day(max(UpdateTime)))) AS 'Projected'\nFROM VCombinedSummaries\nWHERE MONTH(Date) <> 0 and Site in ($Site) and VO in ($VO) and YEAR(Date) = YEAR(CURRENT_DATE()) and MONTH(Date) = MONTH(CURRENT_DATE)\nGROUP BY VO) as t1 \n\nLEFT OUTER JOIN\n\n(SELECT\n VO,\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/2628000 AS 'Previous'\nFROM VCombinedSummaries\nWHERE Site in ($Site) and VO in ($VO) and YEAR(Date) = YEAR(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH)) and MONTH(Date) = MONTH(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH))\nGROUP BY VO) as t2\n\nON\n\nt1.VO=t2.VO\n\nUNION\n\nSELECT t2.VO, t2.Previous, t1.Projected, (IFNULL(t1.Projected, 0) - IFNULL(t2.Previous, 0)) as 'Difference'\n\nFROM\n\n(SELECT\n VO,\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/2628000 / day(max(UpdateTime)) * day(date(last_day(max(UpdateTime)))) AS 'Projected'\nFROM VCombinedSummaries\nWHERE MONTH(Date) <> 0 and Site in ($Site) and VO in ($VO) and YEAR(Date) = YEAR(CURRENT_DATE()) and MONTH(Date) = MONTH(CURRENT_DATE)\nGROUP BY VO) as t1 \n\nRIGHT OUTER JOIN\n\n(SELECT\n VO,\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/2628000 AS 'Previous'\nFROM VCombinedSummaries\nWHERE Site in ($Site) and VO in ($VO) and YEAR(Date) = YEAR(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH)) and MONTH(Date) = MONTH(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH))\nGROUP BY VO) as t2\n\nON\n\nt1.VO=t2.VO;", + "rawSql": "SELECT t1.VO, t2.Previous, t1.Projected, (IFNULL(t1.Projected, 0) - IFNULL(t2.Previous, 0)) as 'Difference'\n\nFROM\n\n(SELECT\n VO,\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400) / day(max(UpdateTime)) * day(date(last_day(max(UpdateTime)))) AS 'Projected'\nFROM VCombinedSummaries\nWHERE MONTH(Date) <> 0 and Site in ($Site) and VO in ($VO) and YEAR(Date) = YEAR(CURRENT_DATE()) and MONTH(Date) = MONTH(CURRENT_DATE)\nGROUP BY VO) as t1 \n\nLEFT OUTER JOIN\n\n(SELECT\n VO,\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400) AS 'Previous'\nFROM VCombinedSummaries\nWHERE Site in ($Site) and VO in ($VO) and YEAR(Date) = YEAR(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH)) and MONTH(Date) = MONTH(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH))\nGROUP BY VO) as t2\n\nON\n\nt1.VO=t2.VO\n\nUNION\n\nSELECT t2.VO, t2.Previous, t1.Projected, (IFNULL(t1.Projected, 0) - IFNULL(t2.Previous, 0)) as 'Difference'\n\nFROM\n\n(SELECT\n VO,\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400) / day(max(UpdateTime)) * day(date(last_day(max(UpdateTime)))) AS 'Projected'\nFROM VCombinedSummaries\nWHERE MONTH(Date) <> 0 and Site in ($Site) and VO in ($VO) and YEAR(Date) = YEAR(CURRENT_DATE()) and MONTH(Date) = MONTH(CURRENT_DATE)\nGROUP BY VO) as t1 \n\nRIGHT OUTER JOIN\n\n(SELECT\n VO,\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400) AS 'Previous'\nFROM VCombinedSummaries\nWHERE Site in ($Site) and VO in ($VO) and YEAR(Date) = YEAR(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH)) and MONTH(Date) = MONTH(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH))\nGROUP BY VO) as t2\n\nON\n\nt1.VO=t2.VO;", "refId": "A", "select": [ [ @@ -340,7 +340,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\r\n VO,\r\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/2628000 AS 'Usage'\r\nFROM VCombinedSummaries\r\nWHERE Site in ($Site) and VO in ($VO) and $__timeFilter(Date)\r\nGROUP BY VO;", + "rawSql": "SELECT\r\n VO,\r\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400) AS 'Usage'\r\nFROM VCombinedSummaries\r\nWHERE Site in ($Site) and VO in ($VO) and $__timeFilter(Date)\r\nGROUP BY VO;", "refId": "A", "select": [ [ @@ -505,7 +505,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n # Build up a DATETIME to use as the \"time\" value.\n # i.e. for (Year, Month) = (2019, 01) we want the\n # DATETIME \"2019-01-01 00:00:00\"\n STR_TO_DATE(\n CONCAT(Year, \"-\", Month, \"-01 00:00:00\"),\n \"%Y-%m-%d %H:%i:%s\"\n ) AS \"time\",\n SUM(WallDuration*Processors)/2628000 AS 'Grid (Previous)'\nFROM VSuperSummaries\nWHERE Site in ($Site) and VO in ($VO) and Year = YEAR(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH)) and Month = MONTH(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH))", + "rawSql": "SELECT\n # Build up a DATETIME to use as the \"time\" value.\n # i.e. for (Year, Month) = (2019, 01) we want the\n # DATETIME \"2019-01-01 00:00:00\"\n STR_TO_DATE(\n CONCAT(Year, \"-\", Month, \"-01 00:00:00\"),\n \"%Y-%m-%d %H:%i:%s\"\n ) AS \"time\",\n SUM(WallDuration*Processors)/(DAYOFMONTH(LAST_DAY(Date))*86400) AS 'Grid (Previous)'\nFROM VSuperSummaries\nWHERE Site in ($Site) and VO in ($VO) and Year = YEAR(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH)) and Month = MONTH(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH))", "refId": "A", "select": [ [ @@ -550,7 +550,7 @@ ], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n # Build up a DATETIME to use as the \"time\" value.\n # i.e. for (Year, Month) = (2019, 01) we want the\n # DATETIME \"2019-01-01 00:00:00\"\n STR_TO_DATE(\n CONCAT(Year, \"-\", Month, \"-01 00:00:00\"),\n \"%Y-%m-%d %H:%i:%s\"\n ) AS \"time\",\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/2628000 AS 'Cloud (Previous)'\nFROM VCloudSummaries\nWHERE Month <> 0 and SiteName in ($Site) and VO in ($VO) and Year = YEAR(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH)) and Month = MONTH(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH))", + "rawSql": "SELECT\n # Build up a DATETIME to use as the \"time\" value.\n # i.e. for (Year, Month) = (2019, 01) we want the\n # DATETIME \"2019-01-01 00:00:00\"\n STR_TO_DATE(\n CONCAT(Year, \"-\", Month, \"-01 00:00:00\"),\n \"%Y-%m-%d %H:%i:%s\"\n ) AS \"time\",\n SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/(DAYOFMONTH(LAST_DAY(Date))*86400) AS 'Cloud (Previous)'\nFROM VCloudSummaries\nWHERE Month <> 0 and SiteName in ($Site) and VO in ($VO) and Year = YEAR(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH)) and Month = MONTH(DATE_SUB(CURRENT_DATE, INTERVAL 1 MONTH))", "refId": "B", "select": [ [ @@ -594,7 +594,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n # Build up a DATETIME to use as the \"time\" value.\n # i.e. for (Year, Month) = (2019, 01) we want the\n # DATETIME \"2019-01-01 00:00:00\"\n IFNULL(STR_TO_DATE(CONCAT(Year, \"-\", Month, \"-01 00:00:00\"),\"%Y-%m-%d %H:%i:%s\"), CURRENT_DATE()) AS \"time\",\n IFNULL(SUM(WallDuration*Processors)/2628000 / day(max(UpdateTime)) * day(date(last_day(max(UpdateTime)))), 0) AS 'Grid (Projected)'\nFROM VSuperSummaries\nWHERE Site in ($Site) and VO in ($VO) and Year = YEAR(CURRENT_DATE()) and Month = MONTH(CURRENT_DATE())", + "rawSql": "SELECT\n # Build up a DATETIME to use as the \"time\" value.\n # i.e. for (Year, Month) = (2019, 01) we want the\n # DATETIME \"2019-01-01 00:00:00\"\n IFNULL(STR_TO_DATE(CONCAT(Year, \"-\", Month, \"-01 00:00:00\"),\"%Y-%m-%d %H:%i:%s\"), CURRENT_DATE()) AS \"time\",\n IFNULL(SUM(WallDuration*Processors)/(DAYOFMONTH(LAST_DAY(Date))*86400) / day(max(UpdateTime)) * day(date(last_day(max(UpdateTime)))), 0) AS 'Grid (Projected)'\nFROM VSuperSummaries\nWHERE Site in ($Site) and VO in ($VO) and Year = YEAR(CURRENT_DATE()) and Month = MONTH(CURRENT_DATE())", "refId": "C", "select": [ [ @@ -626,7 +626,7 @@ "group": [], "metricColumn": "none", "rawQuery": true, - "rawSql": "SELECT\n # Build up a DATETIME to use as the \"time\" value.\n # i.e. for (Year, Month) = (2019, 01) we want the\n # DATETIME \"2019-01-01 00:00:00\"\n IFNULL(STR_TO_DATE(CONCAT(Year, \"-\", Month, \"-01 00:00:00\"),\"%Y-%m-%d %H:%i:%s\"), CURRENT_DATE()) AS \"time\",\n IFNULL(SUM(WallDuration*IF(CpuCount=0,1,CpuCount))/2628000 / day(max(UpdateTime)) * day(date(last_day(max(UpdateTime)))), 0) AS 'Cloud (Projected)'\nFROM VCloudSummaries\nWHERE Month <> 0 and SiteName in ($Site) and VO in ($VO) and Year = YEAR(CURRENT_DATE()) and Month = MONTH(CURRENT_DATE())", + "rawSql": "SELECT\n # Build up a DATETIME to use as the \"time\" value.\n # i.e. for (Year, Month) = (2019, 01) we want the\n # DATETIME \"2019-01-01 00:00:00\"\n IFNULL(STR_TO_DATE(CONCAT(Year, \"-\", Month, \"-01 00:00:00\"),\"%Y-%m-%d %H:%i:%s\"), CURRENT_DATE()) AS \"time\",\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 'Cloud (Projected)'\nFROM VCloudSummaries\nWHERE Month <> 0 and SiteName in ($Site) and VO in ($VO) and Year = YEAR(CURRENT_DATE()) and Month = MONTH(CURRENT_DATE())", "refId": "D", "select": [ [