wiki:ProgressReport
Last modified 7 years ago Last modified on 08/16/09 13:14:01

Minion Progress Report

The main idea behind minion progress is to have a way to get status of completed work so far. For example after a progress query made to minion the result will be "the status is x/y" where x is work done so far and y is all job.

Using the stuff programatically :

First make your method report its status like that :

def run_str_log(self,command):
        import time

        self.run_str_log.logger.info("Starting counting logger ...")
        time.sleep(10)
        for i in range(50):
            time.sleep(1)
            #log the progress so other apps can poll for it
            self.run_str_log.logger.progress(i,50)

        return command

Then you can call it on Overlord with :

In [1]: from func.overlord.client import Overlord

In [2]: fc = Overlord("*",async=True)

In [3]: j = fc.echo.run_str_log("bli")

In [4]: j
Out[4]: '*-echo-run_str_log-1249216433.5550549'

In [6]: fc.check_progress(j,"acerfedora")
Out[6]: ({'acerfedora': [8, 50]}, False)

In [7]: fc.check_progress(j,"acerfedora")
Out[7]: ({'acerfedora': [10, 50]}, False)

In [8]: fc.check_progress(j,"acerfedora")
Out[8]: ({'acerfedora': [12, 50]}, False)

In [9]: fc.check_progress(j,"acerfedora")
Out[9]: ({'acerfedora': [14, 50]}, False)

In [10]: fc.check_progress(j,"acerfedora")
Out[10]: ({'acerfedora': [15, 50]}, False)

Pretty easy to use, to make API code usable in your applications you may take a look at func/ovelord/cmd_modules/call.py

CLI Usage

Link : http://tutorials-place.com/media/makkalot_stuff/progress.htm