# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
1 MS Zaandam * 9 2 2 7 22.222% 100.000% 1,243 0.724% 0.563% 0.161%
2 Yemen * 278 7 2.81% 26 22 57 4 8.16% 9 4 11 68 210 120 20.504% 83.824% 29,825,964 0.001% 0.001%
3 Sint Maarten * 77 15 60 75 2 438 19.481% 20.000% 42,876 0.180% 0.005% 0.035% 1.022%
4 Belgium * 57,849 137 0.24% 292 257 9,388 30 0.32% 217 24 15,572 24,960 32,889 818,807 16.228% 37.612% 11,589,623 0.499% 0.284% 0.081% 7.065%
5 France * 186,238 191 0.10% 664 3,325 28,662 66 0.23% 300 66 67,191 95,853 90,385 1,384,633 15.390% 29.902% 65,273,511 0.285% 0.138% 0.044% 2.121%
6 Italy * 231,732 584 0.25% 274 593 33,142 117 0.36% 196 70 150,604 183,746 47,986 3,683,144 14.302% 18.037% 60,461,826 0.383% 0.079% 0.055% 6.092%
7 UK * 269,127 2,013 0.76% 92 1,887 37,837 412 1.11% 63 377 37,837 231,290 3,918,079 14.059% 100.000% 67,886,011 0.396% 0.341% 0.056% 5.772%
8 Hungary * 3,816 22 0.58% 120 23 509 6 1.20% 58 4 1,996 2,505 1,311 174,011 13.339% 20.319% 9,660,351 0.040% 0.014% 0.005% 1.801%
9 Netherlands * 45,950 190 0.42% 167 182 5,903 15 0.26% 271 32 5,903 40,047 342,681 12.847% 100.000% 17,134,872 0.268% 0.234% 0.034% 2.000%
10 British... * 8 1 7 8 167 12.500% 12.500% 30,231 0.026% 0.003% 0.552%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
11 Antigua... * 25 3 19 22 3 183 12.000% 13.636% 97,929 0.026% 0.003% 0.003% 0.187%
12 Sweden * 35,727 648 1.88% 38 639 4,266 95 2.30% 31 46 4,971 9,237 26,490 238,800 11.941% 46.184% 10,099,265 0.354% 0.262% 0.042% 2.365%
13 Belize * 18 2 16 18 1,517 11.111% 11.111% 397,628 0.005% 0.001% 0.382%
14 Western... * 9 1 6 7 2 11.111% 14.286% 597,339 0.002%
15 Mexico * 78,023 3,455 4.86% 15 3,463 8,597 501 6.56% 11 463 54,383 62,980 15,043 244,858 11.019% 13.650% 128,932,753 0.061% 0.012% 0.007% 0.190%
16 Bahamas * 100 11 46 57 43 2,043 11.000% 19.298% 393,244 0.025% 0.011% 0.003% 0.520%
17 Liberia * 269 3 27 1 3.85% 19 144 171 98 10.037% 15.789% 5,057,681 0.005% 0.002% 0.001%
18 Spain * 284,986 510 0.18% 386 1,137 27,119 1 18,797 1 196,958 224,077 60,909 3,556,567 9.516% 12.103% 46,754,778 0.610% 0.130% 0.058% 7.607%
19 Montserrat * 11 1 10 11 36 9.091% 9.091% 4,992 0.220% 0.020% 0.721%
20 Chad * 726 15 2.14% 33 11 65 2 3.23% 22 1 413 478 248 8.953% 13.598% 16,425,864 0.004% 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 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
21 Guadeloupe * 161 14 115 129 32 3,573 8.696% 10.853% 400,124 0.040% 0.008% 0.003% 0.893%
22 Ecuador * 38,471 748 2.00% 35 368 3,313 72 2.25% 32 38 18,425 21,738 16,733 110,812 8.612% 15.241% 17,643,054 0.218% 0.095% 0.019% 0.628%
23 Suriname * 12 1 1 9 10 2 782 8.333% 10.000% 586,632 0.002% 0.133%
24 Turks and... * 12 1 10 11 1 129 8.333% 9.091% 38,717 0.031% 0.003% 0.003% 0.333%
25 Channel... * 560 1 0.18% 388 45 512 557 3 10,255 8.036% 8.079% 173,863 0.322% 0.002% 0.026% 5.898%
26 Guyana * 139 11 67 78 61 1,500 7.914% 14.103% 786,552 0.018% 0.008% 0.001% 0.191%
27 Canada * 88,473 867 1.00% 70 992 6,873 123 1.85% 38 113 46,768 53,641 34,832 1,559,280 7.768% 12.813% 37,742,154 0.234% 0.092% 0.018% 4.131%
28 Barbados * 92 7 76 83 9 5,038 7.609% 8.434% 287,375 0.032% 0.003% 0.002% 1.753%
29 Saint Martin * 40 3 33 36 4 553 7.500% 8.333% 38,666 0.103% 0.010% 0.008% 1.430%
30 Slovenia * 1,473 2 0.14% 510 2 108 1,356 1,464 9 78,578 7.332% 7.377% 2,078,938 0.071% 0.005% 3.780%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
31 Isle of Man * 336 24 306 330 6 4,732 7.143% 7.273% 85,033 0.395% 0.007% 0.028% 5.565%
32 Martinique * 197 14 91 105 92 7.107% 13.333% 375,265 0.052% 0.025% 0.004%
33 Algeria * 8,997 160 1.84% 39 140 630 6 0.97% 72 7 5,277 5,907 3,090 7.002% 10.665% 43,851,044 0.021% 0.007% 0.001%
34 Trinidad... * 116 8 108 116 3,091 6.897% 6.897% 1,399,488 0.008% 0.001% 0.221%
35 Niger * 955 3 64 1 796 860 95 5,989 6.702% 7.442% 24,206,644 0.004% 0.025%
36 Andorra * 763 51 681 732 31 3,750 6.684% 6.967% 77,265 0.988% 0.040% 0.066% 4.853%
37 Ireland * 24,841 68 0.27% 253 38 1,639 16 0.99% 71 8 22,089 23,728 1,113 325,795 6.598% 6.907% 4,937,786 0.503% 0.023% 0.033% 6.598%
38 Romania * 18,791 165 0.90% 78 197 1,235 11 0.90% 77 8 12,629 13,864 4,927 410,000 6.572% 8.908% 19,237,691 0.098% 0.026% 0.006% 2.131%
39 Bermuda * 139 6 4.51% 16 9 91 100 39 6,826 6.475% 9.000% 62,278 0.223% 0.063% 0.014% 10.961%
40 San Marino * 670 1 0.15% 462 3 42 322 364 306 4,303 6.269% 11.538% 33,931 1.975% 0.902% 0.124% 12.682%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
41 Burkina Faso * 847 13 1.56% 45 2 53 1 1.92% 37 719 772 75 6.257% 6.865% 20,903,273 0.004%
42 Switzerland * 30,796 15 0.05% 1,422 20 1,919 2 0.10% 665 2 28,300 30,219 577 385,822 6.231% 6.350% 8,654,622 0.356% 0.007% 0.022% 4.458%
43 Bosnia... * 2,462 19 0.79% 89 27 153 2 1.34% 52 2 1,781 1,934 528 62,567 6.214% 7.911% 3,280,819 0.075% 0.016% 0.005% 1.907%
44 Brazil * 419,340 21,852 5.78% 13 19,708 25,945 1,413 5.98% 12 910 192,302 218,247 201,093 871,839 6.187% 11.888% 212,559,417 0.197% 0.095% 0.012% 0.410%
45 Indonesia * 24,538 686 2.96% 24 687 1,496 55 3.88% 19 23 6,240 7,736 16,802 289,906 6.097% 19.338% 273,523,615 0.009% 0.006% 0.001% 0.106%
46 Mali * 1,194 39 3.62% 20 78 72 2 652 724 470 3,483 6.030% 9.945% 20,250,833 0.006% 0.002% 0.017%
47 Greece * 2,906 11 0.38% 183 3 175 2 1,374 1,549 1,357 170,467 6.022% 11.298% 10,423,054 0.028% 0.013% 0.002% 1.635%
48 Philippines 15,588 380 2.59% 28 539 921 18 2.03% 35 17 3,598 4,519 11,069 323,819 5.908% 20.381% 109,581,078 0.014% 0.010% 0.001% 0.296%
49 USA * 1,761,762 21,030 1.22% 58 21,068 103,112 1,362 1.36% 52 1,351 494,724 597,836 1,163,926 16,231,514 5.853% 17.248% 331,002,651 0.532% 0.352% 0.031% 4.904%
50 North... * 2,077 25 1.24% 57 38 121 3 2.59% 28 2 1,486 1,607 470 27,023 5.826% 7.530% 2,083,374 0.100% 0.023% 0.006% 1.297%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
51 Angola * 71 1 1.43% 49 4 18 22 49 10,000 5.634% 18.182% 32,866,272 0.030%
52 China * 82,995 1 57,527 2 4,634 78,288 82,922 73 5.583% 5.588% 1,439,323,776 0.006%
53 Cura&cced... * 18 1 14 15 3 572 5.556% 6.667% 164,093 0.011% 0.002% 0.001% 0.349%
54 Sierra Leone * 812 28 3.71% 20 30 45 1 2.27% 31 361 406 406 5.542% 11.084% 7,976,983 0.010% 0.005% 0.001%
55 Mauritania * 346 24 8.96% 9 54 19 3 23.08% 4 3 15 34 312 2,583 5.491% 55.882% 4,649,658 0.007% 0.007% 0.056%
56 Bulgaria * 2,477 17 0.70% 100 17 134 3 2.31% 31 1 965 1,099 1,378 77,664 5.410% 12.193% 6,948,445 0.036% 0.020% 0.002% 1.118%
57 Iran * 143,849 2,080 1.49% 47 2,258 7,627 56 0.75% 94 63 112,988 120,615 23,234 876,492 5.302% 6.323% 83,992,949 0.171% 0.028% 0.009% 1.044%
58 Japan * 16,651 28 858 12 13,973 14,831 1,820 278,642 5.153% 5.785% 126,476,461 0.013% 0.001% 0.001% 0.220%
59 Denmark * 11,512 52 0.46% 153 32 568 2 0.36% 196 3 10,180 10,748 764 583,052 4.934% 5.285% 5,792,202 0.199% 0.013% 0.010% 10.066%
60 Germany * 182,452 607 0.33% 208 557 8,570 35 0.41% 169 37 163,200 171,770 10,682 3,952,971 4.697% 4.989% 83,783,942 0.218% 0.013% 0.010% 4.718%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
61 Finland * 6,743 64 0.97% 73 51 313 1 0.32% 217 5,500 5,813 930 176,650 4.642% 5.384% 5,540,720 0.122% 0.017% 0.006% 3.188%
62 Nicaragua * 759 35 370 405 354 4.611% 8.642% 6,624,554 0.011% 0.005% 0.001%
63 Poland * 22,825 399 1.81% 39 352 1,038 4 0.39% 178 10 10,560 11,598 11,227 846,732 4.548% 8.950% 37,846,611 0.060% 0.030% 0.003% 2.237%
64 Croatia * 2,245 1 102 1 2,051 2,153 92 65,094 4.543% 4.738% 4,105,267 0.055% 0.002% 0.002% 1.586%
65 Tunisia * 1,068 17 48 938 986 82 49,951 4.494% 4.868% 11,818,619 0.009% 0.001% 0.423%
66 Sudan * 4,346 170 4.28% 17 200 195 14 8.24% 9 11 749 944 3,402 401 4.487% 20.657% 43,849,260 0.010% 0.008% 0.001%
67 Portugal * 31,596 285 0.92% 76 304 1,369 14 1.04% 67 13 18,637 20,006 11,590 778,698 4.333% 6.843% 10,196,709 0.310% 0.114% 0.013% 7.637%
68 Honduras * 4,640 212 5.06% 15 239 194 6 3.30% 22 6 506 700 3,940 14,790 4.181% 27.714% 9,904,607 0.047% 0.040% 0.002% 0.149%
69 Cuba * 1,983 11 0.56% 125 9 82 1,734 1,816 167 99,745 4.135% 4.515% 11,326,616 0.018% 0.001% 0.001% 0.881%
70 Tanzania * 509 21 183 204 305 4.126% 10.294% 59,734,218 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 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
71 Lithuania * 1,656 8 0.49% 143 9 68 1 1.54% 46 2 1,193 1,261 395 287,982 4.106% 5.393% 2,722,289 0.061% 0.015% 0.002% 10.579%
72 Monaco * 98 4 90 94 4 4.082% 4.255% 39,242 0.250% 0.010% 0.010%
73 Egypt * 20,793 910 4.85% 15 1,127 845 19 2.38% 30 29 5,359 6,204 14,589 135,000 4.064% 13.620% 102,334,404 0.020% 0.014% 0.001% 0.132%
74 Libya * 99 22 28.57% 3 4 1 33.33% 3 40 44 55 5,154 4.040% 9.091% 6,871,292 0.001% 0.001% 0.075%
75 Austria * 16,628 34 0.21% 338 37 668 2 0.31% 224 23 15,286 15,954 674 427,372 4.017% 4.187% 9,006,398 0.185% 0.007% 0.007% 4.745%
76 Gambia * 25 1 19 20 5 1,730 4.000% 5.000% 2,416,668 0.001% 0.072%
77 Somalia * 1,828 20 1.17% 60 97 72 5 310 382 1,446 3.939% 18.848% 15,893,222 0.012% 0.009%
78 Moldova * 7,725 232 3.18% 23 188 282 7 2.62% 27 8 4,123 4,405 3,320 40,565 3.650% 6.402% 4,033,963 0.191% 0.082% 0.007% 1.006%
79 Bolivia * 7,768 476 7.15% 11 632 280 13 4.98% 15 6 689 969 6,799 22,294 3.605% 28.896% 11,673,021 0.067% 0.058% 0.002% 0.191%
80 Argentina * 13,933 600 4.75% 15 705 501 21 4.46% 16 9 4,617 5,118 8,815 145,081 3.596% 9.789% 45,195,774 0.031% 0.020% 0.001% 0.321%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
81 Kenya * 1,618 123 9.12% 8 147 58 3 5.77% 13 3 421 479 1,139 70,172 3.585% 12.109% 53,771,296 0.003% 0.002% 0.131%
82 Estonia * 1,851 6 0.33% 213 11 66 1 1.54% 46 1,574 1,640 211 80,724 3.566% 4.024% 1,326,535 0.140% 0.016% 0.005% 6.085%
83 Czechia * 9,134 35 0.39% 180 65 318 1 6,457 6,775 2,359 424,423 3.481% 4.694% 10,708,981 0.085% 0.022% 0.003% 3.963%
84 Colombia * 24,104 1,022 4.65% 16 1,101 803 26 3.47% 21 27 6,111 6,914 17,190 283,346 3.331% 11.614% 50,882,891 0.047% 0.034% 0.002% 0.557%
85 Congo * 571 84 17.25% 5 19 3 18.75% 5 161 180 391 3.327% 10.556% 5,518,087 0.010% 0.007%
86 Iraq * 5,457 287 5.92% 13 322 179 6 3.55% 20 4 2,971 3,150 2,307 211,485 3.280% 5.683% 40,222,493 0.014% 0.006% 0.526%
87 Syria * 122 1 4 43 47 75 3.279% 8.511% 17,500,658 0.001%
88 Cameroon * 5,436 392 7.77% 10 175 4 2.34% 30 1,996 2,171 3,265 3.219% 8.061% 26,545,863 0.020% 0.012% 0.001%
89 Togo * 422 9 2.33% 31 27 13 197 210 212 18,696 3.081% 6.190% 8,278,724 0.005% 0.003% 0.226%
90 Albania * 1,076 21 2.04% 35 26 33 823 856 220 13,993 3.067% 3.855% 2,877,797 0.037% 0.008% 0.001% 0.486%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
91 Zimbabwe * 132 76 135.71% 4 25 29 103 37,039 3.030% 13.793% 14,862,924 0.001% 0.001% 0.249%
92 Dominican... * 16,068 459 3.01% 24 345 485 6 1.28% 55 11 8,952 9,437 6,631 74,612 3.018% 5.139% 10,847,910 0.148% 0.061% 0.004% 0.688%
93 Mauritius * 334 10 322 332 2 111,358 2.994% 3.012% 1,271,768 0.026% 0.001% 8.756%
94 Ukraine * 22,382 321 1.49% 47 477 669 14 2.17% 33 11 8,439 9,108 13,274 322,746 2.989% 7.345% 43,733,762 0.051% 0.030% 0.002% 0.738%
95 Aruba * 101 3 97 100 1 2,105 2.970% 3.000% 106,766 0.095% 0.001% 0.003% 1.972%
96 Peru * 135,905 5,772 4.66% 16 6,154 3,983 159 4.38% 17 195 56,169 60,152 75,753 905,278 2.931% 6.622% 32,971,854 0.412% 0.230% 0.012% 2.746%
97 Myanmar * 206 6 126 132 74 21,593 2.913% 4.545% 54,409,800 0.040%
98 Nigeria * 8,733 276 3.42% 21 389 254 16 6.87% 11 5 2,501 2,755 5,978 44,458 2.909% 9.220% 206,139,589 0.004% 0.003% 0.022%
99 Botswana * 35 1 20 21 14 17,991 2.857% 4.762% 2,351,627 0.001% 0.001% 0.765%
100 India * 165,386 7,293 4.84% 15 7,300 4,711 185 4.25% 17 177 70,920 75,631 89,755 3,362,136 2.848% 6.229% 1,380,004,385 0.012% 0.007% 0.244%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
101 Norway * 8,406 17 0.20% 342 15 236 1 7,727 7,963 443 239,864 2.808% 2.964% 5,421,241 0.155% 0.008% 0.004% 4.425%
102 Montenegro * 324 9 315 324 10,167 2.778% 2.778% 628,066 0.052% 0.001% 1.619%
103 Turkey * 160,979 1,035 0.65% 107 1,182 4,461 34 0.77% 90 30 124,369 128,830 32,149 1,928,209 2.771% 3.463% 84,339,067 0.191% 0.038% 0.005% 2.286%
104 Luxembourg * 4,008 6 0.15% 462 7 110 3,803 3,913 95 71,098 2.745% 2.811% 625,978 0.640% 0.015% 0.018% 11.358%
105 Uruguay * 803 2 0.25% 274 14 22 650 672 131 40,229 2.740% 3.274% 3,473,730 0.023% 0.004% 0.001% 1.158%
106 Panama * 11,728 264 2.36% 30 281 315 3 0.97% 72 2 7,379 7,694 4,034 61,895 2.686% 4.094% 4,314,767 0.272% 0.093% 0.007% 1.434%
107 Morocco * 7,643 24 0.32% 220 42 202 5,195 5,397 2,246 180,189 2.643% 3.743% 36,910,560 0.021% 0.006% 0.001% 0.488%
108 Sao Tome... * 458 2 0.45% 154 15 12 68 80 378 175 2.620% 15.000% 219,159 0.209% 0.172% 0.005% 0.080%
109 DRC * 2,660 143 5.95% 12 114 69 1 381 450 2,210 2.594% 15.333% 89,561,403 0.003% 0.002%
110 Haiti * 1,320 111 10.44% 7 146 34 2 6.45% 12 1 22 56 1,264 3,475 2.576% 60.714% 11,402,528 0.012% 0.011% 0.030%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
111 Burundi * 42 1 20 21 21 284 2.381% 4.762% 11,890,784 0.002%
112 S. Korea * 11,344 40 0.36% 195 79 269 10,340 10,609 735 868,666 2.371% 2.536% 51,269,185 0.022% 0.001% 0.001% 1.694%
113 Comoros * 87 2 1 100.00% 1 24 26 61 2.299% 7.692% 869,601 0.010% 0.007%
114 Latvia * 1,061 4 0.38% 183 4 24 1 4.55% 16 1 741 765 296 105,504 2.262% 3.137% 1,886,198 0.056% 0.016% 0.001% 5.593%
115 Lebanon * 1,168 21 1.84% 38 7 26 699 725 443 78,947 2.226% 3.586% 6,825,445 0.017% 0.006% 1.157%
116 Serbia * 11,300 48 0.43% 163 25 241 1 0.42% 167 1 6,438 6,679 4,621 234,019 2.133% 3.608% 8,737,371 0.129% 0.053% 0.003% 2.678%
117 South Africa * 25,937 1,673 6.89% 11 552 28 5.34% 14 13,451 14,003 11,934 634,996 2.128% 3.942% 59,308,690 0.044% 0.020% 0.001% 1.071%
118 Pakistan * 61,227 1,446 2.51% 29 2,076 1,260 28 2.34% 30 35 20,231 21,491 39,736 508,086 2.058% 5.863% 220,892,340 0.028% 0.018% 0.001% 0.230%
119 Malawi * 203 102 4 37 41 162 3,372 1.970% 9.756% 19,129,952 0.001% 0.001% 0.018%
120 Thailand * 3,065 9 0.30% 235 11 57 2,945 3,002 63 375,453 1.860% 1.899% 69,799,978 0.004% 0.538%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
121 Slovakia * 1,520 2 0.13% 525 5 28 1,332 1,360 160 165,714 1.842% 2.059% 5,459,642 0.028% 0.003% 0.001% 3.035%
122 Diamond... * 712 13 651 664 48 1.826% 1.958% 3,711 19.186% 1.293% 0.350%
123 Cyprus * 941 2 17 784 801 140 111,270 1.807% 2.122% 1,207,359 0.078% 0.012% 0.001% 9.216%
124 Afghanistan * 13,036 625 5.28% 14 580 235 7 3.18% 23 8 1,209 1,444 11,592 34,903 1.803% 16.274% 38,928,346 0.033% 0.030% 0.001% 0.090%
125 El Salvador * 2,194 67 3.28% 22 85 39 1 2.78% 26 2 1,002 1,041 1,153 82,243 1.778% 3.746% 6,486,205 0.034% 0.018% 0.001% 1.268%
126 Israel 16,872 36 0.21% 323 79 284 3 14,679 14,963 1,909 558,516 1.683% 1.898% 8,655,535 0.195% 0.022% 0.003% 6.453%
127 Guatemala * 4,145 194 5.16% 14 191 68 4 6.78% 11 5 493 561 3,584 31,427 1.641% 12.121% 17,915,568 0.023% 0.020% 0.175%
128 Georgia * 738 3 0.41% 170 3 12 573 585 153 52,117 1.626% 2.051% 3,989,167 0.019% 0.004% 1.306%
129 Taiwan * 441 7 420 427 14 71,581 1.587% 1.639% 23,816,775 0.002% 0.301%
130 Jamaica * 569 8 1.44% 49 5 9 279 288 281 11,259 1.582% 3.125% 2,961,167 0.019% 0.009% 0.380%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
131 Malaysia * 7,629 15 0.20% 352 10 115 6,169 6,284 1,345 519,944 1.507% 1.830% 32,365,999 0.024% 0.004% 1.606%
132 New Zealand * 1,504 22 1 1,474 1,496 8 271,690 1.463% 1.471% 4,822,233 0.031% 5.634%
133 Australia * 7,150 6 0.08% 825 11 103 1 0.98% 72 6,580 6,683 467 1,367,444 1.441% 1.541% 25,499,884 0.028% 0.002% 5.363%
134 Benin * 210 2 0.96% 73 3 134 137 73 28,179 1.429% 2.190% 12,123,200 0.002% 0.001% 0.232%
135 Brunei * 141 2 1 100.00% 1 138 140 1 18,707 1.418% 1.429% 437,479 0.032% 4.276%
136 Bangladesh * 40,321 1,541 4.19% 17 2,029 559 22 4.21% 17 15 8,425 8,984 31,337 275,776 1.386% 6.222% 164,689,383 0.024% 0.019% 0.167%
137 Armenia * 8,216 372 5.03% 15 442 113 7 7.69% 10 15 3,287 3,400 4,816 54,931 1.375% 3.324% 2,963,243 0.277% 0.163% 0.004% 1.854%
138 Tajikistan * 3,563 158 4.84% 15 139 47 1,674 1,721 1,842 1.319% 2.731% 9,537,645 0.037% 0.019%
139 Mayotte * 1,670 11 0.67% 104 25 21 1 1,315 1,336 334 5,200 1.257% 1.572% 272,815 0.612% 0.122% 0.008% 1.906%
140 Jordan * 728 2 0.28% 250 8 9 497 506 222 177,092 1.236% 1.779% 10,203,134 0.007% 0.002% 1.736%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
141 Paraguay * 900 7 0.80% 88 16 11 402 413 487 27,425 1.222% 2.663% 7,132,538 0.013% 0.007% 0.385%
142 Liechtens... * 82 1 55 56 26 900 1.220% 1.786% 38,128 0.215% 0.068% 0.003% 2.360%
143 Ivory Coast * 2,641 79 3.19% 23 85 32 1 3.33% 22 1 1,326 1,358 1,283 26,021 1.212% 2.356% 26,378,274 0.010% 0.005% 0.099%
144 Azerbaijan * 4,759 165 3.75% 19 191 56 2 3.85% 19 2 3,022 3,078 1,681 284,669 1.177% 1.819% 10,139,177 0.047% 0.017% 0.001% 2.808%
145 Senegal * 3,348 92 2.91% 25 95 39 2 5.56% 13 1 1,686 1,725 1,623 38,508 1.165% 2.261% 16,743,927 0.020% 0.010% 0.230%
146 Equatoria... * 1,043 12 165 177 866 854 1.151% 6.780% 1,402,985 0.074% 0.062% 0.001% 0.061%
147 Malta * 616 1 0.16% 424 4 7 1 16.67% 5 501 508 108 65,471 1.136% 1.378% 441,543 0.140% 0.024% 0.002% 14.828%
148 Russia * 379,051 8,338 2.30% 31 8,371 4,142 161 4.23% 17 174 150,993 155,135 223,916 9,701,280 1.093% 2.670% 145,934,462 0.260% 0.153% 0.003% 6.648%
149 Cabo Verde * 390 4 155 159 231 1,307 1.026% 2.516% 555,987 0.070% 0.042% 0.001% 0.235%
150 Chile * 86,943 4,328 5.55% 13 4,654 890 35 4.34% 17 49 36,150 37,040 49,903 530,173 1.024% 2.403% 19,116,201 0.455% 0.261% 0.005% 2.773%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
151 South Sudan * 994 188 23.33% 4 10 2 25.00% 4 6 16 978 3,356 1.006% 62.500% 11,193,725 0.009% 0.009% 0.030%
152 Kyrgyzstan * 1,594 52 3.54% 20 74 16 1,066 1,082 512 109,521 1.004% 1.479% 6,524,195 0.024% 0.008% 1.679%
153 Costa Rica * 1,000 28 2.93% 25 16 10 646 656 344 24,897 1.000% 1.524% 5,094,118 0.020% 0.007% 0.489%
154 Venezuela * 1,245 34 2.89% 25 34 11 1 10.00% 8 302 313 932 897,695 0.884% 3.514% 28,435,940 0.004% 0.003% 3.157%
155 Mozambique * 233 14 6.57% 11 6 2 1 82 84 149 9,036 0.858% 2.381% 31,255,435 0.001% 0.029%
156 Ethiopia * 831 30 4.28% 17 100 7 1 191 198 633 96,566 0.842% 3.535% 114,963,588 0.001% 0.001% 0.084%
157 UAE * 32,532 883 2.84% 25 563 258 2 0.79% 89 3 16,685 16,943 15,589 2,110,493 0.793% 1.523% 9,890,402 0.329% 0.158% 0.003% 21.339%
158 Kuwait * 24,112 692 3.07% 23 845 185 3 1.74% 41 10 8,698 8,883 15,229 282,341 0.767% 2.083% 4,270,571 0.565% 0.357% 0.004% 6.611%
159 Eswatini * 279 11 4.21% 17 7 2 168 170 109 4,994 0.717% 1.176% 1,160,164 0.024% 0.009% 0.430%
160 Cayman... * 140 3 2.24% 32 3 1 67 68 72 10,174 0.714% 1.471% 65,722 0.213% 0.110% 0.002% 15.480%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
161 Djibouti * 2,914 229 9.28% 8 217 20 4 28.57% 3 2 1,241 1,261 1,653 25,257 0.686% 1.586% 988,000 0.295% 0.167% 0.002% 2.556%
162 Palestine * 446 8 1.88% 38 12 3 365 368 78 44,876 0.673% 0.815% 5,101,414 0.009% 0.002% 0.880%
163 Zambia * 1,057 137 14.89% 5 7 779 786 271 24,275 0.662% 0.891% 18,383,955 0.006% 0.001% 0.132%
164 Sri Lanka * 1,530 150 11.37% 7 61 10 745 755 775 59,165 0.654% 1.325% 21,413,249 0.007% 0.004% 0.276%
165 Guinea * 3,553 278 22 2 1,950 1,972 1,581 14,407 0.619% 1.116% 13,132,795 0.027% 0.012% 0.110%
166 Gabon * 2,319 103 4.82% 15 81 14 631 645 1,674 12,060 0.604% 2.171% 2,225,734 0.104% 0.075% 0.001% 0.542%
167 Guinea-Bi... * 1,195 17 1.44% 49 7 42 49 1,146 1,500 0.586% 14.286% 1,968,001 0.061% 0.058% 0.076%
168 Iceland * 1,805 1 0.06% 1,251 10 1,792 1,802 3 59,613 0.554% 0.555% 341,243 0.529% 0.001% 0.003% 17.469%
169 Saudi Arabia * 80,185 1,815 2.37% 30 1,644 441 14 3.41% 21 16 54,553 54,994 25,191 770,696 0.550% 0.802% 34,813,871 0.230% 0.072% 0.001% 2.214%
170 Belarus * 39,858 897 2.36% 30 902 219 6 2.88% 25 5 16,660 16,879 22,979 499,249 0.549% 1.297% 9,449,323 0.422% 0.243% 0.002% 5.283%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
171 Nepal * 1,042 114 14.77% 6 156 5 1 187 192 850 162,730 0.480% 2.604% 29,136,808 0.004% 0.003% 0.559%
172 Ghana * 7,303 153 2.20% 32 186 34 2 6.25% 12 2,412 2,446 4,857 205,890 0.466% 1.390% 31,072,940 0.024% 0.016% 0.663%
173 Oman * 9,009 255 3.14% 23 636 40 2 5.41% 14 1 2,177 2,217 6,792 72,000 0.444% 1.804% 5,106,626 0.176% 0.133% 0.001% 1.410%
174 Uzbekistan * 3,444 79 2.40% 30 75 14 2,694 2,708 736 460,000 0.407% 0.517% 33,469,203 0.010% 0.002% 1.374%
175 Kazakhstan * 9,576 335 3.74% 19 272 37 4,900 4,937 4,639 735,273 0.386% 0.749% 18,776,707 0.051% 0.025% 3.916%
176 Hong Kong * 1,067 1 0.09% 740 4 1,035 1,039 28 202,930 0.375% 0.385% 7,496,981 0.014% 2.707%
177 Maldives * 1,513 19 1.32% 53 56 5 197 202 1,311 11,775 0.330% 2.475% 540,544 0.280% 0.243% 0.001% 2.178%
178 Madagascar * 656 26 4.44% 16 44 2 154 156 500 9,848 0.305% 1.282% 27,691,018 0.002% 0.002% 0.036%
179 French... * 406 31 8.78% 9 22 1 150 151 255 0.246% 0.662% 298,682 0.136% 0.085%
180 Ré... * 465 1 0.22% 319 5 1 411 412 53 17,200 0.215% 0.243% 895,312 0.052% 0.006% 1.921%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
181 Bahrain * 10,052 326 3.48% 21 360 15 1 7.14% 11 5,419 5,434 4,618 297,873 0.149% 0.276% 1,701,575 0.591% 0.271% 0.001% 17.506%
182 CAR * 702 31 4.62% 16 1 23 24 678 11,570 0.142% 4.167% 4,829,767 0.015% 0.014% 0.240%
183 Singapore * 33,249 533 1.65% 43 373 23 18,294 18,317 14,932 334,691 0.069% 0.126% 5,850,342 0.568% 0.255% 5.721%
184 Qatar * 50,914 1,740 3.69% 20 1,967 33 2 7.14% 11 3 15,399 15,432 35,482 207,033 0.065% 0.214% 2,881,053 1.767% 1.232% 0.001% 7.186%
185 Caribbean... * 6 6 6 424 26,223 0.023% 1.617%
186 Namibia * 22 1 4.76% 15 14 14 8 3,370 2,540,905 0.001% 0.133%
187 Cambodia * 124 122 122 2 18,392 16,718,965 0.001% 0.110%
188 Lesotho * 2 1 1 1 283 2,142,249 0.013%
189 Uganda * 281 59 26.58% 3 69 69 212 90,832 45,741,007 0.001% 0.199%
190 Macao * 45 45 45 649,335 0.007%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
191 Saint Lucia * 18 18 18 965 183,627 0.010% 0.526%
192 Anguilla * 3 3 3 30 15,003 0.020% 0.200%
193 Saint... * 1 1 1 5,794 0.017%
194 Vietnam * 327 278 278 49 275,000 97,338,579 0.283%
195 Vatican City * 12 2 2 10 825 1.455% 1.212%
196 New... * 19 1 18 18 1 6,416 285,498 0.007% 2.247%
197 Bhutan * 31 1 3.70% 20 3 6 6 25 15,862 771,608 0.004% 0.003% 2.056%
198 Eritrea * 39 39 39 3,546,421 0.001%
199 St. Barth * 6 6 6 137 9,877 0.061% 1.387%
200 St.... * 25 7 14 14 11 216 110,940 0.023% 0.010% 0.195%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
201 Seychelles * 11 11 11 98,347 0.011%
202 Papua New... * 8 8 8 2,402 8,947,024 0.027%
203 Gibraltar * 158 3 1.95% 36 1 147 147 11 7,073 33,691 0.469% 0.033% 20.994%
204 Grenada * 23 18 18 5 3,007 112,523 0.020% 0.004% 2.672%
205 Greenland * 13 1 8.33% 9 11 11 2 2,030 56,770 0.023% 0.004% 3.576%
206 Laos * 19 16 16 3 6,066 7,275,560 0.083%
207 French... * 60 60 60 4,006 280,908 0.021% 1.426%
208 Rwanda * 349 7 2.06% 34 3 245 245 104 64,268 12,952,218 0.003% 0.001% 0.496%
209 Mongolia * 161 7 4.96% 15 13 43 43 118 13,225 3,278,290 0.005% 0.004% 0.403%
210 Timor-Leste * 24 24 24 1,290 1,318,445 0.002% 0.098%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 5,864,341 106,201 1.88% 38 108,940 360,319 5,342 1.52% 46 4,644 2,566,622 2,926,941 2,937,400 78,325,534 6.144% 12.310% 7,800,000,000 0.075% 0.038% 0.005% 1.004%
211 Faeroe... * 187 187 187 9,386 48,863 0.383% 19.209%
212 Falkland... * 13 13 13 503 3,480 0.374% 14.454%
213 Saint... * 15 15 15 394 53,199 0.028% 0.741%
214 Fiji * 18 15 15 3 2,431 896,445 0.002% 0.271%
215 Dominica * 16 16 16 433 71,986 0.022% 0.602%
Running Time: 41.923 milliseconds, this hour: 6.


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