dns: Reduce ttls
[sks-keyservers-pool.git] / sks-keyservers.net / status-srv / key_development.php
blob1d4c826e121d8984169895f797a103dd2a018ec7
1 <?
2 /*
3 * status-srv/index.php
4 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2012 Kristian Fiskerstrand
5 *
6 * This file is part of SKS Keyserver Pool (http://sks-keyservers.net)
7 *
8 * The Author can be reached by electronic mail at kf@sumptuouscapital.com
9 * Communication using OpenPGP is preferred - a copy of the public key 0x0B7F8B60E3EDFAE3
10 * is available in all the common keyservers or in hkp://pool.sks-keyservers.net
12 * This program is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU General Public License as published by
14 * the Free Software Foundation, either version 3 of the License, or
15 * (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program. If not, see <http://www.gnu.org/licenses/>.
26 require("sks.inc.php");
27 require("sks-status.inc.php");
29 $title = "History of number of OpenPGP keys";
30 $dir = "../";
31 include($dir."inc/header.inc.php");
33 $servers = unserialize(file_get_contents(dirname(__FILE__)."/sks_cache_status_collection.serialized"));
34 $status_collection = unserialize(file_get_contents(dirname(__FILE__)."/sks_cache_status_collection.serialized"));
35 $numkeys = $servers->get_numkey_history();
36 $stats = $status_collection->get_statistics_data();
37 $mk = (int)$stats['max_keys'];
39 ksort($numkeys);
41 function diff_by_days(&$data, $days=1)
43 $c = count($data);
44 $i = 1;
45 $d = $c - $days;
46 $start = 0;
47 $end = 0;
48 foreach($data as $k=>$v)
50 if($i==$d)
52 if($v != 0)
53 $start = $v;
54 else
55 $d++;
58 if($i==$c)
59 $end = $v;
61 $i++;
63 return ($end - $start);
66 function val_by_days(&$data, $days=1)
68 $c = count($data);
69 $i = 1;
70 $d = $c - $days;
71 $end = 0;
72 foreach($data as $k=>$v)
74 if($i==$c)
75 $end = $v;
77 $i++;
79 return ($end);
82 <h2>Statistics:</h2>
83 <table style="width: 570px;">
84 <tr><td>Keys added today (partial):</td><td style="text-align: right;"><?=number_format($mk - val_by_days($numkeys, 1));?></td></tr>
85 <tr><td>Keys added yesterday:</td><td style="text-align: right;"><?=number_format(diff_by_days($numkeys, 1));?></td></tr>
86 <tr><td>Keys added the past 7 days:</td><td style="text-align: right;"><?=number_format(diff_by_days($numkeys, 7));?></td></tr>
87 <tr><td>Keys added the past 30 days:</td><td style="text-align: right;"><?=number_format(diff_by_days($numkeys, 30));?></td></tr>
88 <tr><td>Keys added the past 180 days:</td><td style="text-align: right;"><?=number_format(diff_by_days($numkeys, 180));?></td></tr>
89 </table>
90 <p>Below is a chart showing the development in the number of total OpenPGP keys by day.</p>
91 <img src="generate_key_chart.php" alt="Total number of OpenPGP keys" />
92 <p>Below is a chart showing the development in the number of OpenPGP keys added by day.</p>
93 <img src="generate_key_bar_chart.php" alt="Number of OpenPGP keys added by day" />
95 include($dir."inc/footer.inc.php");