src/worker.c
int worker_real_load (void * vwker)
{
    worker_t  * wker = (worker_t *)vwker;
    epcore_t  * pcore = NULL;
    int         num, total = 0;
    int         load = 0;

    if (!wker) return 0;

    pcore = (epcore_t *)wker->epcore;
    if (!pcore) return 0;

    num = lt_num(wker->ioevent_list);
    total = bpool_fetched_num(pcore->event_pool);
    if (total > 0)
        load = (double)num / (double)total * 600.;

    load += wker->working_ratio * 300.;

    if (pcore->acc_event_num > 0)
        load += (double) wker->acc_event_num / (double)pcore->acc_event_num * 100.;

    wker->workload = load;

    return load;
}
/* worker load is calculated by 2 factors: 
   the first one is the ioevent number pending in waiting-queue, 
   the weigth is about 70%.
   the second one is working time ratio, the weight is 30%. */
worker load is calculated by 2 factors:
the first one is the ioevent number pending in waiting-queue,
the weigth is about 70%.
the second one is working time ratio, the weight is 30%.
worker load is calculated by 2 factors : the first one is the ioevent number pending in waiting - queue the weigth is about 70% . the second one is working time ratio the weight is 30% .
int worker_real_load (void * vwker)
{
    worker_t  * wker = (worker_t *)vwker;
    epcore_t  * pcore = NULL;
    int         num, total = 0;
    int         load = 0;
    if (!wker) return 0;
    pcore = (epcore_t *)wker->epcore;
    if (!pcore) return 0;
    num = lt_num(wker->ioevent_list);
    total = bpool_fetched_num(pcore->event_pool);
    if (total > 0)
        load = (double)num / (double)total * 600.;
    load += wker->working_ratio * 300.;
    if (pcore->acc_event_num > 0)
        load += (double) wker->acc_event_num / (double)pcore->acc_event_num * 100.;
    wker->workload = load;
    return load;
}
int worker_real_load ( void * vwker ) { worker_t * wker = ( worker_t * ) vwker ; epcore_t * pcore = NULL ; int num , total = 0 ; int load = 0 ; if ( ! wker ) return 0 ; pcore = ( epcore_t * ) wker -> epcore ; if ( ! pcore ) return 0 ; num = lt_num ( wker -> ioevent_list ) ; total = bpool_fetched_num ( pcore -> event_pool ) ; if ( total > 0 ) load = ( double ) num / ( double ) total * 600. ; load += wker -> working_ratio * 300. ; if ( pcore -> acc_event_num > 0 ) load += ( double ) wker -> acc_event_num / ( double ) pcore -> acc_event_num * 100. ; wker -> workload = load ; return load ; }
worker load is calculated by 2 factors:
the first one is the ioevent number pending in waiting-queue,
the weigth is about 70%.
worker load is calculated by 2 factors : the first one is the ioevent number pending in waiting - queue the weigth is about 70% .