# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
1 USA * 1,890,365 23,880 1.29% 55 15,742 108,567 1,260 1.18% 59 721 649,189 757,756 1,132,609 328 5.743% 14.327% 331,002,651 0.571% 0.342% 0.033%
2 UK * 279,856 1,653 0.60% 117 1,871 39,728 324 0.83% 84 359 39,728 240,128 585 14.196% 100.000% 67,886,011 0.412% 0.354% 0.059% 0.001%
3 Italy * 233,836 318 0.14% 509 321 33,601 55 0.16% 423 71 160,938 194,539 39,297 556 14.369% 17.272% 60,461,826 0.387% 0.065% 0.056% 0.001%
4 Brazil * 560,737 19,341 3.72% 19 21,692 31,417 952 3.22% 22 931 253,570 284,987 275,750 148 5.603% 11.024% 212,559,417 0.264% 0.130% 0.015%
5 France * 151,325 -37,895 28,940 107 0.37% 188 68,812 97,752 53,573 443 19.124% 29.606% 65,273,511 0.232% 0.082% 0.044% 0.001%
6 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%
7 Mexico * 97,326 2,771 3.06% 24 3,891 10,637 237 2.39% 30 470 70,308 80,945 16,381 83 10.929% 13.141% 128,932,753 0.075% 0.013% 0.008%
8 Belgium * 58,685 98 0.17% 415 70 9,522 19 0.20% 347 17 15,959 25,481 33,204 822 16.226% 37.369% 11,589,623 0.506% 0.286% 0.082% 0.007%
9 Germany * 184,220 320 0.17% 399 156 8,680 31 0.36% 194 31 167,300 175,980 8,240 104 4.712% 4.932% 83,783,942 0.220% 0.010% 0.010%
10 Iran * 160,696 3,117 2.02% 35 3,134 8,012 64 0.81% 86 70 125,206 133,218 27,478 95 4.986% 6.014% 83,992,949 0.191% 0.033% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
11 Canada * 93,040 743 0.81% 86 650 7,495 70 0.96% 73 100 50,685 58,180 34,860 199 8.056% 12.882% 37,742,154 0.247% 0.092% 0.020% 0.001%
12 India * 216,429 8,813 4.44% 16 9,246 6,087 221 3.94% 18 258 103,949 110,036 106,393 4 2.812% 5.532% 1,380,004,385 0.016% 0.008%
13 Netherlands * 46,733 102 0.22% 317 86 5,977 5 0.08% 827 10 5,977 40,756 349 12.790% 100.000% 17,134,872 0.273% 0.238% 0.035% 0.002%
14 Russia * 432,277 8,863 2.14% 33 8,536 5,215 182 3.75% 19 178 195,957 201,172 231,105 36 1.206% 2.592% 145,934,462 0.296% 0.158% 0.004%
15 Peru * 174,884 4,845 4,767 133 69,257 74,024 100,860 145 2.726% 6.440% 32,971,854 0.530% 0.306% 0.014%
16 China * 83,021 5 0.01% 11,509 -1 4,634 78,314 82,948 73 3 5.582% 5.587% 1,439,323,776 0.006%
17 Turkey * 166,422 786 0.48% 146 867 4,609 22 0.48% 145 24 130,852 135,461 30,961 55 2.769% 3.402% 84,339,067 0.197% 0.037% 0.005%
18 Sweden * 40,803 775 2.05% 35 2,214 4,542 65 1.48% 48 74 4,542 36,261 450 11.132% 100.000% 10,099,265 0.404% 0.359% 0.045% 0.004%
19 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%
20 Switzerland * 30,893 3 0.01% 7,134 19 1,921 1 28,600 30,521 372 222 6.218% 6.294% 8,654,622 0.357% 0.004% 0.022% 0.003%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
21 Indonesia * 28,233 609 2.26% 32 684 1,698 22 1.34% 53 35 8,406 10,104 18,129 6 6.014% 16.805% 273,523,615 0.010% 0.007% 0.001%
22 Pakistan * 80,463 3,938 5.43% 14 4,065 1,688 78 5.06% 15 67 28,923 30,611 49,852 8 2.098% 5.514% 220,892,340 0.036% 0.023% 0.001%
23 Ireland * 25,111 4 0.02% 4,344 45 1,659 8 0.48% 144 1 22,698 24,357 754 336 6.607% 6.811% 4,937,786 0.509% 0.015% 0.034% 0.007%
24 Portugal * 33,261 195 0.60% 117 366 1,447 12 0.84% 83 11 20,079 21,526 11,735 142 4.350% 6.722% 10,196,709 0.326% 0.115% 0.014% 0.001%
25 Romania * 19,669 119 0.61% 114 152 1,296 12 0.94% 75 8 13,800 15,096 4,573 67 6.589% 8.585% 19,237,691 0.102% 0.024% 0.007%
26 Chile * 113,628 3,527 3.35% 22 4,942 1,275 75 6.74% 11 87 86,173 87,448 26,180 67 1.122% 1.458% 19,116,201 0.594% 0.137% 0.007%
27 Poland * 24,687 230 0.95% 74 292 1,115 18 1.68% 42 23 12,014 13,129 11,558 29 4.517% 8.493% 37,846,611 0.065% 0.031% 0.003%
28 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%
29 Colombia * 31,833 1,110 3.78% 19 1,340 1,009 30 3.19% 23 40 11,142 12,151 19,682 20 3.170% 8.304% 50,882,891 0.063% 0.039% 0.002%
30 Philippines 19,748 359 1.93% 37 751 974 6 0.63% 112 8 4,153 5,127 14,621 9 4.932% 18.997% 109,581,078 0.018% 0.013% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
31 Japan * 16,930 33 0.20% 355 46 894 1 0.11% 618 2 14,650 15,544 1,386 7 5.281% 5.751% 126,476,461 0.013% 0.001% 0.001%
32 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%
33 Bangladesh * 55,140 2,911 5.88% 13 2,695 746 37 5.51% 13 37 11,590 12,336 42,804 5 1.353% 6.047% 164,689,383 0.033% 0.026%
34 Ukraine * 24,823 328 1.37% 52 483 735 9 1.25% 56 8 10,440 11,175 13,648 17 2.961% 6.577% 43,733,762 0.057% 0.031% 0.002%
35 Algeria * 9,733 113 1.19% 59 107 673 6 0.91% 77 6 6,218 6,891 2,842 15 6.915% 9.766% 43,851,044 0.022% 0.006% 0.002%
36 Austria * 16,771 26 0.16% 447 12 670 1 0.15% 464 1 15,672 16,342 429 74 3.995% 4.100% 9,006,398 0.186% 0.005% 0.007% 0.001%
37 Denmark * 11,771 35 0.30% 233 37 580 4 0.69% 101 10,552 11,132 639 100 4.927% 5.210% 5,792,202 0.203% 0.011% 0.010% 0.002%
38 Saudi Arabia * 91,182 1,869 2.14% 33 2,171 579 24 4.57% 16 30 68,159 68,738 22,444 17 0.635% 0.842% 34,813,871 0.262% 0.064% 0.002%
39 Argentina * 18,319 564 3.35% 22 904 570 19 3.51% 21 10 5,896 6,466 11,853 13 3.112% 8.815% 45,195,774 0.041% 0.026% 0.001%
40 Hungary * 3,931 29 0.75% 94 10 534 5 0.95% 74 2 2,190 2,724 1,207 55 13.584% 19.604% 9,660,351 0.041% 0.012% 0.006% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
41 Dominican... * 18,040 180 1.02% 69 288 516 13 2.59% 28 1 11,224 11,740 6,300 48 2.860% 4.395% 10,847,910 0.166% 0.058% 0.005%
42 Bolivia * 10,991 549 5.50% 13 460 376 30 9.58% 8 33 1,298 1,674 9,317 32 3.421% 22.461% 11,673,021 0.094% 0.080% 0.003%
43 Panama * 14,095 374 2.78% 26 258 352 8 2.38% 30 8 9,514 9,866 4,229 82 2.497% 3.568% 4,314,767 0.327% 0.098% 0.008% 0.002%
44 Czechia * 9,374 48 0.52% 135 40 323 2 0.62% 112 6,693 7,016 2,358 30 3.446% 4.604% 10,708,981 0.088% 0.022% 0.003%
45 Finland * 6,911 2 0.03% 2,387 24 321 2 0.63% 111 1 5,500 5,821 1,090 58 4.645% 5.515% 5,540,720 0.125% 0.020% 0.006% 0.001%
46 Nigeria * 10,819 416 4.09% 18 241 314 12 4.18% 17 15 3,240 3,554 7,265 2 2.902% 8.835% 206,139,589 0.005% 0.004%
47 Moldova * 8,795 188 2.25% 32 247 310 2 0.66% 107 3 4,863 5,173 3,622 77 3.525% 5.993% 4,033,963 0.218% 0.090% 0.008% 0.002%
48 Sudan * 5,310 147 2.92% 25 137 307 12 4.20% 17 9 1,625 1,932 3,378 7 5.782% 15.890% 43,849,260 0.012% 0.008% 0.001%
49 Afghanistan * 17,267 742 4.71% 16 775 294 5 1.89% 38 24 1,522 1,816 15,451 8 1.703% 16.189% 38,928,346 0.044% 0.040% 0.001%
50 Israel 17,342 116 0.68% 103 57 290 5 1.75% 40 14,955 15,245 2,097 32 1.672% 1.902% 8,655,535 0.200% 0.024% 0.003%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
51 S. Korea * 11,590 38 0.33% 211 49 273 1 0.37% 189 1 10,467 10,740 850 5 2.355% 2.542% 51,269,185 0.023% 0.002% 0.001%
52 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%
53 Iraq * 8,168 519 7.56% 10 781 256 20 9.30% 8 21 4,095 4,351 3,817 6 3.134% 5.884% 40,222,493 0.020% 0.009% 0.001%
54 Belarus * 45,116 852 1.96% 36 861 248 3 1.25% 56 5 20,171 20,419 24,697 26 0.550% 1.215% 9,449,323 0.477% 0.261% 0.003%
55 Serbia * 11,523 24 0.21% 331 69 245 1 0.41% 170 6,852 7,097 4,426 28 2.126% 3.452% 8,737,371 0.132% 0.051% 0.003%
56 Norway * 8,467 10 0.12% 586 15 237 1 0.42% 164 7,727 7,964 503 44 2.799% 2.976% 5,421,241 0.156% 0.009% 0.004% 0.001%
57 Kuwait * 29,359 887 3.20% 23 710 230 6 2.73% 26 4 15,750 15,980 13,379 54 0.783% 1.439% 4,270,571 0.687% 0.313% 0.005% 0.001%
58 Honduras * 5,527 160 3.08% 23 165 225 5 2.36% 30 8 563 788 4,739 23 4.071% 28.553% 9,904,607 0.056% 0.048% 0.002%
59 Morocco * 7,922 33 0.42% 165 56 206 1 0.49% 143 6,866 7,072 850 6 2.600% 2.913% 36,910,560 0.021% 0.002% 0.001%
60 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
61 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%
62 Armenia * 10,524 517 5.45% 14 515 170 19 13.67% 6 12 3,454 3,624 6,900 57 1.615% 4.691% 2,963,243 0.355% 0.233% 0.006% 0.002%
63 Bosnia... * 2,551 11 0.44% 160 16 157 3 1.95% 36 1,939 2,096 455 48 6.154% 7.490% 3,280,819 0.078% 0.014% 0.005% 0.001%
64 Bulgaria * 2,560 19 0.75% 93 22 146 4 2.86% 25 2 1,206 1,352 1,208 21 5.703% 10.799% 6,948,445 0.037% 0.017% 0.002%
65 North... * 2,492 76 3.28% 22 101 145 1 0.71% 98 4 1,605 1,750 742 70 5.819% 8.286% 2,083,374 0.120% 0.036% 0.007% 0.003%
66 Guatemala * 5,586 249 4.89% 15 250 123 8 7.41% 10 7 824 947 4,639 7 2.202% 12.988% 17,915,568 0.031% 0.026% 0.001%
67 Malaysia * 7,970 20 0.25% 273 93 115 6,531 6,646 1,324 4 1.443% 1.730% 32,365,999 0.025% 0.004%
68 Luxembourg * 4,024 1 0.02% 2,787 4 110 3,861 3,971 53 176 2.734% 2.770% 625,978 0.643% 0.008% 0.018% 0.028%
69 Slovenia * 1,477 2 0.14% 511 2 109 1,358 1,467 10 52 7.380% 7.430% 2,078,938 0.071% 0.005% 0.003%
70 Croatia * 2,246 103 2,095 2,198 48 25 4.586% 4.686% 4,105,267 0.055% 0.001% 0.003% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
71 Australia * 7,229 17 0.24% 295 8 102 -1 -0.97% 6,640 6,742 487 4 1.411% 1.513% 25,499,884 0.028% 0.002%
72 Yemen * 399 45 87 3 15 102 297 3 21.805% 85.294% 29,825,964 0.001% 0.001%
73 Cuba * 2,107 9 0.43% 161 15 83 1,830 1,913 194 7 3.939% 4.339% 11,326,616 0.019% 0.002% 0.001%
74 Somalia * 2,146 66 3.26% 22 57 79 406 485 1,661 5 3.681% 16.289% 15,893,222 0.014% 0.010%
75 Mali * 1,351 36 2.74% 26 78 769 847 504 4 5.774% 9.209% 20,250,833 0.007% 0.002%
76 Azerbaijan * 6,260 273 4.82% 15 325 76 3 4.41% 17 5 3,665 3,741 2,519 8 1.214% 2.032% 10,139,177 0.062% 0.025% 0.001%
77 DRC * 3,495 131 4.10% 18 169 75 3 492 567 2,928 1 2.146% 13.228% 89,561,403 0.004% 0.003%
78 Kenya * 2,216 72 3.56% 20 123 74 2 2.90% 25 3 553 627 1,589 1 3.339% 11.802% 53,771,296 0.004% 0.003%
79 Lithuania * 1,684 4 0.24% 292 2 71 1 1.43% 49 1,260 1,331 353 26 4.216% 5.334% 2,722,289 0.062% 0.013% 0.003% 0.001%
80 Estonia * 1,880 10 69 1 1,650 1,719 161 52 3.670% 4.014% 1,326,535 0.142% 0.012% 0.005% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
81 Oman * 13,537 576 4.71% 16 738 67 9 18.00% 5 8 2,845 2,912 10,625 13 0.495% 2.301% 5,106,626 0.265% 0.208% 0.001%
82 Chad * 803 13 1.65% 43 66 562 628 175 4 8.219% 10.510% 16,425,864 0.005% 0.001%
83 Niger * 960 2 65 1 1.56% 45 848 913 47 3 6.771% 7.119% 24,206,644 0.004%
84 Thailand * 3,084 1 0.03% 2,137 1 58 1 1.75% 40 2,968 3,026 58 1 1.881% 1.917% 69,799,978 0.004%
85 Burkina Faso * 884 34 4.01% 18 3 53 753 806 78 3 5.995% 6.576% 20,903,273 0.004%
86 Andorra * 851 80 10.47% 7 7 51 735 786 65 660 5.993% 6.489% 77,265 1.101% 0.084% 0.066% 0.854%
87 Tunisia * 1,087 2 0.18% 377 1 49 1 965 1,014 73 4 4.508% 4.832% 11,818,619 0.009% 0.001%
88 El Salvador * 2,705 71 2.75% 26 52 49 3 1,179 1,228 1,477 8 1.811% 3.990% 6,486,205 0.042% 0.023% 0.001%
89 Tajikistan * 4,191 87 2.17% 33 91 48 1 2,347 2,395 1,796 5 1.145% 2.004% 9,537,645 0.044% 0.019% 0.001%
90 Haiti * 2,507 102 4.80% 15 281 48 1 2.27% 31 3 24 72 2,435 4 1.915% 66.667% 11,402,528 0.022% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
91 Kazakhstan * 11,796 263 2.33% 31 225 48 3 7.32% 10 4 6,240 6,288 5,508 3 0.407% 0.763% 18,776,707 0.063% 0.029%
92 Sierra Leone * 909 31 3.58% 20 13 47 1 491 538 371 6 5.171% 8.736% 7,976,983 0.011% 0.005% 0.001%
93 Channel... * 560 46 1 512 558 2 265 8.214% 8.244% 173,863 0.322% 0.001% 0.026% 0.152%
94 Nicaragua * 1,118 359 46 11 370 416 702 7 4.114% 11.058% 6,624,554 0.017% 0.011% 0.001%
95 Qatar * 62,160 1,826 3.12% 23 1,901 45 3 7.50% 10 2 37,542 37,587 24,573 16 0.072% 0.120% 2,881,053 2.158% 0.853% 0.002% 0.001%
96 Senegal * 3,932 97 2.59% 28 96 45 1 2.38% 30 2 2,063 2,108 1,824 3 1.144% 2.135% 16,743,927 0.023% 0.011%
97 San Marino * 674 1 0.15% 466 2 42 391 433 241 1,238 6.231% 9.700% 33,931 1.986% 0.710% 0.124% 3.649%
98 Ghana * 8,548 227 2.81% 25 251 38 2 5.56% 13 3,132 3,170 5,378 1 0.445% 1.199% 31,072,940 0.028% 0.017%
99 Albania * 1,184 21 1.84% 39 20 33 898 931 253 11 2.787% 3.545% 2,877,797 0.041% 0.009% 0.001%
100 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%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
101 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%
102 Liberia * 316 15 5.07% 15 5 28 1 3.70% 20 169 197 119 6 8.861% 14.213% 5,057,681 0.006% 0.002% 0.001%
103 Slovakia * 1,525 3 28 1,375 1,403 122 5 1.836% 1.996% 5,459,642 0.028% 0.002% 0.001%
104 Lebanon * 1,256 9 0.73% 96 14 27 724 751 505 4 2.150% 3.595% 6,825,445 0.018% 0.007%
105 Djibouti * 3,935 210 5.88% 13 156 26 1 4.17% 17 1 1,636 1,662 2,273 26 0.661% 1.564% 988,000 0.398% 0.230% 0.003% 0.003%
106 Singapore * 36,405 544 1.54% 46 569 24 23,582 23,606 12,799 4 0.066% 0.102% 5,850,342 0.622% 0.219%
107 Isle of Man * 336 24 312 336 282 7.143% 7.143% 85,033 0.395% 0.028% 0.332%
108 Latvia * 1,079 5 0.47% 149 8 24 760 784 295 13 2.224% 3.061% 1,886,198 0.057% 0.016% 0.001% 0.001%
109 Mayotte * 1,993 52 2.69% 27 7 24 1,523 1,547 446 88 1.204% 1.551% 272,815 0.731% 0.163% 0.009% 0.032%
110 Uruguay * 826 2 0.24% 286 1 23 1 4.55% 16 691 714 112 7 2.785% 3.221% 3,473,730 0.024% 0.003% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
111 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%
112 New Zealand * 1,504 22 1,481 1,503 1 4 1.463% 1.464% 4,822,233 0.031%
113 Tanzania * 509 21 183 204 305 4.126% 10.294% 59,734,218 0.001% 0.001%
114 Kyrgyzstan * 1,871 28 1.54% 46 26 20 1 6.25% 12 3 1,265 1,285 586 3 1.069% 1.556% 6,524,195 0.029% 0.009%
115 Congo * 611 20 179 199 412 4 3.273% 10.050% 5,518,087 0.011% 0.007%
116 Bahrain * 12,574 440 3.71% 20 263 20 1 7,410 7,430 5,144 12 0.159% 0.269% 1,701,575 0.739% 0.302% 0.001% 0.001%
117 Gabon * 2,803 148 20 3 779 799 2,004 9 0.714% 2.503% 2,225,734 0.126% 0.090% 0.001%
118 Venezuela * 1,819 152 10.07% 8 157 18 3 21.43% 4 1 334 352 1,467 1 0.990% 5.114% 28,435,940 0.006% 0.005%
119 Ethiopia * 1,486 87 6.92% 11 142 17 2 16.67% 5 3 246 263 1,223 1.144% 6.464% 114,963,588 0.001% 0.001%
120 Cyprus * 958 3 0.32% 220 6 17 790 807 151 14 1.775% 2.107% 1,207,359 0.079% 0.013% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
121 Uzbekistan * 3,815 58 1.57% 45 55 16 1 3,014 3,030 785 1 0.419% 0.528% 33,469,203 0.011% 0.002%
122 Sint Maarten * 77 15 60 75 2 350 19.481% 20.000% 42,876 0.180% 0.005% 0.035% 0.816%
123 Martinique * 200 14 98 112 88 37 7.000% 12.500% 375,265 0.053% 0.023% 0.004% 0.010%
124 Guadeloupe * 162 14 138 152 10 35 8.642% 9.211% 400,124 0.040% 0.002% 0.003% 0.009%
125 Georgia * 800 2 0.25% 276 4 13 1 8.33% 9 640 653 147 3 1.625% 1.991% 3,989,167 0.020% 0.004%
126 Togo * 445 2 0.45% 154 13 230 243 202 2 2.921% 5.350% 8,278,724 0.005% 0.002%
127 Diamond... * 712 13 651 664 48 1.826% 1.958% 3,711 19.186% 1.293% 0.350%
128 Guyana * 153 12 70 82 71 15 7.843% 14.634% 786,552 0.019% 0.009% 0.002% 0.002%
129 Equatoria... * 1,306 12 200 212 1,094 9 0.919% 5.660% 1,402,985 0.093% 0.078% 0.001% 0.001%
130 Sao Tome... * 484 12 68 80 404 55 2.479% 15.000% 219,159 0.221% 0.184% 0.005% 0.025%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
131 Sri Lanka * 1,730 40 2.43% 29 47 11 836 847 883 1 0.636% 1.299% 21,413,249 0.008% 0.004%
132 Paraguay * 1,013 18 1.81% 39 11 498 509 504 2 1.086% 2.161% 7,132,538 0.014% 0.007%
133 Bahamas * 102 11 49 60 42 28 10.784% 18.333% 393,244 0.026% 0.011% 0.003% 0.007%
134 Costa Rica * 1,105 21 1.94% 37 10 682 692 413 2 0.905% 1.445% 5,094,118 0.022% 0.008%
135 Mauritius * 335 10 322 332 3 8 2.985% 3.012% 1,271,768 0.026% 0.001% 0.001%
136 South Sudan * 994 10 6 16 978 1 1.006% 62.500% 11,193,725 0.009% 0.009%
137 Iceland * 1,806 10 1,794 1,804 2 29 0.554% 0.554% 341,243 0.529% 0.001% 0.003% 0.008%
138 Malta * 622 1 0.16% 430 2 9 562 571 51 20 1.447% 1.576% 441,543 0.141% 0.012% 0.002% 0.005%
139 Jamaica * 590 2 0.34% 204 2 9 356 365 225 3 1.525% 2.466% 2,961,167 0.020% 0.008%
140 Jordan * 757 9 1.21% 58 2 9 561 570 187 1 1.189% 1.579% 10,203,134 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
141 Montenegro * 324 9 315 324 14 2.778% 2.778% 628,066 0.052% 0.001% 0.002%
142 Bermuda * 141 1 0.71% 98 9 113 122 19 144 6.383% 7.377% 62,278 0.226% 0.031% 0.014% 0.231%
143 Nepal * 2,300 288 15.90% 5 201 9 1 278 287 2,013 0.391% 3.136% 29,136,808 0.008% 0.007%
144 Guinea-Bi... * 1,339 8 53 61 1,278 4 0.597% 13.115% 1,968,001 0.068% 0.065%
145 Trinidad... * 117 8 108 116 1 6 6.838% 6.897% 1,399,488 0.008% 0.001%
146 Maldives * 1,850 12 0.66% 106 9 7 1 16.67% 5 644 651 1,199 13 0.378% 1.075% 540,544 0.342% 0.222% 0.001% 0.002%
147 Zambia * 1,089 7 912 919 170 0.643% 0.762% 18,383,955 0.006% 0.001%
148 Taiwan * 443 7 428 435 8 1.580% 1.609% 23,816,775 0.002%
149 Barbados * 92 7 81 88 4 24 7.609% 7.955% 287,375 0.032% 0.001% 0.002% 0.008%
150 Myanmar * 233 4 1.75% 40 1 6 145 151 82 2.575% 3.974% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
151 Syria * 123 6 1 20.00% 4 53 59 64 4.878% 10.169% 17,500,658 0.001%
152 Madagascar * 908 19 2.30% 31 63 6 195 201 707 0.661% 2.985% 27,691,018 0.003% 0.003%
153 Libya * 182 26 16.67% 5 5 52 57 125 1 2.747% 8.772% 6,871,292 0.003% 0.002%
154 Cabo Verde * 477 8 1.75% 41 11 5 1 25.00% 4 238 243 234 9 1.048% 2.058% 555,987 0.086% 0.042% 0.001% 0.002%
155 Angola * 86 4 18 22 64 4.651% 18.182% 32,866,272
156 CAR * 1,173 104 4 23 27 1,146 1 0.341% 14.815% 4,829,767 0.024% 0.024%
157 Monaco * 99 4 90 94 5 102 4.040% 4.255% 39,242 0.252% 0.013% 0.010% 0.260%
158 Zimbabwe * 206 28 15.73% 5 4 29 33 173 1.942% 12.121% 14,862,924 0.001% 0.001%
159 Malawi * 358 22 6.55% 11 4 42 46 312 1.117% 8.696% 19,129,952 0.002% 0.002%
160 Hong Kong * 1,094 6 0.55% 127 4 1,039 1,043 51 1 0.366% 0.384% 7,496,981 0.015% 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
161 Saint Martin * 41 3 33 36 5 78 7.317% 8.333% 38,666 0.106% 0.013% 0.008% 0.202%
162 Benin * 244 12 5.17% 14 3 148 151 93 1.230% 1.987% 12,123,200 0.002% 0.001%
163 Eswatini * 294 1 0.34% 204 3 198 201 93 3 1.020% 1.493% 1,160,164 0.025% 0.008%
164 Antigua... * 26 3 20 23 3 31 11.538% 13.043% 97,929 0.027% 0.003% 0.003% 0.032%
165 Aruba * 101 3 98 101 28 2.970% 2.970% 106,766 0.095% 0.003% 0.026%
166 Palestine * 456 2 0.45% 156 5 3 372 375 81 1 0.658% 0.800% 5,101,414 0.009% 0.002%
167 Brunei * 141 2 138 140 1 5 1.418% 1.429% 437,479 0.032% 0.001%
168 Mozambique * 316 53 20.87% 4 9 2 109 111 205 0.633% 1.802% 31,255,435 0.001% 0.001%
169 MS Zaandam * 9 2 2 7 22.222% 100.000% 1,243 0.724% 0.563% 0.161%
170 Comoros * 132 26 24.53% 4 2 27 29 103 2 1.515% 6.897% 869,601 0.015% 0.012%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
171 Rwanda * 384 7 2 1 269 271 113 0.521% 0.738% 12,952,218 0.003% 0.001%
172 Belize * 18 2 16 18 5 11.111% 11.111% 397,628 0.005% 0.001% 0.001%
173 Montserrat * 11 1 10 11 200 9.091% 9.091% 4,992 0.220% 0.020% 4.006%
174 Burundi * 63 1 33 34 29 1.587% 2.941% 11,890,784 0.001%
175 Suriname * 54 25 89.29% 2 1 1 9 10 44 2 1.852% 10.000% 586,632 0.009% 0.008%
176 British... * 8 1 7 8 33 12.500% 12.500% 30,231 0.026% 0.003% 0.109%
177 Turks and... * 12 1 11 12 26 8.333% 8.333% 38,717 0.031% 0.003% 0.067%
178 Botswana * 40 2 5.26% 14 1 23 24 16 2.500% 4.167% 2,351,627 0.002% 0.001%
179 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%
180 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
181 Cayman... * 151 9 6.38% 12 1 1 77 78 73 15 0.662% 1.282% 65,722 0.230% 0.111% 0.002% 0.023%
182 Western... * 9 1 6 7 2 2 11.111% 14.286% 597,339 0.002%
183 Ré... * 478 6 1.27% 55 1 1 411 412 66 1 0.209% 0.243% 895,312 0.053% 0.007%
184 Gambia * 26 1 1 20 21 5 3.846% 4.762% 2,416,668 0.001%
185 French... * 533 18 3.61% 20 16 1 254 255 278 3 0.188% 0.392% 298,682 0.178% 0.093% 0.001%
186 Uganda * 507 32 7.00% 11 18 82 82 425 45,741,007 0.001% 0.001%
187 Bhutan * 47 4 9.30% 8 9 9 38 771,608 0.006% 0.005%
188 Anguilla * 3 3 3 15,003 0.020%
189 Vatican City * 12 2 2 10 825 1.455% 1.212%
190 Vietnam * 328 302 302 26 97,338,579
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
191 Timor-Leste * 24 24 24 1,318,445 0.002%
192 Saint... * 15 15 15 53,199 0.028%
193 Grenada * 23 18 18 5 112,523 0.020% 0.004%
194 Greenland * 13 11 11 2 56,770 0.023% 0.004%
195 Gibraltar * 173 2 1.18% 60 1 153 153 20 33,691 0.513% 0.059%
196 French... * 60 60 60 280,908 0.021%
197 New... * 20 18 18 2 285,498 0.007% 0.001%
198 Namibia * 25 16 16 9 2,540,905 0.001%
199 Lesotho * 4 2 2 2 2 2,142,249
200 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 6,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
201 Laos * 19 18 18 1 7,275,560
202 Mongolia * 185 44 44 141 3,278,290 0.006% 0.004%
203 Fiji * 18 15 15 3 896,445 0.002%
204 Papua New... * 8 8 8 8,947,024
205 Seychelles * 11 11 11 98,347 0.011%
206 Caribbean... * 7 7 7 26,223 0.027%
207 Cambodia * 125 123 123 2 16,718,965 0.001%
208 St. Barth * 6 6 6 9,877 0.061%
209 Saint... * 1 1 1 5,794 0.017%
210 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,514,023 105,331 1.66% 43 67,647 384,642 4,373 1.16% 60 4,049 2,895,122 3,279,764 3,234,259 11,738 5.905% 11.728% 7,800,000,000 0.084% 0.041% 0.005%
211 Falkland... * 13 13 13 3,480 0.374%
212 Faeroe... * 187 187 187 48,863 0.383%
213 Eritrea * 39 39 39 3,546,421 0.001%
214 Dominica * 18 2 12.50% 6 16 16 2 71,986 0.025% 0.003%
215 St.... * 26 15 15 11 110,940 0.023% 0.010%
Running Time: 186.235 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