/**
  * @override \local_telemetry\request_state
  */
 public function get_records()
 {
     $record = new stdClass();
     $filecachefileinfo = wincache_fcache_fileinfo(true);
     if ($filecachefileinfo) {
         $record->f_f_uptime = $filecachefileinfo['total_cache_uptime'];
         $record->f_f_items = $filecachefileinfo['total_file_count'];
         $record->f_f_hits = $filecachefileinfo['total_hit_count'];
         $record->f_f_misses = $filecachefileinfo['total_miss_count'];
     }
     $filecachememinfo = wincache_fcache_meminfo();
     if ($filecachememinfo) {
         $record->f_m_total = $filecachememinfo['memory_total'];
         $record->f_m_free = $filecachememinfo['memory_free'];
         $record->f_m_used_blocks = $filecachememinfo['num_used_blks'];
         $record->f_m_free_blocks = $filecachememinfo['num_free_blks'];
         $record->f_m_overhead = $filecachememinfo['memory_overhead'];
     }
     $opcodecachefileinfo = wincache_ocache_fileinfo(true);
     if ($opcodecachefileinfo) {
         $record->o_f_uptime = $opcodecachefileinfo['total_cache_uptime'];
         $record->o_f_items = $opcodecachefileinfo['total_file_count'];
         $record->o_f_hits = $opcodecachefileinfo['total_hit_count'];
         $record->o_f_misses = $opcodecachefileinfo['total_miss_count'];
         $record->o_f_islocal = $opcodecachefileinfo['is_local_cache'];
     }
     $opcodecachememinfo = wincache_ocache_meminfo();
     if ($opcodecachememinfo) {
         $record->o_m_total = $opcodecachememinfo['memory_total'];
         $record->o_m_free = $opcodecachememinfo['memory_free'];
         $record->o_m_used_blocks = $opcodecachememinfo['num_used_blks'];
         $record->o_m_free_blocks = $opcodecachememinfo['num_free_blks'];
         $record->o_m_overhead = $opcodecachememinfo['memory_overhead'];
     }
     $resolvedpathcachefileinfo = wincache_rplist_fileinfo(true);
     if ($resolvedpathcachefileinfo) {
         $record->rp_f_files = $resolvedpathcachefileinfo['total_file_count'];
     }
     $resolvedpathcachememinfo = wincache_rplist_meminfo();
     if ($resolvedpathcachememinfo) {
         $record->rp_m_total = $resolvedpathcachememinfo['memory_total'];
         $record->rp_m_free = $resolvedpathcachememinfo['memory_free'];
         $record->rp_m_used_blocks = $resolvedpathcachememinfo['num_used_blks'];
         $record->rp_m_free_blocks = $resolvedpathcachememinfo['num_free_blks'];
         $record->rp_m_overhead = $resolvedpathcachememinfo['memory_overhead'];
     }
     $sessioncacheinfo = wincache_scache_info(true);
     if ($sessioncacheinfo) {
         $record->s_i_uptime = $sessioncacheinfo['total_cache_uptime'];
         $record->s_i_items = $sessioncacheinfo['total_item_count'];
         $record->s_i_islocal = $sessioncacheinfo['is_local_cache'];
         $record->s_i_hits = $sessioncacheinfo['total_hit_count'];
         $record->s_i_misses = $sessioncacheinfo['total_miss_count'];
     }
     $sessioncachememinfo = wincache_scache_meminfo();
     if ($sessioncachememinfo) {
         $record->s_m_total = $sessioncachememinfo['memory_total'];
         $record->s_m_free = $sessioncachememinfo['memory_free'];
         $record->s_m_used_blocks = $sessioncachememinfo['num_used_blks'];
         $record->s_m_free_blocks = $sessioncachememinfo['num_free_blks'];
         $record->s_m_overhead = $sessioncachememinfo['memory_overhead'];
     }
     $usercacheinfo = wincache_ucache_info(true);
     if ($usercacheinfo) {
         $record->u_i_uptime = $usercacheinfo['total_cache_uptime'];
         $record->u_i_items = $usercacheinfo['total_item_count'];
         $record->u_i_islocal = $usercacheinfo['is_local_cache'];
         $record->u_i_hits = $usercacheinfo['total_hit_count'];
         $record->u_i_misses = $usercacheinfo['total_miss_count'];
     }
     $usercachememinfo = wincache_ucache_meminfo();
     if ($usercachememinfo) {
         $record->u_m_total = $usercachememinfo['memory_total'];
         $record->u_m_free = $usercachememinfo['memory_free'];
         $record->u_m_used_blocks = $usercachememinfo['num_used_blks'];
         $record->u_m_free_blocks = $usercachememinfo['num_free_blks'];
         $record->u_m_overhead = $usercachememinfo['memory_overhead'];
     }
     return array($record);
 }
Exemplo n.º 2
0
function init_cache_info($cache_data = SUMMARY_DATA)
{
    global $ocache_mem_info, $ocache_file_info, $ocache_summary_info, $fcache_mem_info, $fcache_file_info, $fcache_summary_info, $rpcache_mem_info, $rpcache_file_info, $ucache_mem_info, $ucache_info, $scache_mem_info, $scache_info, $user_cache_available, $session_cache_available;
    if ($cache_data == SUMMARY_DATA || $cache_data == OCACHE_DATA) {
        $ocache_mem_info = wincache_ocache_meminfo();
        $ocache_file_info = wincache_ocache_fileinfo();
        $ocache_summary_info = get_ocache_summary($ocache_file_info['file_entries']);
    }
    if ($cache_data == SUMMARY_DATA || $cache_data == FCACHE_DATA) {
        $fcache_mem_info = wincache_fcache_meminfo();
        $fcache_file_info = wincache_fcache_fileinfo();
        $fcache_summary_info = get_fcache_summary($fcache_file_info['file_entries']);
    }
    if ($cache_data == SUMMARY_DATA || $cache_data == RCACHE_DATA) {
        $rpcache_mem_info = wincache_rplist_meminfo();
        $rpcache_file_info = wincache_rplist_fileinfo();
    }
    if ($user_cache_available && ($cache_data == SUMMARY_DATA || $cache_data == UCACHE_DATA)) {
        $ucache_mem_info = wincache_ucache_meminfo();
        $ucache_info = wincache_ucache_info();
    }
    if ($session_cache_available && ($cache_data == SUMMARY_DATA || $cache_data == SCACHE_DATA)) {
        $scache_mem_info = wincache_scache_meminfo();
        $scache_info = wincache_scache_info();
    }
}