PluginProbe
Code Profiler – WordPress Performance Profiling and Debugging Made Easy / 1.4
Code Profiler – WordPress Performance Profiling and Debugging Made Easy v1.4
1.9.5 1.9.4 1.9.3 trunk 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.5 1.5.1 1.5.2 1.5.3 1.5.4 1.5.5 1.6 1.6.1 1.6.10 1.6.2 1.6.3 1.6.4 1.6.5 1.6.6 1.6.7 1.6.8 All 40 releases
code-profiler / lib / menu_view_diskio.php

menu_view_diskio.php in Code Profiler – WordPress Performance Profiling and Debugging Made Easy 1.4, at lib/menu_view_diskio.php

58 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 +=====================================================================+
4 | ____ _ ____ __ _ _ |
5 | / ___|___ __| | ___ | _ \ _ __ ___ / _(_) | ___ _ __ |
6 | | | / _ \ / _` |/ _ \ | |_) | '__/ _ \| |_| | |/ _ \ '__| |
7 | | |__| (_) | (_| | __/ | __/| | | (_) | _| | | __/ | |
8 | \____\___/ \__,_|\___| |_| |_| \___/|_| |_|_|\___|_| |
9 | |
10 | (c) Jerome Bruandet ~ https://code-profiler.com/ |
11 +=====================================================================+
12 */
13
14 if (! defined( 'ABSPATH' ) ) { die( 'Forbidden' ); }
15
16 // =====================================================================
17 // Display File I/O stats.
18
19 $buffer = code_profiler_get_profile_data( $profile_path, 'diskio' );
20 if ( isset( $buffer['error'] ) ) {
21 return;
22 }
23
24 // Fetch options
25 $cp_options = get_option( 'code-profiler' );
26
27 // Horizontal vs vertical chart
28 if ( empty( $cp_options['chart_type'] ) || ! in_array( $cp_options['chart_type'], ['x', 'y' ] ) ) {
29 $axis = 'x';
30 } else {
31 $axis = $cp_options['chart_type'];
32 }
33
34 ?>
35 <div style="width:80vw;margin:auto">
36 <canvas id="myChart"></canvas>
37 </div>
38 <script>
39 jQuery(document).ready(function() {
40 'use strict';
41 cpjs_diskio_chart(
42 '<?php echo esc_js( $axis ) ?>', [<?php
43 echo "'". esc_js( __('I/O Read bytes', 'code-profiler') ) .
44 "', '". esc_js( __('I/O Write bytes', 'code-profiler') ) .
45 "'" ?>], [<?php
46 echo "'". (int) $buffer[0][1] ."', '". (int) $buffer[1][1] ."'"
47 ?>]
48 );
49 });
50 </script>
51 <?php
52 // Actions below stats
53 $save_png = 1;
54 $rotate_img = 1;
55 $type = 'diskio';
56 // =====================================================================
57 // EOF
58