lithops-cloud / lithops

A multi-cloud framework for big data analytics and embarrassingly parallel jobs, that provides an universal API for building parallel applications in the cloud ☁️🚀
http://lithops.cloud
Apache License 2.0
317 stars 105 forks source link

Add execution stats docs #899

Closed aitorarjona closed 2 years ago

aitorarjona commented 2 years ago

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.
aitorarjona commented 2 years ago

Plase @JosepSampe could you review the description of the statis parameters and tell me if they are correct? I would need to know what exactly host_result_query_count and host_status_query_count indicate as I am not sure (left them blank).

JosepSampe commented 2 years ago

@aitorarjona *_query_count is the amount of attempts to download the file. For example host_status_query_count=2 and host_result_query_count=1 means that the status file was download at the second try, and the result file was downloaded at the first try

aitorarjona commented 2 years ago

@JosepSampe For this example:

import lithops
import time
from pprint import pprint

def my_function(x):
    time.sleep(10)  # Do some work...
    return x + 7

if __name__ == '__main__':
    fexec = lithops.FunctionExecutor()
    future = fexec.call_async(my_function, 3)
    fexec.wait(fs=future)
    result = fexec.get_result(fs=future)
    pprint(future.stats)

I get this output:

{'chunksize': 1,
 'data_size_bytes': 21,
 'func_module_size_bytes': 611,
 'func_result_size': 26.0,
 'host_data_upload_time': 0,
 'host_func_upload_time': 0.588293,
 'host_job_create_tstamp': 1647287154.5765412,
 'host_job_created_time': 0.590769,
 'host_job_serialize_time': 0.001758,
 'host_result_done_tstamp': 1647287169.3160923,
 'host_result_query_count': 1,
 'host_status_done_tstamp': 1647287168.708364,
 'host_status_query_count': 0,
 'host_submit_tstamp': 1647287155.1686838,
 'warm_container': True,
 'worker_end_tstamp': 1647287166.442059,
 'worker_exec_time': 10.52488446,
 'worker_func_end_tstamp': 1647287166.314035,
 'worker_func_exec_time': 10.01008964,
 'worker_func_start_tstamp': 1647287156.3039453,
 'worker_result_upload_time': 0.12039733,
 'worker_start_tstamp': 1647287155.9171746}

Should not host_status_query_count be at least 1? And another question: So the 404-ed GET request for the status.json to synchronize finished functions do not count for the host_status_query_count? Should it do?

JosepSampe commented 2 years ago

Yes, host_status_query_count should be at least 1. These stats were inherited from pywren. Now in lithops the logic for syncronizing finsihed functions is completely diferent and the status file is check in the monitor component, so here the value will be always 1 (except if you call future.result() directly). Not sure if we really need this stats right now, as we never used them

aitorarjona commented 2 years ago

You decide ;)

JosepSampe commented 2 years ago

@aitorarjona There is no need to delete them. I think this is enough