@@ -217,47 +217,53 @@ def check_longhorn_components_memory_cpu_usage():
217217 usage ["backing-image-manager" ]["memory" ],
218218 cold_usage ["backing-image-manager" ]["memory" ])
219219
220- is_high_resource_consumption ("csi-attacher" , "cpu" ,
221- usage ["csi-attacher" ]["cpu" ],
222- old_usage ["csi-attacher" ]["cpu" ])
223- is_high_resource_consumption ("csi-attacher" , "memory" ,
224- usage ["csi-attacher" ]["memory" ],
225- old_usage ["csi-attacher" ]["memory" ])
226-
227- is_high_resource_consumption ("csi-provisioner" , "cpu" ,
228- usage ["csi-provisioner" ]["cpu" ],
229- old_usage ["csi-provisioner" ]["cpu" ])
230- is_high_resource_consumption ("csi-provisioner" , "memory" ,
231- usage ["csi-provisioner" ]["memory" ],
232- old_usage ["csi-provisioner" ]["memory" ])
233-
234- is_high_resource_consumption ("csi-resizer" , "cpu" ,
235- usage ["csi-resizer" ]["cpu" ],
236- old_usage ["csi-resizer" ]["cpu" ])
237- is_high_resource_consumption ("csi-resizer" , "memory" ,
238- usage ["csi-resizer" ]["memory" ],
239- old_usage ["csi-resizer" ]["memory" ])
240-
241- is_high_resource_consumption ("csi-snapshotter" , "cpu" ,
242- usage ["csi-snapshotter" ]["cpu" ],
243- old_usage ["csi-snapshotter" ]["cpu" ])
244- is_high_resource_consumption ("csi-snapshotter" , "memory" ,
245- usage ["csi-snapshotter" ]["memory" ],
246- old_usage ["csi-snapshotter" ]["memory" ])
247-
248- is_high_resource_consumption ("engine-image" , "cpu" ,
249- usage ["engine-image" ]["cpu" ],
250- old_usage ["engine-image" ]["cpu" ])
251- is_high_resource_consumption ("engine-image" , "memory" ,
252- usage ["engine-image" ]["memory" ],
253- old_usage ["engine-image" ]["memory" ])
254-
255- is_high_resource_consumption ("instance-manager-v1" , "cpu" ,
256- usage ["instance-manager-v1" ]["cpu" ],
257- old_usage ["instance-manager-v1" ]["cpu" ])
258- is_high_resource_consumption ("instance-manager-v1" , "memory" ,
259- usage ["instance-manager-v1" ]["memory" ],
260- old_usage ["instance-manager-v1" ]["memory" ])
220+ if "csi-attacher" in usage and "csi-attacher" in old_usage :
221+ is_high_resource_consumption ("csi-attacher" , "cpu" ,
222+ usage ["csi-attacher" ]["cpu" ],
223+ old_usage ["csi-attacher" ]["cpu" ])
224+ is_high_resource_consumption ("csi-attacher" , "memory" ,
225+ usage ["csi-attacher" ]["memory" ],
226+ old_usage ["csi-attacher" ]["memory" ])
227+
228+ if "csi-provisioner" in usage and "csi-provisioner" in old_usage :
229+ is_high_resource_consumption ("csi-provisioner" , "cpu" ,
230+ usage ["csi-provisioner" ]["cpu" ],
231+ old_usage ["csi-provisioner" ]["cpu" ])
232+ is_high_resource_consumption ("csi-provisioner" , "memory" ,
233+ usage ["csi-provisioner" ]["memory" ],
234+ old_usage ["csi-provisioner" ]["memory" ])
235+
236+ if "csi-resizer" in usage and "csi-resizer" in old_usage :
237+ is_high_resource_consumption ("csi-resizer" , "cpu" ,
238+ usage ["csi-resizer" ]["cpu" ],
239+ old_usage ["csi-resizer" ]["cpu" ])
240+ is_high_resource_consumption ("csi-resizer" , "memory" ,
241+ usage ["csi-resizer" ]["memory" ],
242+ old_usage ["csi-resizer" ]["memory" ])
243+
244+ if "csi-snapshotter" in usage and "csi-snapshotter" in old_usage :
245+ is_high_resource_consumption ("csi-snapshotter" , "cpu" ,
246+ usage ["csi-snapshotter" ]["cpu" ],
247+ old_usage ["csi-snapshotter" ]["cpu" ])
248+ is_high_resource_consumption ("csi-snapshotter" , "memory" ,
249+ usage ["csi-snapshotter" ]["memory" ],
250+ old_usage ["csi-snapshotter" ]["memory" ])
251+
252+ if "engine-image" in usage and "engine-image" in old_usage :
253+ is_high_resource_consumption ("engine-image" , "cpu" ,
254+ usage ["engine-image" ]["cpu" ],
255+ old_usage ["engine-image" ]["cpu" ])
256+ is_high_resource_consumption ("engine-image" , "memory" ,
257+ usage ["engine-image" ]["memory" ],
258+ old_usage ["engine-image" ]["memory" ])
259+
260+ if "instance-manager-v1" in usage and "instance-manager-v1" in old_usage :
261+ is_high_resource_consumption ("instance-manager-v1" , "cpu" ,
262+ usage ["instance-manager-v1" ]["cpu" ],
263+ old_usage ["instance-manager-v1" ]["cpu" ])
264+ is_high_resource_consumption ("instance-manager-v1" , "memory" ,
265+ usage ["instance-manager-v1" ]["memory" ],
266+ old_usage ["instance-manager-v1" ]["memory" ])
261267
262268 if "instance-manager-v2" in usage and "instance-manager-v2" in old_usage :
263269 is_high_resource_consumption ("instance-manager-v2" , "cpu" ,
@@ -267,33 +273,37 @@ def check_longhorn_components_memory_cpu_usage():
267273 usage ["instance-manager-v2" ]["memory" ],
268274 old_usage ["instance-manager-v2" ]["memory" ])
269275
270- is_high_resource_consumption ("longhorn-csi-plugin" , "cpu" ,
271- usage ["longhorn-csi-plugin" ]["cpu" ],
272- old_usage ["longhorn-csi-plugin" ]["cpu" ])
273- is_high_resource_consumption ("longhorn-csi-plugin" , "memory" ,
274- usage ["longhorn-csi-plugin" ]["memory" ],
275- old_usage ["longhorn-csi-plugin" ]["memory" ])
276-
277- is_high_resource_consumption ("longhorn-driver-deployer" , "cpu" ,
278- usage ["longhorn-driver-deployer" ]["cpu" ],
279- old_usage ["longhorn-driver-deployer" ]["cpu" ])
280- is_high_resource_consumption ("longhorn-driver-deployer" , "memory" ,
281- usage ["longhorn-driver-deployer" ]["memory" ],
282- old_usage ["longhorn-driver-deployer" ]["memory" ])
283-
284- is_high_resource_consumption ("longhorn-manager" , "cpu" ,
285- usage ["longhorn-manager" ]["cpu" ],
286- old_usage ["longhorn-manager" ]["cpu" ])
287- is_high_resource_consumption ("longhorn-manager" , "memory" ,
288- usage ["longhorn-manager" ]["memory" ],
289- old_usage ["longhorn-manager" ]["memory" ])
290-
291- is_high_resource_consumption ("longhorn-ui" , "cpu" ,
292- usage ["longhorn-ui" ]["cpu" ],
293- old_usage ["longhorn-ui" ]["cpu" ])
294- is_high_resource_consumption ("longhorn-ui" , "memory" ,
295- usage ["longhorn-ui" ]["memory" ],
296- old_usage ["longhorn-ui" ]["memory" ])
276+ if "longhorn-csi-plugin" in usage and "longhorn-csi-plugin" in old_usage :
277+ is_high_resource_consumption ("longhorn-csi-plugin" , "cpu" ,
278+ usage ["longhorn-csi-plugin" ]["cpu" ],
279+ old_usage ["longhorn-csi-plugin" ]["cpu" ])
280+ is_high_resource_consumption ("longhorn-csi-plugin" , "memory" ,
281+ usage ["longhorn-csi-plugin" ]["memory" ],
282+ old_usage ["longhorn-csi-plugin" ]["memory" ])
283+
284+ if "longhorn-driver-deployer" in usage and "longhorn-driver-deployer" in old_usage :
285+ is_high_resource_consumption ("longhorn-driver-deployer" , "cpu" ,
286+ usage ["longhorn-driver-deployer" ]["cpu" ],
287+ old_usage ["longhorn-driver-deployer" ]["cpu" ])
288+ is_high_resource_consumption ("longhorn-driver-deployer" , "memory" ,
289+ usage ["longhorn-driver-deployer" ]["memory" ],
290+ old_usage ["longhorn-driver-deployer" ]["memory" ])
291+
292+ if "longhorn-manager" in usage and "longhorn-manager" in old_usage :
293+ is_high_resource_consumption ("longhorn-manager" , "cpu" ,
294+ usage ["longhorn-manager" ]["cpu" ],
295+ old_usage ["longhorn-manager" ]["cpu" ])
296+ is_high_resource_consumption ("longhorn-manager" , "memory" ,
297+ usage ["longhorn-manager" ]["memory" ],
298+ old_usage ["longhorn-manager" ]["memory" ])
299+
300+ if "longhorn-ui" in usage and "longhorn-ui" in old_usage :
301+ is_high_resource_consumption ("longhorn-ui" , "cpu" ,
302+ usage ["longhorn-ui" ]["cpu" ],
303+ old_usage ["longhorn-ui" ]["cpu" ])
304+ is_high_resource_consumption ("longhorn-ui" , "memory" ,
305+ usage ["longhorn-ui" ]["memory" ],
306+ old_usage ["longhorn-ui" ]["memory" ])
297307
298308 if "share-manager" in usage and "share-manager" in old_usage :
299309 is_high_resource_consumption ("share-manager" , "cpu" ,
0 commit comments