1

주제: [처리됨] Needleworks.Function.Debug.php 수정바랍니다.

Needleworks.Function.Debug.php를 써서 Debug 할때, 캐쉬되지 않는 쿼리가 5개이하일때 캐쉬되는 쿼리가 top5안에 들어오기도 합니다. 뭐 한페이지에 텍스트큐브에서 캐쉬되지 않은 쿼리가 설마 5개 이하일때가 있을지 모르지만...

암튼 이유는..

    foreach( array_splice($elapsed,0,5) as $e ) {
        $top5[$e[1]] = true;
    }

소팅한다음에 무조건 5개를 잡는데, 캐쉬는 elapsed 타임이 0이므로 가끔씩 캐쉬 쿼리가 top5에 올라오기도 하는 거죠..
그래서 다음과 같이 수정해야 할것 같습니다.

    foreach( array_splice($elapsed,0,5) as $e ) {
        if($e[0] !=  0)
            $top5[$e[1]] = true;
    }

^^

엽기민원 (2007-07-31 14:23:45)에 의해 마지막으로 수정

2

답글: [처리됨] Needleworks.Function.Debug.php 수정바랍니다.

생각해 보니 elapsed 타임이 0이 될 쿼리(캐쉬커리말고)가 있겠냐 만은...혹시나 해서 다시 소스 수정안을 내봅니다.

    foreach( $__tcSqlLog as $c => $log ) {
        $elapsed[$count] = array( $log['elapsed'], $count, $log['cached'] ? "cached":"" );
        $__tcSqlLog[$c]['percent'] = sprintf("%4.1f", $log['endtime']*100/$__tcPageEndTime);
        $count++;
    }

    arsort( $elapsed );
    $bgcolor = array();
    foreach( array_splice($elapsed,0,5) as $e ) {
        if($e[2] !=  "cached")
            $top5[$e[1]] = true;
    }

엽기민원 (2007-07-31 14:31:33)에 의해 마지막으로 수정

3

답글: [처리됨] Needleworks.Function.Debug.php 수정바랍니다.

3884 에 반영하였습니다. 감사합니다.^^

"Everything looks different on the other side."

-Ian Malcomm, from Michael Crichton's 'The Jurassic Park'