Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hls的测试用例在做统计时,计算问题请教 #18

Open
alphonsetai opened this issue Nov 11, 2019 · 0 comments
Open

hls的测试用例在做统计时,计算问题请教 #18

alphonsetai opened this issue Nov 11, 2019 · 0 comments

Comments

@alphonsetai
Copy link

`int StHlsTask::ProcessTask(){
int ret = ERROR_SUCCESS;

Trace("start to process HLS task #%d, schema=%s, host=%s, port=%d, path=%s, startup=%.2f, delay=%.2f, error=%.2f, count=%d", 
    GetId(), url.GetSchema(), url.GetHost(), url.GetPort(), url.GetPath(), startup_seconds, delay_seconds, error_seconds, count);

// if count is zero, infinity loop.
for(int i = 0; count == 0 || i < count; i++){
    statistic->OnTaskStart(GetId(), url.GetUrl());
    
    StHttpClient client;
    if((ret = ProcessM3u8(client)) != ERROR_SUCCESS){
        statistic->OnTaskError(GetId(), 0);
        
        Error("http client process m3u8 failed. ret=%d", ret);
        st_usleep((st_utime_t)(error_seconds * 1000 * 1000));
        continue;
    }
    
    Info("[HLS] %s download completed.", url.GetUrl());
}

return ret;

}`

这个代码片段中,在正常流程分支里,只调用了OnTaskStart没有调用OnTaskEnd,导致在跑的过程中,统计数据的alive等参数一直在累加没有任何变化。

想问一下,有没有为何这样做?遗漏,还是有什么原因。我现在也刚好正在找一些测试方法。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant