How do you measure the progress of a web service call?

后端 未结 6 844
遇见更好的自我
遇见更好的自我 2020-12-20 18:46

I have an ASP.NET web service which does some heavy lifting, like say,some file operations, or generating Excel Sheets from a bunch of crystal reports. I don\'t want to be b

6条回答
  •  情歌与酒
    2020-12-20 19:42

    Write a separate method on the server that you can query by passing the ID of the job that has been scheduled and which returns an approximate value between 0-100 (or 0.0 and 1.0, or whatever) of how far along it is.

    E.g. in REST-style, you could make a GET request to http://yourserver.com/app/jobstatus/4133/ which would return a simple '52' as text/plain. Then you just have to query that every (second? two seconds? ten seconds?) to see how far along it is.

    How you actually accomplish the monitoring on the backend hugely depends on what your process is and how it works.

提交回复
热议问题