pm4py.stats.get_service_time(log: Union[EventLog, DataFrame], aggregation_measure: str = 'mean', activity_key: str = 'concept:name', timestamp_key: str = 'time:timestamp', start_timestamp_key: str = 'time:timestamp', case_id_key: str = 'case:concept:name') Dict[str, float][source]#

Gets the activities’ (average/median/…) service time in the provided event log

  • log – event log

  • aggregation_measure (str) – the aggregation to be used (mean, median, min, max, sum)

  • activity_key (str) – attribute to be used for the activity

  • timestamp_key (str) – attribute to be used for the timestamp

  • start_timestamp_key (str) – attribute to be used for the start timestamp

  • case_id_key (str) – attribute to be used as case identifier

Return type:

Dict[str, float]

import pm4py

log = pm4py.read_xes('tests/input_data/interval_event_log.xes')
mean_serv_time = pm4py.get_service_time(log, start_timestamp_key='start_timestamp', aggregation_measure='mean')
median_serv_time = pm4py.get_service_time(log, start_timestamp_key='start_timestamp', aggregation_measure='median')