@@ -272,6 +272,20 @@ cdef class Statistics:
272272
273273 @staticmethod
274274 def load ():
275+ """ Load the Statistics of the `slurmctld`.
276+
277+ Returns:
278+ (pyslurm.slurmctld.Statistics): The Controller statistics.
279+
280+ Raises:
281+ (pyslurm.RPCError): When fetching the Statistics failed.
282+
283+ Examples:
284+ >>> from pyslurm import slurmctld
285+ >>> stats = slurmctld.Statistics.load()
286+ >>> print(stats.jobs_completed, stats.schedule_cycle_counter)
287+ 10 20
288+ """
275289 cdef:
276290 stats_info_request_msg_t req
277291 stats_info_response_msg_t * resp = NULL
@@ -291,11 +305,30 @@ cdef class Statistics:
291305
292306 @staticmethod
293307 def reset ():
308+ """ Reset the Statistics of the `slurmctld`.
309+
310+ Raises:
311+ (pyslurm.RPCError): When resetting the Statistics failed.
312+
313+ Examples:
314+ >>> from pyslurm import slurmctld
315+ >>> slurmctld.Statistics.reset()
316+ """
294317 cdef stats_info_request_msg_t req
295318 req.command_id = slurm.STAT_COMMAND_RESET
296319 verify_rpc(slurm_reset_statistics(& req))
297320
298321 def to_dict (self ):
322+ """ Convert the statistics to a dictionary.
323+
324+ Returns:
325+ (dict): Statistics as a dict.
326+
327+ Examples:
328+ >>> from pyslurm import slurmctld
329+ >>> stats = slurmctld.Statistics.load()
330+ >>> stats_dict = stats.to_dict()
331+ """
299332 out = instance_to_dict(self )
300333 out[" rpcs_by_type" ] = xcollections.dict_recursive(self .rpcs_by_type)
301334 out[" rpcs_by_user" ] = xcollections.dict_recursive(self .rpcs_by_user)
@@ -305,6 +338,26 @@ cdef class Statistics:
305338 return out
306339
307340
341+ def diag ():
342+ """ Load the Statistics of the `slurmctld`.
343+
344+ This is a shortcut for [pyslurm.slurmctld.Statistics.load][]
345+
346+ Returns:
347+ (pyslurm.slurmctld.Statistics): The Controller statistics.
348+
349+ Raises:
350+ (pyslurm.RPCError): When fetching the Statistics failed.
351+
352+ Examples:
353+ >>> from pyslurm import slurmctld
354+ >>> stats = slurmctld.Statistics.load()
355+ >>> print(stats.jobs_completed, stats.schedule_cycle_counter)
356+ 10 20
357+ """
358+ return Statistics.load()
359+
360+
308361cdef parse_response(stats_info_response_msg_t * ptr):
309362 cdef Statistics out = Statistics()
310363
0 commit comments