# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
1 Mauritania * 668 80 13.61% 6 31 8 34.78% 3 55 86 582 7 4.641% 36.047% 4,649,658 0.014% 0.013% 0.001%
2 Cabo Verde * 466 8 1.75% 41 5 1 25.00% 4 237 242 224 9 1.073% 2.066% 555,987 0.084% 0.040% 0.001% 0.002%
3 Venezuela * 1,662 152 10.07% 8 17 3 21.43% 4 302 319 1,343 1 1.023% 5.329% 28,435,940 0.006% 0.005%
4 Syria * 123 6 1 20.00% 4 50 56 67 4.878% 10.714% 17,500,658 0.001%
5 Oman * 12,799 576 4.71% 16 59 9 18.00% 5 2,812 2,871 9,928 12 0.461% 2.055% 5,106,626 0.251% 0.194% 0.001%
6 Ethiopia * 1,344 87 6.92% 11 14 2 16.67% 5 231 245 1,099 1.042% 5.714% 114,963,588 0.001% 0.001%
7 Maldives * 1,841 12 0.66% 106 7 1 16.67% 5 608 615 1,226 13 0.380% 1.138% 540,544 0.341% 0.227% 0.001% 0.002%
8 Armenia * 10,009 517 5.45% 14 158 19 13.67% 6 3,427 3,585 6,424 53 1.579% 4.407% 2,963,243 0.338% 0.217% 0.005% 0.002%
9 Bolivia * 10,531 549 5.50% 13 343 30 9.58% 8 1,137 1,480 9,051 29 3.257% 23.176% 11,673,021 0.090% 0.078% 0.003%
10 Iraq * 7,387 519 7.56% 10 235 20 9.30% 8 3,508 3,743 3,644 6 3.181% 6.278% 40,222,493 0.018% 0.009% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
11 Georgia * 796 2 0.25% 276 13 1 8.33% 9 634 647 149 3 1.633% 2.009% 3,989,167 0.020% 0.004%
12 Qatar * 60,259 1,826 3.12% 23 43 3 7.50% 10 36,036 36,079 24,180 15 0.071% 0.119% 2,881,053 2.092% 0.839% 0.001% 0.001%
13 Guatemala * 5,336 249 4.89% 15 116 8 7.41% 10 795 911 4,425 6 2.174% 12.733% 17,915,568 0.030% 0.025% 0.001%
14 Kazakhstan * 11,571 263 2.33% 31 44 3 7.32% 10 5,941 5,985 5,586 2 0.380% 0.735% 18,776,707 0.062% 0.030%
15 South Africa * 35,812 1,455 4.23% 17 755 50 7.09% 11 18,313 19,068 16,744 13 2.108% 3.960% 59,308,690 0.060% 0.028% 0.001%
16 Chile * 108,686 3,527 3.35% 22 1,188 75 6.74% 11 44,946 46,134 62,552 62 1.093% 2.575% 19,116,201 0.569% 0.327% 0.006%
17 Kyrgyzstan * 1,845 28 1.54% 46 17 1 6.25% 12 1,219 1,236 609 3 0.921% 1.375% 6,524,195 0.028% 0.009%
18 Ghana * 8,297 227 2.81% 25 38 2 5.56% 13 2,986 3,024 5,273 1 0.458% 1.257% 31,072,940 0.027% 0.017%
19 Bangladesh * 52,445 2,911 5.88% 13 709 37 5.51% 13 11,120 11,829 40,616 4 1.352% 5.994% 164,689,383 0.032% 0.025%
20 Pakistan * 76,398 3,938 5.43% 14 1,621 78 5.06% 15 27,110 28,731 47,667 7 2.122% 5.642% 220,892,340 0.035% 0.022% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
21 Egypt * 27,536 1,152 4.37% 17 1,052 47 4.68% 16 6,827 7,879 19,657 10 3.820% 13.352% 102,334,404 0.027% 0.019% 0.001%
22 Saudi Arabia * 89,011 1,869 2.14% 33 549 24 4.57% 16 65,790 66,339 22,672 16 0.617% 0.828% 34,813,871 0.256% 0.065% 0.002%
23 Uruguay * 825 2 0.24% 286 23 1 4.55% 16 689 712 113 7 2.788% 3.230% 3,473,730 0.024% 0.003% 0.001%
24 Azerbaijan * 5,935 273 4.82% 15 71 3 4.41% 17 3,564 3,635 2,300 7 1.196% 1.953% 10,139,177 0.059% 0.023% 0.001%
25 Sudan * 5,173 147 2.92% 25 298 12 4.20% 17 1,522 1,820 3,353 7 5.761% 16.374% 43,849,260 0.012% 0.008% 0.001%
26 Nigeria * 10,578 416 4.09% 18 299 12 4.18% 17 3,122 3,421 7,157 1 2.827% 8.740% 206,139,589 0.005% 0.003%
27 Djibouti * 3,779 210 5.88% 13 25 1 4.17% 17 1,607 1,632 2,147 25 0.662% 1.532% 988,000 0.382% 0.217% 0.003% 0.003%
28 India * 207,183 8,813 4.44% 16 5,829 221 3.94% 18 100,285 106,114 101,069 4 2.813% 5.493% 1,380,004,385 0.015% 0.007%
29 Russia * 423,741 8,863 2.14% 33 5,037 182 3.75% 19 186,985 192,022 231,719 35 1.189% 2.623% 145,934,462 0.290% 0.159% 0.003%
30 Liberia * 311 15 5.07% 15 28 1 3.70% 20 167 195 116 6 9.003% 14.359% 5,057,681 0.006% 0.002% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
31 Argentina * 17,415 564 3.35% 22 560 19 3.51% 21 5,709 6,269 11,146 12 3.216% 8.933% 45,195,774 0.039% 0.025% 0.001%
32 Brazil * 539,045 19,341 3.72% 19 30,486 952 3.22% 22 211,080 241,566 297,479 144 5.656% 12.620% 212,559,417 0.254% 0.140% 0.014%
33 Colombia * 30,493 1,110 3.78% 19 969 30 3.19% 23 9,661 10,630 19,863 19 3.178% 9.116% 50,882,891 0.060% 0.039% 0.002%
34 Kenya * 2,093 72 3.56% 20 71 2 2.90% 25 499 570 1,523 1 3.392% 12.456% 53,771,296 0.004% 0.003%
35 Bulgaria * 2,538 19 0.75% 93 144 4 2.86% 25 1,123 1,267 1,271 21 5.674% 11.365% 6,948,445 0.037% 0.018% 0.002%
36 Kuwait * 28,649 887 3.20% 23 226 6 2.73% 26 14,281 14,507 14,142 53 0.789% 1.558% 4,270,571 0.671% 0.331% 0.005% 0.001%
37 Dominican... * 17,752 180 1.02% 69 515 13 2.59% 28 11,075 11,590 6,162 48 2.901% 4.443% 10,847,910 0.164% 0.057% 0.005%
38 Mexico * 93,435 2,771 3.06% 24 10,167 237 2.39% 30 67,491 77,658 15,777 79 10.881% 13.092% 128,932,753 0.072% 0.012% 0.008%
39 Ecuador * 40,414 1,316 3.37% 21 3,438 80 2.38% 30 20,019 23,457 16,957 195 8.507% 14.657% 17,643,054 0.229% 0.096% 0.019% 0.001%
40 Panama * 13,837 374 2.78% 26 344 8 2.38% 30 9,514 9,858 3,979 80 2.486% 3.490% 4,314,767 0.321% 0.092% 0.008% 0.002%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
41 Senegal * 3,836 97 2.59% 28 43 1 2.38% 30 1,954 1,997 1,839 3 1.121% 2.153% 16,743,927 0.023% 0.011%
42 Honduras * 5,362 160 3.08% 23 217 5 2.36% 30 549 766 4,596 22 4.047% 28.329% 9,904,607 0.054% 0.046% 0.002%
43 Haiti * 2,226 102 4.80% 15 45 1 2.27% 31 24 69 2,157 4 2.022% 65.217% 11,402,528 0.020% 0.019%
44 Bosnia... * 2,535 11 0.44% 160 157 3 1.95% 36 1,910 2,067 468 48 6.193% 7.596% 3,280,819 0.077% 0.014% 0.005% 0.001%
45 Afghanistan * 16,492 742 4.71% 16 270 5 1.89% 38 1,450 1,720 14,772 7 1.637% 15.698% 38,928,346 0.042% 0.038% 0.001%
46 Israel 17,285 116 0.68% 103 290 5 1.75% 40 14,940 15,230 2,055 32 1.678% 1.904% 8,655,535 0.200% 0.024% 0.003%
47 Thailand * 3,083 1 0.03% 2,137 58 1 1.75% 40 2,966 3,024 59 1 1.881% 1.918% 69,799,978 0.004%
48 Poland * 24,395 230 0.95% 74 1,092 18 1.68% 42 11,726 12,818 11,577 29 4.476% 8.519% 37,846,611 0.064% 0.031% 0.003%
49 Niger * 960 2 65 1 1.56% 45 848 913 47 3 6.771% 7.119% 24,206,644 0.004%
50 Sweden * 38,589 775 2.05% 35 4,468 65 1.48% 48 4,468 34,121 443 11.578% 100.000% 10,099,265 0.382% 0.338% 0.044% 0.004%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
51 Lithuania * 1,682 4 0.24% 292 71 1 1.43% 49 1,249 1,320 362 26 4.221% 5.379% 2,722,289 0.062% 0.013% 0.003% 0.001%
52 Indonesia * 27,549 609 2.26% 32 1,663 22 1.34% 53 7,935 9,598 17,951 6 6.037% 17.327% 273,523,615 0.010% 0.007% 0.001%
53 Ukraine * 24,340 328 1.37% 52 727 9 1.25% 56 10,078 10,805 13,535 17 2.987% 6.728% 43,733,762 0.056% 0.031% 0.002%
54 Belarus * 44,255 852 1.96% 36 243 3 1.25% 56 19,195 19,438 24,817 26 0.549% 1.250% 9,449,323 0.468% 0.263% 0.003%
55 USA * 1,875,756 23,880 1.29% 55 1,133 107,878 1,260 1.18% 59 32 621,820 729,698 1,146,058 326 5.751% 14.784% 331,002,651 0.567% 0.346% 0.033%
56 UAE * 35,788 596 1.69% 42 269 3 1.13% 62 18,726 18,995 16,793 27 0.752% 1.416% 9,890,402 0.362% 0.170% 0.003%
57 Canada * 92,390 743 0.81% 86 7,395 70 0.96% 73 50,271 57,666 34,724 196 8.004% 12.824% 37,742,154 0.245% 0.092% 0.020% 0.001%
58 Hungary * 3,921 29 0.75% 94 532 5 0.95% 74 2,160 2,692 1,229 55 13.568% 19.762% 9,660,351 0.041% 0.013% 0.006% 0.001%
59 Romania * 19,517 119 0.61% 114 1,288 12 0.94% 75 13,526 14,814 4,703 67 6.599% 8.694% 19,237,691 0.101% 0.024% 0.007%
60 Algeria * 9,626 113 1.19% 59 667 6 0.91% 77 6,067 6,734 2,892 15 6.929% 9.905% 43,851,044 0.022% 0.007% 0.002%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
61 Portugal * 32,895 195 0.60% 117 1,436 12 0.84% 83 19,869 21,305 11,590 141 4.365% 6.740% 10,196,709 0.323% 0.114% 0.014% 0.001%
62 UK * 277,985 1,653 0.60% 117 39,369 324 0.83% 84 39,369 238,616 580 14.162% 100.000% 67,886,011 0.409% 0.351% 0.058% 0.001%
63 Iran * 157,562 3,117 2.02% 35 7,942 64 0.81% 86 123,077 131,019 26,543 95 5.041% 6.062% 83,992,949 0.188% 0.032% 0.009%
64 North... * 2,391 76 3.28% 22 141 1 0.71% 98 1,595 1,736 655 68 5.897% 8.122% 2,083,374 0.115% 0.031% 0.007% 0.003%
65 Denmark * 11,734 35 0.30% 233 580 4 0.69% 101 10,489 11,069 665 100 4.943% 5.240% 5,792,202 0.203% 0.011% 0.010% 0.002%
66 Moldova * 8,548 188 2.25% 32 307 2 0.66% 107 4,738 5,045 3,503 76 3.591% 6.085% 4,033,963 0.212% 0.087% 0.008% 0.002%
67 Finland * 6,887 2 0.03% 2,387 320 2 0.63% 111 5,500 5,820 1,067 58 4.646% 5.498% 5,540,720 0.124% 0.019% 0.006% 0.001%
68 Philippines 18,997 359 1.93% 37 966 6 0.63% 112 4,063 5,029 13,968 9 5.085% 19.209% 109,581,078 0.017% 0.013% 0.001%
69 Czechia * 9,334 48 0.52% 135 323 2 0.62% 112 6,681 7,004 2,330 30 3.460% 4.612% 10,708,981 0.087% 0.022% 0.003%
70 Cameroon * 6,585 188 2.94% 24 200 1 0.50% 139 3,676 3,876 2,709 8 3.037% 5.160% 26,545,863 0.025% 0.010% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
71 Morocco * 7,866 33 0.42% 165 206 1 0.49% 143 6,410 6,616 1,250 6 2.619% 3.114% 36,910,560 0.021% 0.003% 0.001%
72 Ireland * 25,066 4 0.02% 4,344 1,658 8 0.48% 144 22,089 23,747 1,319 336 6.615% 6.982% 4,937,786 0.508% 0.027% 0.034% 0.007%
73 Turkey * 165,555 786 0.48% 146 4,585 22 0.48% 145 129,921 134,506 31,049 54 2.769% 3.409% 84,339,067 0.196% 0.037% 0.005%
74 Norway * 8,452 10 0.12% 586 237 1 0.42% 164 7,727 7,964 488 44 2.804% 2.976% 5,421,241 0.156% 0.009% 0.004% 0.001%
75 Serbia * 11,454 24 0.21% 331 245 1 0.41% 170 6,766 7,011 4,443 28 2.139% 3.495% 8,737,371 0.131% 0.051% 0.003%
76 France * 189,220 28,940 107 0.37% 188 68,812 97,752 91,468 443 15.294% 29.606% 65,273,511 0.290% 0.140% 0.044% 0.001%
77 S. Korea * 11,541 38 0.33% 211 272 1 0.37% 189 10,446 10,718 823 5 2.357% 2.538% 51,269,185 0.023% 0.002% 0.001%
78 Germany * 184,064 320 0.17% 399 8,649 31 0.36% 194 166,400 175,049 9,015 103 4.699% 4.941% 83,783,942 0.220% 0.011% 0.010%
79 Belgium * 58,615 98 0.17% 415 9,505 19 0.20% 347 15,934 25,439 33,176 820 16.216% 37.364% 11,589,623 0.506% 0.286% 0.082% 0.007%
80 Italy * 233,515 318 0.14% 509 33,530 55 0.16% 423 160,092 193,622 39,893 555 14.359% 17.317% 60,461,826 0.386% 0.066% 0.055% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
81 Austria * 16,759 26 0.16% 447 669 1 0.15% 464 15,629 16,298 461 74 3.992% 4.105% 9,006,398 0.186% 0.005% 0.007% 0.001%
82 Japan * 16,884 33 0.20% 355 892 1 0.11% 618 14,502 15,394 1,490 7 5.283% 5.794% 126,476,461 0.013% 0.001% 0.001%
83 Netherlands * 46,647 102 0.22% 317 5,967 5 0.08% 827 5,967 40,680 348 12.792% 100.000% 17,134,872 0.272% 0.237% 0.035% 0.002%
84 Uzbekistan * 3,760 58 1.57% 45 15 2,908 2,923 837 0.399% 0.513% 33,469,203 0.011% 0.003%
85 Vatican City * 12 2 2 10 825 1.455% 1.212%
86 Ré... * 477 6 1.27% 55 1 411 412 65 1 0.210% 0.243% 895,312 0.053% 0.007%
87 Angola * 86 4 18 22 64 4.651% 18.182% 32,866,272
88 Botswana * 40 2 5.26% 14 1 23 24 16 2.500% 4.167% 2,351,627 0.002% 0.001%
89 Saint... * 15 15 15 53,199 0.028%
90 Saint Lucia * 18 18 18 183,627 0.010%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
91 Uganda * 489 32 7.00% 11 82 82 407 45,741,007 0.001% 0.001%
92 Nicaragua * 759 35 370 405 354 5 4.611% 8.642% 6,624,554 0.011% 0.005% 0.001%
93 Rwanda * 377 1 262 263 114 0.265% 0.380% 12,952,218 0.003% 0.001%
94 British... * 8 1 7 8 33 12.500% 12.500% 30,231 0.026% 0.003% 0.109%
95 Peru * 170,039 4,634 68,507 73,141 96,898 141 2.725% 6.336% 32,971,854 0.516% 0.294% 0.014%
96 Zambia * 1,089 7 912 919 170 0.643% 0.762% 18,383,955 0.006% 0.001%
97 Burkina Faso * 881 34 4.01% 18 53 720 773 108 3 6.016% 6.856% 20,903,273 0.004% 0.001%
98 Anguilla * 3 3 3 15,003 0.020%
99 Cambodia * 125 123 123 2 16,718,965 0.001%
100 Burundi * 63 1 33 34 29 1.587% 2.941% 11,890,784 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
101 Zimbabwe * 206 28 15.73% 5 4 29 33 173 1.942% 12.121% 14,862,924 0.001% 0.001%
102 Yemen * 354 84 14 98 256 3 23.729% 85.714% 29,825,964 0.001% 0.001%
103 Palestine * 451 2 0.45% 156 3 372 375 76 1 0.665% 0.800% 5,101,414 0.009% 0.001%
104 Saint Martin * 41 3 33 36 5 78 7.317% 8.333% 38,666 0.106% 0.013% 0.008% 0.202%
105 Paraguay * 1,013 18 1.81% 39 11 498 509 504 2 1.086% 2.161% 7,132,538 0.014% 0.007%
106 Papua New... * 8 8 8 8,947,024
107 Vietnam * 328 298 298 30 97,338,579
108 Brunei * 141 2 138 140 1 5 1.418% 1.429% 437,479 0.032% 0.001%
109 Western... * 9 1 6 7 2 2 11.111% 14.286% 597,339 0.002%
110 Albania * 1,164 21 1.84% 39 33 891 924 240 11 2.835% 3.571% 2,877,797 0.040% 0.008% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
111 Bhutan * 47 4 9.30% 8 9 9 38 771,608 0.006% 0.005%
112 Suriname * 54 25 89.29% 2 1 1 9 10 44 2 1.852% 10.000% 586,632 0.009% 0.008%
113 Benin * 244 12 5.17% 14 3 148 151 93 1.230% 1.987% 12,123,200 0.002% 0.001%
114 Bermuda * 141 1 0.71% 98 9 112 121 20 144 6.383% 7.438% 62,278 0.226% 0.032% 0.014% 0.231%
115 St.... * 26 15 15 11 110,940 0.023% 0.010%
116 Sri Lanka * 1,683 40 2.43% 29 11 823 834 849 1 0.654% 1.319% 21,413,249 0.008% 0.004%
117 St. Barth * 6 6 6 9,877 0.061%
118 Switzerland * 30,874 3 0.01% 7,134 1,920 28,500 30,420 454 222 6.219% 6.312% 8,654,622 0.357% 0.005% 0.022% 0.003%
119 Tunisia * 1,086 2 0.18% 377 48 965 1,013 73 4 4.420% 4.738% 11,818,619 0.009% 0.001%
120 Timor-Leste * 24 24 24 1,318,445 0.002%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
121 Togo * 445 2 0.45% 154 13 230 243 202 2 2.921% 5.350% 8,278,724 0.005% 0.002%
122 Belize * 18 2 16 18 5 11.111% 11.111% 397,628 0.005% 0.001% 0.001%
123 Tanzania * 509 21 183 204 305 4.126% 10.294% 59,734,218 0.001% 0.001%
124 Taiwan * 443 7 427 434 9 1.580% 1.613% 23,816,775 0.002%
125 Tajikistan * 4,100 87 2.17% 33 47 2,217 2,264 1,836 5 1.146% 2.076% 9,537,645 0.043% 0.019%
126 Spain * 287,012 294 0.10% 677 27,127 27,127 259,885 580 9.452% 100.000% 46,754,778 0.614% 0.556% 0.058% 0.001%
127 South Sudan * 994 10 6 16 978 1 1.006% 62.500% 11,193,725 0.009% 0.009%
128 Seychelles * 11 11 11 98,347 0.011%
129 Sierra Leone * 896 31 3.58% 20 46 480 526 370 6 5.134% 8.745% 7,976,983 0.011% 0.005% 0.001%
130 Trinidad... * 117 8 108 116 1 6 6.838% 6.897% 1,399,488 0.008% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
131 Barbados * 92 7 76 83 9 24 7.609% 8.434% 287,375 0.032% 0.003% 0.002% 0.008%
132 San Marino * 672 1 0.15% 466 42 384 426 246 1,238 6.250% 9.859% 33,931 1.980% 0.725% 0.124% 3.649%
133 Sao Tome... * 484 12 68 80 404 55 2.479% 15.000% 219,159 0.221% 0.184% 0.005% 0.025%
134 Singapore * 35,836 544 1.54% 46 24 23,175 23,199 12,637 4 0.067% 0.103% 5,850,342 0.613% 0.216%
135 Sint Maarten * 77 15 60 75 2 350 19.481% 20.000% 42,876 0.180% 0.005% 0.035% 0.816%
136 Turks and... * 12 1 11 12 26 8.333% 8.333% 38,717 0.031% 0.003% 0.067%
137 Andorra * 844 80 10.47% 7 51 733 784 60 660 6.043% 6.505% 77,265 1.092% 0.078% 0.066% 0.854%
138 Somalia * 2,089 66 3.26% 22 79 361 440 1,649 5 3.782% 17.955% 15,893,222 0.013% 0.010%
139 New Zealand * 1,504 22 1,481 1,503 1 4 1.463% 1.464% 4,822,233 0.031%
140 Slovakia * 1,522 28 1,372 1,400 122 5 1.840% 2.000% 5,459,642 0.028% 0.002% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
141 Slovenia * 1,475 2 0.14% 511 109 1,358 1,467 8 52 7.390% 7.430% 2,078,938 0.071% 0.005% 0.003%
142 Saint... * 1 1 1 5,794 0.017%
143 Montenegro * 324 9 315 324 14 2.778% 2.778% 628,066 0.052% 0.001% 0.002%
144 Gibraltar * 172 2 1.18% 60 151 151 21 33,691 0.511% 0.062%
145 Greece * 2,937 19 0.65% 107 179 1,374 1,553 1,384 17 6.095% 11.526% 10,423,054 0.028% 0.013% 0.002%
146 Greenland * 13 11 11 2 56,770 0.023% 0.004%
147 Congo * 611 20 179 199 412 4 3.273% 10.050% 5,518,087 0.011% 0.007%
148 Costa Rica * 1,105 21 1.94% 37 10 682 692 413 2 0.905% 1.445% 5,094,118 0.022% 0.008%
149 Gabon * 2,655 17 722 739 1,916 8 0.640% 2.300% 2,225,734 0.119% 0.086% 0.001%
150 Gambia * 25 1 20 21 4 4.000% 4.762% 2,416,668 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
151 Grenada * 23 18 18 5 112,523 0.020% 0.004%
152 Guadeloupe * 162 14 138 152 10 35 8.642% 9.211% 400,124 0.040% 0.002% 0.003% 0.009%
153 China * 83,022 5 0.01% 11,509 4,634 78,315 82,949 73 3 5.582% 5.587% 1,439,323,776 0.006%
154 Hong Kong * 1,094 6 0.55% 127 4 1,038 1,042 52 1 0.366% 0.384% 7,496,981 0.015% 0.001%
155 Iceland * 1,806 10 1,794 1,804 2 29 0.554% 0.554% 341,243 0.529% 0.001% 0.003% 0.008%
156 Comoros * 132 26 24.53% 4 2 27 29 103 2 1.515% 6.897% 869,601 0.015% 0.012%
157 Guyana * 153 12 70 82 71 15 7.843% 14.634% 786,552 0.019% 0.009% 0.002% 0.002%
158 Guinea * 3,886 42 1.09% 64 23 2,267 2,290 1,596 2 0.592% 1.004% 13,132,795 0.030% 0.012%
159 Guinea-Bi... * 1,339 8 53 61 1,278 4 0.597% 13.115% 1,968,001 0.068% 0.065%
160 French... * 60 60 60 280,908 0.021%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
161 French... * 517 18 3.61% 20 1 207 208 309 3 0.193% 0.481% 298,682 0.173% 0.103% 0.001%
162 DRC * 3,326 131 4.10% 18 72 482 554 2,772 1 2.165% 12.996% 89,561,403 0.004% 0.003%
163 Cuba * 2,092 9 0.43% 161 83 1,827 1,910 182 7 3.967% 4.346% 11,326,616 0.018% 0.002% 0.001%
164 Croatia * 2,246 103 2,088 2,191 55 25 4.586% 4.701% 4,105,267 0.055% 0.001% 0.003% 0.001%
165 Cura&cced... * 20 1 5.26% 14 1 15 16 4 6 5.000% 6.250% 164,093 0.012% 0.002% 0.001% 0.004%
166 Dominica * 18 2 12.50% 6 16 16 2 71,986 0.025% 0.003%
167 Diamond... * 712 13 651 664 48 1.826% 1.958% 3,711 19.186% 1.293% 0.350%
168 Cyprus * 952 3 0.32% 220 17 790 807 145 14 1.786% 2.107% 1,207,359 0.079% 0.012% 0.001% 0.001%
169 El Salvador * 2,653 71 2.75% 26 46 1,116 1,162 1,491 7 1.734% 3.959% 6,486,205 0.041% 0.023% 0.001%
170 Equatoria... * 1,306 12 200 212 1,094 9 0.919% 5.660% 1,402,985 0.093% 0.078% 0.001% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
171 Faeroe... * 187 187 187 48,863 0.383%
172 Falkland... * 13 13 13 3,480 0.374%
173 Fiji * 18 15 15 3 896,445 0.002%
174 Bahamas * 102 11 49 60 42 28 10.784% 18.333% 393,244 0.026% 0.011% 0.003% 0.007%
175 Eswatini * 294 1 0.34% 204 3 198 201 93 3 1.020% 1.493% 1,160,164 0.025% 0.008%
176 Eritrea * 39 39 39 3,546,421 0.001%
177 Estonia * 1,870 68 1,632 1,700 170 51 3.636% 4.000% 1,326,535 0.141% 0.013% 0.005% 0.004%
178 Bahrain * 12,311 440 3.71% 20 19 7,407 7,426 4,885 11 0.154% 0.256% 1,701,575 0.724% 0.287% 0.001% 0.001%
179 Isle of Man * 336 24 311 335 1 282 7.143% 7.164% 85,033 0.395% 0.001% 0.028% 0.332%
180 Martinique * 200 14 98 112 88 37 7.000% 12.500% 375,265 0.053% 0.023% 0.004% 0.010%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
181 Antigua... * 26 3 19 22 4 31 11.538% 13.636% 97,929 0.027% 0.004% 0.003% 0.032%
182 Mauritius * 335 10 322 332 3 8 2.985% 3.012% 1,271,768 0.026% 0.001% 0.001%
183 Malta * 620 1 0.16% 430 9 554 563 57 20 1.452% 1.599% 441,543 0.140% 0.013% 0.002% 0.005%
184 Mali * 1,351 36 2.74% 26 78 769 847 504 4 5.774% 9.209% 20,250,833 0.007% 0.002%
185 Madagascar * 845 19 2.30% 31 6 185 191 654 0.710% 3.141% 27,691,018 0.003% 0.002%
186 Malawi * 358 22 6.55% 11 4 42 46 312 1.117% 8.696% 19,129,952 0.002% 0.002%
187 Malaysia * 7,877 20 0.25% 273 115 6,470 6,585 1,292 4 1.460% 1.746% 32,365,999 0.024% 0.004%
188 Mayotte * 1,986 52 2.69% 27 24 1,473 1,497 489 88 1.208% 1.603% 272,815 0.728% 0.179% 0.009% 0.032%
189 Monaco * 99 4 90 94 5 102 4.040% 4.255% 39,242 0.252% 0.013% 0.010% 0.260%
190 Myanmar * 232 4 1.75% 40 6 143 149 83 2.586% 4.027% 54,409,800
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
191 Namibia * 25 16 16 9 2,540,905 0.001%
192 Nepal * 2,099 288 15.90% 5 8 266 274 1,825 0.381% 2.920% 29,136,808 0.007% 0.006%
193 MS Zaandam * 9 2 2 7 22.222% 100.000% 1,243 0.724% 0.563% 0.161%
194 Mozambique * 307 53 20.87% 4 2 98 100 207 0.651% 2.000% 31,255,435 0.001% 0.001%
195 Mongolia * 185 44 44 141 3,278,290 0.006% 0.004%
196 Montserrat * 11 1 10 11 200 9.091% 9.091% 4,992 0.220% 0.020% 4.006%
197 Macao * 45 45 45 649,335 0.007%
198 Luxembourg * 4,020 1 0.02% 2,787 110 3,848 3,958 62 176 2.736% 2.779% 625,978 0.642% 0.010% 0.018% 0.028%
199 Jordan * 755 9 1.21% 58 9 549 558 197 1 1.192% 1.613% 10,203,134 0.007% 0.002%
200 Aruba * 101 3 98 101 28 2.970% 2.970% 106,766 0.095% 0.003% 0.026%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
201 Chad * 803 13 1.65% 43 66 562 628 175 4 8.219% 10.510% 16,425,864 0.005% 0.001%
202 Jamaica * 588 2 0.34% 204 9 322 331 257 3 1.531% 2.719% 2,961,167 0.020% 0.009%
203 Ivory Coast * 3,024 73 2.47% 29 33 1,501 1,534 1,490 1 1.091% 2.151% 26,378,274 0.011% 0.006%
204 New... * 20 18 18 2 285,498 0.007% 0.001%
205 Channel... * 560 45 528 573 -13 259 8.036% 7.853% 173,863 0.322% -0.007% 0.026% 0.149%
206 Cayman... * 150 9 6.38% 12 1 75 76 74 15 0.667% 1.316% 65,722 0.228% 0.113% 0.002% 0.023%
207 Caribbean... * 7 7 7 26,223 0.027%
208 CAR * 1,069 4 23 27 1,042 1 0.374% 14.815% 4,829,767 0.022% 0.022%
209 Libya * 182 26 16.67% 5 5 52 57 125 1 2.747% 8.772% 6,871,292 0.003% 0.002%
210 Liechtens... * 82 1 55 56 26 26 1.220% 1.786% 38,128 0.215% 0.068% 0.003% 0.068%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,447,512 105,331 1.66% 43 1,136 380,625 4,373 1.16% 60 32 2,745,238 3,125,863 3,321,649 11,656 5.903% 12.177% 7,800,000,000 0.083% 0.043% 0.005%
211 Lesotho * 2 1 1 1 2,142,249
212 Lebanon * 1,242 9 0.73% 96 27 719 746 496 4 2.174% 3.619% 6,825,445 0.018% 0.007%
213 Laos * 19 16 16 3 7,275,560
214 Latvia * 1,071 5 0.47% 149 24 760 784 287 13 2.241% 3.061% 1,886,198 0.057% 0.015% 0.001% 0.001%
215 Australia * 7,221 17 0.24% 295 102 -1 -0.97% 6,626 6,728 493 4 1.413% 1.516% 25,499,884 0.028% 0.002%
Running Time: 69.285 milliseconds, this hour: 20.


PHP Source Code


<?php
/*------------------------------------------------------------*/
class Corona extends Mcontroller {
    
/*------------------------------------------------------------*/
    
protected $coronaUtils;
    protected 
$Mmemcache;
    
/*------------------------------*/
    
private $startTime;
    private 
$ttl;
    
/*------------------------------------------------------------*/
    
public function __construct() {
        
parent::__construct();
        
$this->coronaUtils = new CoronaUtils;
        
$this->Mmemcache = new Mmemcache;
        
$this->ttl 300;
    }
    
/*------------------------------------------------------------*/
    /*------------------------------------------------------------*/
    
protected function before() {
        
$this->startTime microtime(true);
        
ini_set('max_execution_time'10);
        
ini_set("memory_limit""30M");

        
$this->coronaUtils->prior($this->controller$this->action);
        
$this->cacheQps();
        
$this->Mview->assign(array(
            
'controller' => $this->controller,
            
'action' => $this->action,
        ));
        
$this->Mview->showTpl("head.tpl");
        
$this->Mview->showTpl("header.tpl");
    }
    
/*------------------------------*/
    
protected function after() {
        
$endTime microtime(true);
        
$time $endTime $this->startTime ;
        
$millis $time 1000;
        
$millis round($millis3);
        
$qpsString $this->qpsString();

        
$this->Mview->msg("Running Time: $millis milliseconds$qpsString.");
        
$a '<br /><br /><a name="viewSource"><h4>PHP Source Code</h4></a><br />';
        
$this->Mview->pushOutput($a);
        
$src highlight_file(__FILE__true);
        
$this->Mview->pushOutput($src);
        
$this->Mview->showTpl("footer.tpl");
        
$this->Mview->showTpl("foot.tpl");
    }
    
/*------------------------------------------------------------*/
    /*------------------------------------------------------------*/
    
public function index() {
        
$this->showBy();
    }
    
/*------------------------------------------------------------*/
    
public function showBy() {
        
$by = @$_REQUEST['by'];
        if ( ! 
$by )
            
$by "cases";
        
$rows $this->getRows();
        if ( ! 
$rows ) {
            
$this->Mview->msg("No Rows");
            return;
        }
        
$ucfirst ucfirst($by);
        
usort($rows, array($this"by$ucfirst"));
        
$totals = array(
            
'country' => "World",
            
'cases' => Mutils::arraySum($rows"cases"),
            
'dbyCases' => Mutils::arraySum($rows"dbyCases"),
            
'yesterday' => Mutils::arraySum($rows"yesterday"),
            
'today' => Mutils::arraySum($rows"today"),
            
'deaths' => Mutils::arraySum($rows"deaths"),
            
'dbyDeaths' => Mutils::arraySum($rows"dbyDeaths"),
            
'deathsYesterday' => Mutils::arraySum($rows"deathsYesterday"),
            
'testsYesterday' => Mutils::arraySum($rows"testsYesterday"),
            
'deathsToday' => Mutils::arraySum($rows"deathsToday"),
            
'recovered' => Mutils::arraySum($rows"recovered"),
            
'tests' => Mutils::arraySum($rows"tests"),
            
'yActive' => Mutils::arraySum($rows"yActive"),
            
'activeDelta' => Mutils::arraySum($rows"activeDelta"),
        );
        
$this->ammendRow($totals);
        
$totals['growth'] = ($totals['yesterday']/$totals['dbyCases']) * 100;
        
$totals['doubles'] = $this->doubles($totals['growth']);
        
$totals['deathsGrowth'] = ($totals['deathsYesterday']/$totals['dbyDeaths']) * 100;
        
$totals['deathsDoubles'] = $this->doubles($totals['deathsGrowth']);
        
$this->Mview->showTpl("corona.tpl", array(
            
'rows' => $rows,
            
'totals' => $totals,
            
'by' => $by,
            
'myCountry' => @$_COOKIE['myCountry'],
        ));
    }
    
/*------------------------------------------------------------*/
    
public function legend() {
        
$this->Mview->showTpl("legend.tpl");
    }
    
/*------------------------------------------------------------*/
    
public function myCountry() {
        
$country $_REQUEST['country'];
        
$this->Mview->setCookie("myCountry"$country);
        
$this->redirect("/");
    }
    
/*------------------------------------------------------------*/
    /*------------------------------------------------------------*/
    
private function getRows() {
        
$date date("Y-m-d");
        
$mkey "getRows-$date";
        
$rows $this->Mmemcache->get($mkey);
        if ( 
$rows )
            return(
$rows);
        
$sql "select * from covid19 where date = '$date'";
        
$rows $this->Mmodel->getRows($sql$this->ttl);
        if ( ! 
$rows ) {
            return(
null);
        }
        
$this->ammendRows($rows);
        
$this->Mmemcache->set($mkey$rows$this->ttl);
        return(
$rows);
    }
    
/*------------------------------------------------------------*/
    
private function ammendRows(&$rows) {
        foreach ( 
$rows as $key => $row )
            
$this->ammendRow($rows[$key]);
    }
    
/*------------------------------*/
    
private function ammendRow(&$row) {
        
$dby date("Y-m-d"time() - 2*24*3600);
        
$yesterday date("Y-m-d"time() - 24*3600);
        
$country $row['country'];
        if ( 
$country != 'World' ) {
            
$row['dbyCases'] = $this->metric($country$dby'cases');
            
$row['yCases'] = $this->metric($country$yesterday'cases');
            
$row['yRecovered'] = $this->metric($country$yesterday'recovered');
            
$row['dbyRecovered'] = $this->metric($country$dby'recovered');
            
$row['dbyDeaths'] = $this->metric($country$dby'deaths');
            
$row['yDeaths']  = $this->metric($country$yesterday'deaths');
            
$row['yClosed'] = $row['yRecovered'] + $row['yDeaths'];
            
$row['dbyClosed'] = $row['dbyRecovered'] + $row['dbyDeaths'];
            
$row['dbyTests'] = $this->metric($country$dby'tests');
            
$row['yTests'] = $this->metric($country$yesterday'tests');

            
$row['yesterday'] = $row['yCases'] - $row['dbyCases'];
            
$row['growth'] = $row['dbyCases'] ? ($row['yesterday']/$row['dbyCases']) * 100 0;
            
$row['doubles'] = $this->doubles($row['growth']);
            
$row['today'] = $row['cases'] - $row['yCases'];
            
$row['closed'] = $row['recovered'] + $row['deaths'];
            
$row['active'] = $row['cases'] - $row['closed'];
            
$row['dbyActive'] = $row['dbyCases'] - $row['dbyClosed'];
            
$row['yActive'] = $row['yCases'] - $row['yClosed'];
            
$row['activeDelta'] = $row['yActive'] - $row['dbyActive'];
            
$row['deathsYesterday'] = $row['yDeaths']- $row['dbyDeaths'];
            
$row['testsYesterday'] = $row['yTests'] - $row['dbyTests'];
            
$row['deathsGrowth'] = $row['dbyDeaths'] ? ($row['deathsYesterday']/$row['dbyDeaths']) * 100 0;
            
$row['deathsDoubles'] = $this->doubles($row['deathsGrowth']);
            
$row['deathsToday'] = $row['deaths'] - $row['yDeaths'];
            
/*    Mview::print_r($row, "row", basename(__FILE__), __LINE__, null, false);    */
        
}

        
$row['closed'] = $row['recovered'] + $row['deaths'];
        
$row['active'] = $row['cases'] - $row['closed'];
        
$row['casesDeathRate'] =
            
$row['cases'] ?
                ( 
$row['deaths'] / $row['cases'] ) * 100
                
0;
        
$row['closedDeathRate'] =
            
$row['closed'] ?
                ( 
$row['deaths'] / $row['closed'] ) * 100
                
0;
        
$population $this->population($row['country']);
        if ( 
$population ) {
            
$row['population'] = $population ;
            
$row['casesRate'] = 
                ( 
$row['cases'] / $population ) * 100 ;
            
$row['activeRate'] = 
                ( 
$row['active'] / $population ) * 100 ;
            
$row['populationDeathRate'] =
                ( 
$row['deaths'] / $population ) * 100 ;
            
$row['testRate'] = 
                ( 
$row['tests'] / $population ) * 100 ;
        } else {
            
$row['population'] = ;
            
$row['populationDeathRate'] = 0;
            
$row['casesRate'] = 0;
            
$row['activeRate'] = 0;
            
$row['testRate'] = 0;
        }
    }
    
/*------------------------------------------------------------*/
    // sort functions = /showBy?by=funcName
    /*------------------------------*/
    
private function cmp($a$b) {
        return(
$a $b : ( $a $b ? -) );
    }
    
/*------------------------------*/
    /*------------------------------*/
    
private function byCases($b$a) {
        return(
$this->cmp($a['cases'], $b['cases']));
    }
    
/*------------------------------*/
    
private function byYesterday($b$a) {
        return(
$this->cmp($a['yesterday'], $b['yesterday']));
    }
    
/*------------------------------*/
    
private function byGrowth($b$a) {
        return(
$this->cmp($a['growth'], $b['growth']));
    }
    
/*------------------------------*/
    
private function byToday($b$a) {
        return(
$this->cmp($a['today'], $b['today']));
    }
    
/*------------------------------*/
    
private function byDeaths($b$a) {
        return(
$this->cmp($a['deaths'], $b['deaths']));
    }
    
/*------------------------------*/
    
private function byDeathsYesterday($b$a) {
        return(
$this->cmp($a['deathsYesterday'], $b['deathsYesterday']));
    }
    
/*------------------------------*/
    
private function byTestsYesterday($b$a) {
        return(
$this->cmp($a['testsYesterday'], $b['testsYesterday']));
    }
    
/*------------------------------*/
    
private function byDeathsGrowth($b$a) {
        return(
$this->cmp($a['deathsGrowth'], $b['deathsGrowth']));
    }
    
/*------------------------------*/
    
private function byDeathsToday($b$a) {
        return(
$this->cmp($a['deathsToday'], $b['deathsToday']));
    }
    
/*------------------------------*/
    
private function byRecovered($b$a) {
        return(
$this->cmp($a['recovered'], $b['recovered']));
    }
    
/*------------------------------*/
    
private function byActive($b$a) {
        return(
$this->cmp($a['active'], $b['active']));
    }
    
/*------------------------------*/
    
private function byActiveDelta($b$a) {
        return(
$this->cmp($a['activeDelta'], $b['activeDelta']));
    }
    
/*------------------------------*/
    
private function byYactive($b$a) {
        return(
$this->cmp($a['yActive'], $b['yActive']));
    }
    
/*------------------------------*/
    
private function byCasesRate($b$a) {
        return(
$this->cmp($a['casesRate'], $b['casesRate']));
    }
    
/*------------------------------*/
    
private function byActiveRate($b$a) {
        return(
$this->cmp($a['activeRate'], $b['activeRate']));
    }
    
/*------------------------------*/
    
private function byClosed($b$a) {
        return(
$this->cmp($a['closed'], $b['closed']));
    }
    
/*------------------------------*/
    
private function byPopulation($b$a) {
        return(
$this->cmp($a['population'], $b['population']));
    }
    
/*------------------------------*/
    
private function byCasesDeathRate($b$a) {
        return(
$this->cmp($a['casesDeathRate'], $b['casesDeathRate']));
    }
    
/*------------------------------*/
    
private function byClosedDeathRate($b$a) {
        return(
$this->cmp($a['closedDeathRate'], $b['closedDeathRate']));
    }
    
/*------------------------------*/
    
private function byTestRate($b$a) {
        return(
$this->cmp($a['testRate'], $b['testRate']));
    }
    
/*------------------------------*/
    
private function byTests($b$a) {
        return(
$this->cmp($a['tests'], $b['tests']));
    }
    
/*------------------------------*/
    
private function byPopulationDeathRate($b$a) {
        return(
$this->cmp($a['populationDeathRate'], $b['populationDeathRate']));
    }
    
/*------------------------------------------------------------*/
    
private function population($country) {
        if ( 
$country == 'World' )
            return(
$this->worldPopulation());
        
$sql "select population from populations where country = '$country'";
        
$population $this->Mmodel->getInt($sql$this->ttl);
        if ( ! 
$population ) {
            
error_log("population: missing: $country");
            return(
null);
        }
        return(
$population);
    }
    
/*------------------------------------------------------------*/
    
private function qpsKeys() {
        return(array(
            array(
                
'title' => 'this second',
                
'key' => "qps-".date("Y-m-d H:i:s"),
                
'ttl' => 3,
            ),
            array(
                
'title' => 'this minute',
                
'key' => "qpm-".date("Y-m-d H:i"),
                
'ttl' => 70,
            ),
            array(
                
'title' => 'this hour',
                
'key' => "qph-".date("Y-m-d H"),
                
'ttl' => 3700,
            ),
            array(
                
'title' => 'today',
                
'key' => "qpd-".date("Y-m-d"),
                
'ttl' => 25*3600,
            ),
        ));
    }
    
/*------------------------------*/
    
private function cacheQps() {
        foreach ( 
$this->qpsKeys() as $key )
            
$this->Mmemcache->increment($key['key'], $key['ttl']);
    }
    
/*------------------------------*/
    
private function qpsString() {
        
$min 3;
        foreach ( 
$this->qpsKeys() as $key ) {
            
$cnt $this->Mmemcache->rawGet($key['key']);
            if ( 
$cnt $min ) {
                
$title $key['title'];
                return(
", $title$cnt");
            }
        }
        return(
"");
    }
    
/*------------------------------------------------------------*/
    
private function worldPopulation() {
        
$key "worldPopulation";
        
$worldPopulation $this->Mmemcache->get($key);
        if ( 
$worldPopulation )
            return(
$worldPopulation);
        
$worldPopulation $this->scrapeWorldPopulation();
        
$this->Mmemcache->set($key$worldPopulation900);
        return(
$worldPopulation);
    }
    
/*------------------------------------------------------------*/
    
private function scrapeWorldPopulation() {
        return(
7.8*1000*1000*1000);
    }
    
/*------------------------------------------------------------*/
    
private function metric($country$date$metric) {
        static 
$cache = array();
        if ( ! @
$cache[$date] ) {
            
$sql "select * from covid19 where date = '$date'";
            
$rows $this->Mmodel->getRows($sql$this->ttl);
            
$indexed Mutils::reindexBy($rows'country');
            
$cache[$date] = $indexed;
        }
        
$metric = @$cache[$date][$country][$metric];
        if ( ! 
$metric ) {
            
/*    error_log("metric($country, $date, $metric) - missing");    */
            
return(0);
        }
        return(
$metric);
    }
    
/*------------------------------------------------------------*/
    
private function doubles($growth) {
        if ( 
$growth == )
            return(
0);
        if ( 
$growth 100 )
            return(
0);
        
$base $growth/100;
        if ( 
$base <= 1.0 )
            return(
0);
        
$numdays 1;
        
$double $base;
        while ( 
$double ) {
            
$double $double $base;
            
$numdays++;
        }
        return(
$numdays);
    }
    
/*------------------------------------------------------------*/
}


© Ohad Aloni 2020