Skip to content

Commit abeff6d

Browse files
committed
fix: use ComputingElement instead of DestinationSite
1 parent 0f560c8 commit abeff6d

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/DIRAC/MonitoringSystem/Client/Types/PilotsHistory.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def __init__(self):
2626
self.addMapping(
2727
{
2828
"GridSite": {"type": "keyword"},
29+
"ComputingElement": {"type": "keyword"},
2930
"GridType": {"type": "keyword"},
3031
"Status": {"type": "keyword"},
3132
"VO": {"type": "keyword"},

src/DIRAC/WorkloadManagementSystem/DB/PilotAgentsDB.sql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ CREATE TABLE `PilotOutput` (
7373
DROP TABLE IF EXISTS `PilotsHistorySummary`;
7474
CREATE TABLE `PilotsHistorySummary` (
7575
`GridSite` VARCHAR(128),
76-
`DestinationSite` VARCHAR(128),
76+
`ComputingElement` VARCHAR(128),
7777
`Status` VARCHAR(32),
7878
`VO` VARCHAR(64),
7979
`PilotCount` INT,
80-
PRIMARY KEY (`GridSite`,`DestinationSite`,`Status`, `VO`)
80+
PRIMARY KEY (`GridSite`,`ComputingElement`,`Status`, `VO`)
8181
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
8282

8383

@@ -89,7 +89,7 @@ CREATE TRIGGER trg_PilotAgents_insert
8989
AFTER INSERT ON PilotAgents
9090
FOR EACH ROW
9191
BEGIN
92-
INSERT INTO PilotsHistorySummary (GridSite, DestinationSite, Status, VO, PilotCount)
92+
INSERT INTO PilotsHistorySummary (GridSite, ComputingElement, Status, VO, PilotCount)
9393
VALUES (NEW.GridSite, NEW.DestinationSite, NEW.Status, NEW.VO, 1)
9494
ON DUPLICATE KEY UPDATE PilotCount = PilotCount + 1;
9595
END;
@@ -102,15 +102,15 @@ BEGIN
102102
UPDATE PilotsHistorySummary
103103
SET PilotCount = PilotCount - 1
104104
WHERE GridSite = OLD.GridSite
105-
AND DestinationSite = OLD.DestinationSite
105+
AND ComputingElement = OLD.DestinationSite
106106
AND Status = OLD.Status
107107
AND VO = OLD.VO;
108108

109109
-- Remove zero rows
110110
DELETE FROM PilotsHistorySummary
111111
WHERE PilotCount = 0
112112
AND GridSite = OLD.GridSite
113-
AND DestinationSite = OLD.DestinationSite
113+
AND ComputingElement = OLD.DestinationSite
114114
AND Status = OLD.Status
115115
AND VO = OLD.VO;
116116
END;
@@ -126,15 +126,15 @@ BEGIN
126126
UPDATE PilotsHistorySummary
127127
SET PilotCount = PilotCount - 1
128128
WHERE GridSite = OLD.GridSite
129-
AND DestinationSite = OLD.DestinationSite
129+
AND ComputingElement = OLD.DestinationSite
130130
AND Status = OLD.Status
131131
AND VO = OLD.VO;
132132

133133
-- Delete row if count drops to zero
134134
DELETE FROM PilotsHistorySummary WHERE PilotCount = 0;
135135

136136
-- Increase count for new status
137-
INSERT INTO PilotsHistorySummary (GridSite, DestinationSite, Status, VO, PilotCount)
137+
INSERT INTO PilotsHistorySummary (GridSite, ComputingElement, Status, VO, PilotCount)
138138
VALUES (NEW.GridSite, NEW.DestinationSite, NEW.Status, NEW.VO, 1)
139139
ON DUPLICATE KEY UPDATE PilotCount = PilotCount + 1;
140140

0 commit comments

Comments
 (0)