Skip to content

Commit

Permalink
feat: added index template for MonitoringDB
Browse files Browse the repository at this point in the history
  • Loading branch information
fstagni committed Jun 17, 2024
1 parent da30d4b commit a7acf6f
Show file tree
Hide file tree
Showing 4 changed files with 128 additions and 70 deletions.
4 changes: 2 additions & 2 deletions src/DIRAC/Core/Utilities/ElasticSearchDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ def __init__(
sLog.warn("Cannot load index template", result["Message"])
return
sLog.debug("Loading index template", result["Value"])
with open(f"{result['Value']}") as f:
self.client.indices.put_template(name=self.__class__.__name__, body=json.load(f))
with open(result['Value']) as f:
self.client.indices.put_index_template(name=self.__class__.__name__.lower(), body=json.load(f))
except Exception as e:
sLog.error("Cannot load index template", repr(e))

Expand Down
58 changes: 58 additions & 0 deletions src/DIRAC/MonitoringSystem/DB/MonitoringDB.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"index_patterns": ["wmshistory_index_*"],
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"properties": {
"Status": {
"type": "keyword"
},
"Site": {
"type": "keyword"
},
"JobSplitType": {
"type": "keyword"
},
"ApplicationStatus": {
"type": "keyword"
},
"MinorSite": {
"type": "keyword"
},
"User": {
"type": "keyword"
},
"UserGroup": {
"type": "keyword"
},
"JobGroup": {
"type": "keyword"
}
}
}
}
{
"index_patterns": ["pilotshistory_index_*"],
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"properties": {
"GridSite": {
"type": "keyword"
},
"GridType": {
"type": "keyword"
},
"Status": {
"type": "keyword"
},
"NumOfPilots": {
"type": "long"
}
}
}
}
135 changes: 68 additions & 67 deletions src/DIRAC/WorkloadManagementSystem/DB/ElasticJobParametersDB.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,72 @@
{
"index_patterns": ["job_parameters_*"],
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"properties": {
"JobID": {
"type": "long"
},
"Status": {
"type": "keyword"
},
"timestamp": {
"type": "date"
},
"PilotAgent": {
"type": "keyword"
},
"Pilot_Reference": {
"type": "keyword"
},
"JobGroup": {
"type": "keyword"
},
"JobType": {
"type": "keyword"
},
"JobWrapperPID": {
"type": "long"
},
"CPUNormalizationFactor": {
"type": "long"
},
"NormCPUTime(s)": {
"type": "long"
},
"Memory(MB)": {
"type": "long"
},
"ModelName": {
"type": "keyword"
},
"LocalAccount": {
"type": "keyword"
},
"HostName": {
"type": "text"
},
"TotalCPUTime(s)": {
"type": "long"
},
"PayloadPID": {
"type": "long"
},
"CEQueue": {
"type": "keyword"
},
"BatchSystem": {
"type": "keyword"
},
"GridCE": {
"type": "keyword"
"index_patterns": ["job_parameter_*"],
"template": {
"settings": {
"index": {
"number_of_shards": 1,
"number_of_replicas": 1
}
}
},
"aliases": {
"my_index_alias": {}
},
"mappings": {
"properties": {
"JobID": {
"type": "long"
},
"Status": {
"type": "keyword"
},
"timestamp": {
"type": "date"
},
"PilotAgent": {
"type": "keyword"
},
"Pilot_Reference": {
"type": "keyword"
},
"JobGroup": {
"type": "keyword"
},
"JobType": {
"type": "keyword"
},
"JobWrapperPID": {
"type": "long"
},
"CPUNormalizationFactor": {
"type": "long"
},
"NormCPUTime(s)": {
"type": "long"
},
"Memory(MB)": {
"type": "long"
},
"ModelName": {
"type": "keyword"
},
"LocalAccount": {
"type": "keyword"
},
"HostName": {
"type": "text"
},
"TotalCPUTime(s)": {
"type": "long"
},
"PayloadPID": {
"type": "long"
},
"CEQueue": {
"type": "keyword"
},
"BatchSystem": {
"type": "keyword"
},
"GridCE": {
"type": "keyword"
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from typing import TYPE_CHECKING, Any

from DIRAC import S_ERROR, S_OK, gLogger
from DIRAC.ConfigurationSystem.Client.Helpers.Operations import Operations
from DIRAC.Core.Utilities import TimeUtilities
from DIRAC.Core.Utilities.ObjectLoader import ObjectLoader
from DIRAC.WorkloadManagementSystem.Client import JobStatus
Expand Down

0 comments on commit a7acf6f

Please sign in to comment.