DMTF/Redfish-Mockup-Creator

Division by zero in averageResponseTime calculation

alansill opened this issue · 1 comments

Using the mockup creator against a real machine, I encounter the following error

#REQUEST: Transport:SendRecv:    GET https://10.101.7.4/redfish/v1/TaskService/Tasks
#    Checking for nav properties in item with k = @odata.context, v = /redfish/v1/$metadata#TaskCollection.TaskCollection
#    Checking for nav properties in item with k = @odata.id, v = /redfish/v1/TaskService/Tasks
#    Checking for nav properties in item with k = @odata.type, v = #TaskCollection.TaskCollection
#    Checking for nav properties in item with k = Description, v = Collection of Tasks
#    Checking for nav properties in item with k = Members, v = []
#    Checking for nav properties in item with k = Members@odata.count, v = 0
#    Checking for nav properties in item with k = Name, v = Task Collection
Traceback (most recent call last):
  File "redfishMockupCreate.py", line 746, in <module>
    main(sys.argv)
  File "redfishMockupCreate.py", line 511, in main
    stats = genTimeStatistics(mockDir)
  File "redfishMockupCreate.py", line 100, in genTimeStatistics
    results['averageResponseTime'] = round(results['totalResponseTime'] / len(allResponseTimes), 3)
ZeroDivisionError: division by zero

Seems to execute the division regardless if any time-keeping happens, e.g. when the option for timing the system isn't specified. Will put in a hot fix.