cvs: phpweb / usage.php /bin arial.ttf generate-netcraft-chart jpgraph.php jpgraph_line.php verdana.ttf /gifs/stats phpstats-200203.png
| From: | Rasmus Lerdorf | Date: | Tue, 02 Apr 2002 18:10:26 +0000 |
| Subject: | cvs: phpweb / usage.php /bin arial.ttf generate-netcraft-chart jpgraph.php jpgraph_line.php verdana.ttf /gifs/stats phpstats-200203.png | ||
| Groups: | php.mirrors | ||
| Request: | Send a blank email to php-mirrors+get-9402@lists.php.net to get a copy of this message | ||
rasmus Tue Apr 2 13:10:26 2002 EDT
Added files:
/phpweb/gifs/stats phpstats-200203.png
/phpweb/bin verdana.ttf arial.ttf jpgraph.php jpgraph_line.php
Modified files:
/phpweb usage.php
/phpweb/bin generate-netcraft-chart
Log:
New prettier usage graph using a hacked up jpgraph
Index: phpweb/usage.php diff -u phpweb/usage.php:1.26 phpweb/usage.php:1.27 --- phpweb/usage.php:1.26 Tue Feb 12 15:40:29 2002 +++ phpweb/usage.php Tue Apr 2 13:10:24 2002 @@ -3,23 +3,15 @@ commonHeader("PHP Usage Stats"); ?> -<h1>Usage Stats for January 2002</h1> +<h1>Usage Stats for March 2002</h1> <p> -PHP: 7,525,142 Domains, 1,079,999 IP Addresses<br> +PHP: 8,861,195 Domains, 1,142,955 IP Addresses<br> Source: <a href="http://www.netcraft.com/Survey/">Netcraft</a><br> </p> <p> -<?php echo print_image("stats/phpstats-200201.png", "Graph"); ?> -</p> -<p> -There has been some shakeout in the large-scale shared hosting space -related to the .com crash and combined with some routing issues in -Germany which caused 5-10% of German servers not being able to -respond to the Netcraft queries. This hurt the PHP total domain -numbers a bit in recent months, but they appear to be back up nicely -as of the November and December numbers. +<?php echo print_image("stats/phpstats-200203.png", "Graph"); ?> </p> <p> You can also see how popular PHP is relative to other Apache modules Index: phpweb/bin/generate-netcraft-chart diff -u phpweb/bin/generate-netcraft-chart:1.10 phpweb/bin/generate-netcraft-chart:1.11 --- phpweb/bin/generate-netcraft-chart:1.10 Tue Feb 12 15:40:29 2002 +++ phpweb/bin/generate-netcraft-chart Tue Apr 2 13:10:25 2002 @@ -1,10 +1,10 @@ #!/usr/local/bin/php -q <?php // -*- C++ -*- - -require("./barchart.phl"); +include ("jpgraph.php"); +include ("jpgraph_line.php"); $stats = array( - /* numbers from http://www.netcraft.com/survey/Reports/200109/PHP.txt + /* numbers from http://www.netcraft.com/survey/Reports/200109/PHP.txt 199806 => array(71360, 47329), 199807 => array(81337, 53361), 199808 => array(90641, 58078), @@ -12,6 +12,7 @@ 199810 => array(129757, 73063), 199811 => array(220286, 81141), 199812 => array(241924, 87273), +*/ 199901 => array(278297, 90264), 199902 => array(345549, 101140), 199903 => array(409418, 143667), @@ -24,7 +25,6 @@ 199910 => array(931122, 321128), 199911 => array(1114021, 357481), 199912 => array(1256216, 378301), - */ 200001 => array(1271060, 391876), 200002 => array(1412822, 428840), 200003 => array(1783626, 462510), @@ -49,55 +49,46 @@ 200110 => array(6624340, 979572), 200111 => array(7095691, 1046426), 200112 => array(7261540, 1043328), - 200201 => array(7525142, 1079999) + 200201 => array(7525142, 1079999), + 200202 => array(8586112, 1143239), + 200203 => array(8861195, 1142955) ); -$rgb_colors = array( - array(205,85,85,15), // IndianRed3 - array(72,61,139,15), // royal blue - array(139,58,98,15), // scarlet/purple - array(0,139,139,15), // green/gray/blue - array(238,118,0,15), // orange - array(139,69,19,15), // dark red-brown - array(65,105,225,40) // clear blue -); -$currcol = 0; $months = array(1 => "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); -$data = array(); -$labels = array(); -$colors = array(); -$lastyear = 0; -reset($stats); -while (list($month, $stat) = each($stats)) { - $data[] = array($stat[0] - $stat[1], $stat[1]); - $year = substr($month, 0, 4); - $mon = (int)substr($month, 4); - if ($months[$mon]) { - $labels[0][] = $months[$mon]; - } else { - $labels[0][] = ''; - } - if ($year != $lastyear) { - $labels[1][] = "$year"; - } else { - $labels[1][] = ''; - } - $lastyear = $year; - $colors[] = $rgb_colors[$currcol++]; - if ($currcol >= sizeof($rgb_colors)) { - $currcol = 0; - } + +$i=1; + +foreach($stats as $key => $arr) { + $domains[] = $arr[0]; + $ips[] = $arr[1]; + $keys[] = ($i++%2) ? $months[(int)substr($key,4)].' '.substr($key,0,4) : ''; } -$max = 250000; +$graph = new Graph(780,350,"auto"); +$graph->img->SetMargin(60,30,30,60); +$graph->SetScale("textlin"); +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,10); +$graph->xaxis->SetTickLabels($keys); +$graph->xaxis->SetLabelAngle(45); +$graph->SetShadow(); +$graph->title->Set("PHP Usage for " . end($keys)); +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,16); +$graph->legend->SetLayout(LEGEND_HOR); +$graph->legend->Pos(0.20,0.18,"center","center"); + +$p1 = new LinePlot($ips); +$p1->SetFillColor(array(38,118,0,70)); +$p1->SetLegend("IPs"); + +$p2 = new LinePlot($domains); +$p2->SetFillColor(array(45,85,205,50)); +$p2->SetLegend("Domains"); + + +$graph->Add($p2); +$graph->Add($p1); + +$graph->Stroke(); -$bar = new barchart; -$bar->right = 170; -$bar->bar_padding = 20; -$bar->title = $bardata["title"]; -$bar->y_label = $graph["y_axis_label"]; -$bar->init(780, 350, $data, $colors, array('Total (Domains)', 'IP Addresses')); -$bar->draw_x_labels($labels, 3); -$bar->display(); -?> +?> Index: phpweb/bin/verdana.ttf +++ phpweb/bin/verdana.ttf 0DSIG¡æ2 d (LTSHVØ/ 0 OS/2Guà ¸ VVDMXtñ|m ´ àcmapèM ¨ cvt L§@ã "¬ fpgmî7S !t 8gasp glyfñ÷ À ;¶hdmx IÍ 28 lheadƬëß <
Index: phpweb/usage.php diff -u phpweb/usage.php:1.26 phpweb/usage.php:1.27 --- phpweb/usage.php:1.26 Tue Feb 12 15:40:29 2002 +++ phpweb/usage.php Tue Apr 2 13:10:24 2002 @@ -3,23 +3,15 @@ commonHeader("PHP Usage Stats"); ?> -<h1>Usage Stats for January 2002</h1> +<h1>Usage Stats for March 2002</h1> <p> -PHP: 7,525,142 Domains, 1,079,999 IP Addresses<br> +PHP: 8,861,195 Domains, 1,142,955 IP Addresses<br> Source: <a href="http://www.netcraft.com/Survey/">Netcraft</a><br> </p> <p> -<?php echo print_image("stats/phpstats-200201.png", "Graph"); ?> -</p> -<p> -There has been some shakeout in the large-scale shared hosting space -related to the .com crash and combined with some routing issues in -Germany which caused 5-10% of German servers not being able to -respond to the Netcraft queries. This hurt the PHP total domain -numbers a bit in recent months, but they appear to be back up nicely -as of the November and December numbers. +<?php echo print_image("stats/phpstats-200203.png", "Graph"); ?> </p> <p> You can also see how popular PHP is relative to other Apache modules Index: phpweb/bin/generate-netcraft-chart diff -u phpweb/bin/generate-netcraft-chart:1.10 phpweb/bin/generate-netcraft-chart:1.11 --- phpweb/bin/generate-netcraft-chart:1.10 Tue Feb 12 15:40:29 2002 +++ phpweb/bin/generate-netcraft-chart Tue Apr 2 13:10:25 2002 @@ -1,10 +1,10 @@ #!/usr/local/bin/php -q <?php // -*- C++ -*- - -require("./barchart.phl"); +include ("jpgraph.php"); +include ("jpgraph_line.php"); $stats = array( - /* numbers from http://www.netcraft.com/survey/Reports/200109/PHP.txt + /* numbers from http://www.netcraft.com/survey/Reports/200109/PHP.txt 199806 => array(71360, 47329), 199807 => array(81337, 53361), 199808 => array(90641, 58078), @@ -12,6 +12,7 @@ 199810 => array(129757, 73063), 199811 => array(220286, 81141), 199812 => array(241924, 87273), +*/ 199901 => array(278297, 90264), 199902 => array(345549, 101140), 199903 => array(409418, 143667), @@ -24,7 +25,6 @@ 199910 => array(931122, 321128), 199911 => array(1114021, 357481), 199912 => array(1256216, 378301), - */ 200001 => array(1271060, 391876), 200002 => array(1412822, 428840), 200003 => array(1783626, 462510), @@ -49,55 +49,46 @@ 200110 => array(6624340, 979572), 200111 => array(7095691, 1046426), 200112 => array(7261540, 1043328), - 200201 => array(7525142, 1079999) + 200201 => array(7525142, 1079999), + 200202 => array(8586112, 1143239), + 200203 => array(8861195, 1142955) ); -$rgb_colors = array( - array(205,85,85,15), // IndianRed3 - array(72,61,139,15), // royal blue - array(139,58,98,15), // scarlet/purple - array(0,139,139,15), // green/gray/blue - array(238,118,0,15), // orange - array(139,69,19,15), // dark red-brown - array(65,105,225,40) // clear blue -); -$currcol = 0; $months = array(1 => "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"); -$data = array(); -$labels = array(); -$colors = array(); -$lastyear = 0; -reset($stats); -while (list($month, $stat) = each($stats)) { - $data[] = array($stat[0] - $stat[1], $stat[1]); - $year = substr($month, 0, 4); - $mon = (int)substr($month, 4); - if ($months[$mon]) { - $labels[0][] = $months[$mon]; - } else { - $labels[0][] = ''; - } - if ($year != $lastyear) { - $labels[1][] = "$year"; - } else { - $labels[1][] = ''; - } - $lastyear = $year; - $colors[] = $rgb_colors[$currcol++]; - if ($currcol >= sizeof($rgb_colors)) { - $currcol = 0; - } + +$i=1; + +foreach($stats as $key => $arr) { + $domains[] = $arr[0]; + $ips[] = $arr[1]; + $keys[] = ($i++%2) ? $months[(int)substr($key,4)].' '.substr($key,0,4) : ''; } -$max = 250000; +$graph = new Graph(780,350,"auto"); +$graph->img->SetMargin(60,30,30,60); +$graph->SetScale("textlin"); +$graph->xaxis->SetFont(FF_ARIAL,FS_NORMAL,10); +$graph->xaxis->SetTickLabels($keys); +$graph->xaxis->SetLabelAngle(45); +$graph->SetShadow(); +$graph->title->Set("PHP Usage for " . end($keys)); +$graph->title->SetFont(FF_VERDANA,FS_NORMAL,16); +$graph->legend->SetLayout(LEGEND_HOR); +$graph->legend->Pos(0.20,0.18,"center","center"); + +$p1 = new LinePlot($ips); +$p1->SetFillColor(array(38,118,0,70)); +$p1->SetLegend("IPs"); + +$p2 = new LinePlot($domains); +$p2->SetFillColor(array(45,85,205,50)); +$p2->SetLegend("Domains"); + + +$graph->Add($p2); +$graph->Add($p1); + +$graph->Stroke(); -$bar = new barchart; -$bar->right = 170; -$bar->bar_padding = 20; -$bar->title = $bardata["title"]; -$bar->y_label = $graph["y_axis_label"]; -$bar->init(780, 350, $data, $colors, array('Total (Domains)', 'IP Addresses')); -$bar->draw_x_labels($labels, 3); -$bar->display(); -?> +?> Index: phpweb/bin/verdana.ttf +++ phpweb/bin/verdana.ttf 0DSIG¡æ2 d (LTSHVØ/ 0 OS/2Guà ¸ VVDMXtñ|m ´ àcmapèM ¨ cvt L§@ã "¬ fpgmî7S !t 8gasp glyfñ÷ À ;¶hdmx IÍ 28 lheadƬëß <