# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
1 Diamond... * 712 13 651 664 48 1.826% 1.958% 3,711 19.186% 1.293% 0.350%
2 Qatar * 60,259 1,523 2.68% 27 1,826 43 2 5.26% 14 3 36,036 36,079 24,180 15 0.071% 0.119% 2,881,053 2.092% 0.839% 0.001% 0.001%
3 San Marino * 672 1 42 384 426 246 1,238 6.250% 9.859% 33,931 1.980% 0.725% 0.124% 3.649%
4 Vatican City * 12 2 2 10 825 1.455% 1.212%
5 Andorra * 844 80 51 733 784 60 660 6.043% 6.505% 77,265 1.092% 0.078% 0.066% 0.854%
6 Mayotte * 1,986 235 13.83% 6 52 24 3 14.29% 6 1,473 1,497 489 88 1.208% 1.603% 272,815 0.728% 0.179% 0.009% 0.032%
7 MS Zaandam * 9 2 2 7 22.222% 100.000% 1,243 0.724% 0.563% 0.161%
8 Bahrain * 12,311 473 4.15% 18 440 19 7,407 7,426 4,885 11 0.154% 0.256% 1,701,575 0.724% 0.287% 0.001% 0.001%
9 Kuwait * 28,649 719 2.66% 27 887 226 8 3.77% 19 6 14,281 14,507 14,142 53 0.789% 1.558% 4,270,571 0.671% 0.331% 0.005% 0.001%
10 Luxembourg * 4,020 1 0.02% 2,786 1 110 3,848 3,958 62 176 2.736% 2.779% 625,978 0.642% 0.010% 0.018% 0.028%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
11 Spain * 287,012 209 0.07% 951 294 27,127 27,127 259,885 580 9.452% 100.000% 46,754,778 0.614% 0.556% 0.058% 0.001%
12 Singapore * 35,836 408 1.17% 60 544 24 1 4.35% 17 23,175 23,199 12,637 4 0.067% 0.103% 5,850,342 0.613% 0.216%
13 Chile * 108,686 5,471 5.49% 13 3,527 1,188 59 5.60% 13 75 44,946 46,134 62,552 62 1.093% 2.575% 19,116,201 0.569% 0.327% 0.006%
14 USA * 1,870,238 17,174 0.94% 75 19,495 107,620 459 0.43% 161 1,034 618,867 726,487 1,143,751 325 5.754% 14.814% 331,002,651 0.565% 0.346% 0.033%
15 Iceland * 1,806 10 1,794 1,804 2 29 0.554% 0.554% 341,243 0.529% 0.001% 0.003% 0.008%
16 Peru * 170,039 14,368 9.23% 8 4,634 263 6.02% 12 68,507 73,141 96,898 141 2.725% 6.336% 32,971,854 0.516% 0.294% 0.014%
17 Gibraltar * 172 2 151 151 21 33,691 0.511% 0.062%
18 Ireland * 25,066 72 0.29% 241 4 1,658 -2 -0.12% 8 22,089 23,747 1,319 336 6.615% 6.982% 4,937,786 0.508% 0.027% 0.034% 0.007%
19 Belgium * 58,615 136 0.23% 298 98 9,505 19 0.20% 346 19 15,934 25,439 33,176 820 16.216% 37.364% 11,589,623 0.506% 0.286% 0.082% 0.007%
20 Belarus * 44,255 847 1.99% 36 852 243 5 2.13% 33 3 19,195 19,438 24,817 26 0.549% 1.250% 9,449,323 0.468% 0.263% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
21 UK * 277,985 1,570 0.57% 122 1,653 39,369 556 1.44% 49 324 39,369 238,616 580 14.162% 100.000% 67,886,011 0.409% 0.351% 0.058% 0.001%
22 Isle of Man * 336 24 311 335 1 282 7.143% 7.164% 85,033 0.395% 0.001% 0.028% 0.332%
23 Italy * 233,515 200 0.09% 808 318 33,530 60 0.18% 387 55 160,092 193,622 39,893 555 14.359% 17.317% 60,461,826 0.386% 0.066% 0.055% 0.001%
24 Faeroe... * 187 187 187 48,863 0.383%
25 Djibouti * 3,779 215 6.41% 12 210 25 1 1,607 1,632 2,147 25 0.662% 1.532% 988,000 0.382% 0.217% 0.003% 0.003%
26 Sweden * 38,589 272 0.72% 97 775 4,468 8 0.18% 382 65 4,468 34,121 443 11.578% 100.000% 10,099,265 0.382% 0.338% 0.044% 0.004%
27 Falkland... * 13 13 13 3,480 0.374%
28 UAE * 35,788 635 1.84% 39 596 269 2 0.76% 92 3 18,726 18,995 16,793 27 0.752% 1.416% 9,890,402 0.362% 0.170% 0.003%
29 Switzerland * 30,874 9 0.03% 2,378 3 1,920 28,500 30,420 454 222 6.219% 6.312% 8,654,622 0.357% 0.005% 0.022% 0.003%
30 Maldives * 1,841 56 3.16% 23 12 7 1 20.00% 4 1 608 615 1,226 13 0.380% 1.138% 540,544 0.341% 0.227% 0.001% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
31 Armenia * 10,009 210 2.26% 31 517 158 8 6.11% 12 19 3,427 3,585 6,424 53 1.579% 4.407% 2,963,243 0.338% 0.217% 0.005% 0.002%
32 Portugal * 32,895 200 0.62% 113 195 1,436 14 0.99% 71 12 19,869 21,305 11,590 141 4.365% 6.740% 10,196,709 0.323% 0.114% 0.014% 0.001%
33 Channel... * 560 45 528 573 -13 259 8.036% 7.853% 173,863 0.322% -0.007% 0.026% 0.149%
34 Panama * 13,837 445 3.42% 21 374 344 6 1.82% 39 8 9,514 9,858 3,979 80 2.486% 3.490% 4,314,767 0.321% 0.092% 0.008% 0.002%
35 Russia * 423,741 9,035 2.23% 32 8,863 5,037 162 3.45% 21 182 186,985 192,022 231,719 35 1.189% 2.623% 145,934,462 0.290% 0.159% 0.003%
36 France * 189,220 338 0.18% 388 28,940 31 0.11% 645 107 68,812 97,752 91,468 443 15.294% 29.606% 65,273,511 0.290% 0.140% 0.044% 0.001%
37 Netherlands * 46,647 103 0.22% 313 102 5,967 6 0.10% 689 5 5,967 40,680 348 12.792% 100.000% 17,134,872 0.272% 0.237% 0.035% 0.002%
38 Saudi Arabia * 89,011 1,881 2.21% 32 1,869 549 22 4.37% 17 24 65,790 66,339 22,672 16 0.617% 0.828% 34,813,871 0.256% 0.065% 0.002%
39 Brazil * 539,045 13,249 2.62% 27 19,341 30,486 454 1.56% 45 952 211,080 241,566 297,479 144 5.656% 12.620% 212,559,417 0.254% 0.140% 0.014%
40 Monaco * 99 4 90 94 5 102 4.040% 4.255% 39,242 0.252% 0.013% 0.010% 0.260%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
41 Oman * 12,799 786 6.87% 11 576 59 1 2.04% 35 9 2,812 2,871 9,928 12 0.461% 2.055% 5,106,626 0.251% 0.194% 0.001%
42 Canada * 92,390 719 0.79% 89 743 7,395 31 0.43% 164 70 50,271 57,666 34,724 196 8.004% 12.824% 37,742,154 0.245% 0.092% 0.020% 0.001%
43 Cayman... * 150 9 1 75 76 74 15 0.667% 1.316% 65,722 0.228% 0.113% 0.002% 0.023%
44 Ecuador * 39,994 896 3,394 36 19,823 23,217 16,777 193 8.486% 14.619% 17,643,054 0.227% 0.095% 0.019% 0.001%
45 Bermuda * 141 1 9 112 121 20 144 6.383% 7.438% 62,278 0.226% 0.032% 0.014% 0.231%
46 Sao Tome... * 484 1 0.21% 336 12 68 80 404 55 2.479% 15.000% 219,159 0.221% 0.184% 0.005% 0.025%
47 Montserrat * 11 1 10 11 200 9.091% 9.091% 4,992 0.220% 0.020% 4.006%
48 Germany * 184,021 250 0.14% 510 277 8,643 13 0.15% 460 25 166,400 175,043 8,978 103 4.697% 4.938% 83,783,942 0.220% 0.011% 0.010%
49 Liechtens... * 82 1 55 56 26 26 1.220% 1.786% 38,128 0.215% 0.068% 0.003% 0.068%
50 Moldova * 8,548 109 1.32% 53 188 307 10 3.39% 21 2 4,738 5,045 3,503 76 3.591% 6.085% 4,033,963 0.212% 0.087% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
51 Denmark * 11,734 30 0.26% 270 35 580 2 0.35% 200 4 10,489 11,069 665 100 4.943% 5.240% 5,792,202 0.203% 0.011% 0.010% 0.002%
52 Israel 17,285 98 0.57% 122 116 290 5 14,940 15,230 2,055 32 1.678% 1.904% 8,655,535 0.200% 0.024% 0.003%
53 Turkey * 165,555 827 0.50% 138 786 4,585 23 0.51% 138 22 129,921 134,506 31,049 54 2.769% 3.409% 84,339,067 0.196% 0.037% 0.005%
54 Iran * 157,562 2,979 1.97% 36 3,117 7,942 81 1.04% 68 64 123,077 131,019 26,543 95 5.041% 6.062% 83,992,949 0.188% 0.032% 0.009%
55 Austria * 16,759 2 0.01% 5,799 26 669 1 15,629 16,298 461 74 3.992% 4.105% 9,006,398 0.186% 0.005% 0.007% 0.001%
56 Sint Maarten * 77 15 60 75 2 350 19.481% 20.000% 42,876 0.180% 0.005% 0.035% 0.816%
57 French... * 517 22 4.61% 16 18 1 207 208 309 3 0.193% 0.481% 298,682 0.173% 0.103% 0.001%
58 Dominican... * 17,752 287 1.66% 43 180 515 13 11,075 11,590 6,162 48 2.901% 4.443% 10,847,910 0.164% 0.057% 0.005%
59 Norway * 8,452 2 0.02% 2,926 10 237 1 7,727 7,964 488 44 2.804% 2.976% 5,421,241 0.156% 0.009% 0.004% 0.001%
60 Estonia * 1,870 1 0.05% 1,296 68 1,632 1,700 170 51 3.636% 4.000% 1,326,535 0.141% 0.013% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
61 Malta * 620 1 0.16% 429 1 9 554 563 57 20 1.452% 1.599% 441,543 0.140% 0.013% 0.002% 0.005%
62 Serbia * 11,454 18 0.16% 440 24 245 1 0.41% 169 1 6,766 7,011 4,443 28 2.139% 3.495% 8,737,371 0.131% 0.051% 0.003%
63 Finland * 6,887 26 0.38% 184 2 320 -2 -0.63% 2 5,500 5,820 1,067 58 4.646% 5.498% 5,540,720 0.124% 0.019% 0.006% 0.001%
64 Gabon * 2,655 17 722 739 1,916 8 0.640% 2.300% 2,225,734 0.119% 0.086% 0.001%
65 North... * 2,391 89 4.00% 18 76 141 7 5.26% 14 1 1,595 1,736 655 68 5.897% 8.122% 2,083,374 0.115% 0.031% 0.007% 0.003%
66 Saint Martin * 41 3 33 36 5 78 7.317% 8.333% 38,666 0.106% 0.013% 0.008% 0.202%
67 Romania * 19,517 141 0.73% 96 119 1,288 10 0.79% 89 12 13,526 14,814 4,703 67 6.599% 8.694% 19,237,691 0.101% 0.024% 0.007%
68 Aruba * 101 3 98 101 28 2.970% 2.970% 106,766 0.095% 0.003% 0.026%
69 Equatoria... * 1,306 12 200 212 1,094 9 0.919% 5.660% 1,402,985 0.093% 0.078% 0.001% 0.001%
70 Bolivia * 10,531 390 4.07% 18 549 343 3 0.97% 72 30 1,137 1,480 9,051 29 3.257% 23.176% 11,673,021 0.090% 0.078% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
71 Czechia * 9,334 29 0.31% 222 48 323 1 0.31% 223 2 6,681 7,004 2,330 30 3.460% 4.612% 10,708,981 0.087% 0.022% 0.003%
72 Cabo Verde * 466 23 5.29% 14 8 5 1 237 242 224 9 1.073% 2.066% 555,987 0.084% 0.040% 0.001% 0.002%
73 Cyprus * 952 5 0.53% 132 3 17 790 807 145 14 1.786% 2.107% 1,207,359 0.079% 0.012% 0.001% 0.001%
74 Bosnia... * 2,535 14 0.56% 125 11 157 1 0.65% 107 3 1,910 2,067 468 48 6.193% 7.596% 3,280,819 0.077% 0.014% 0.005% 0.001%
75 Mexico * 93,435 3,152 3.60% 20 2,771 10,167 151 1.54% 46 237 67,491 77,658 15,777 79 10.881% 13.092% 128,932,753 0.072% 0.012% 0.008%
76 Slovenia * 1,475 2 109 1 0.93% 76 1,358 1,467 8 52 7.390% 7.430% 2,078,938 0.071% 0.005% 0.003%
77 Guinea-Bi... * 1,339 83 6.61% 11 8 53 61 1,278 4 0.597% 13.115% 1,968,001 0.068% 0.065%
78 Poland * 24,395 379 1.59% 44 230 1,092 10 0.94% 75 18 11,726 12,818 11,577 29 4.476% 8.519% 37,846,611 0.064% 0.031% 0.003%
79 Lithuania * 1,682 3 0.18% 388 4 71 1 1,249 1,320 362 26 4.221% 5.379% 2,722,289 0.062% 0.013% 0.003% 0.001%
80 Kazakhstan * 11,571 450 4.14% 18 263 44 1 2.50% 29 3 5,941 5,985 5,586 2 0.380% 0.735% 18,776,707 0.062% 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 6,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
81 St. Barth * 6 6 6 9,877 0.061%
82 South Africa * 35,812 1,674 5.12% 14 1,455 705 22 3.22% 22 17,291 17,996 17,816 12 1.969% 3.918% 59,308,690 0.060% 0.030% 0.001%
83 Colombia * 30,493 1,147 4.06% 18 1,110 969 49 5.51% 13 30 9,661 10,630 19,863 19 3.178% 9.116% 50,882,891 0.060% 0.039% 0.002%
84 Azerbaijan * 5,935 168 3.06% 24 273 71 5 7.94% 10 3 3,564 3,635 2,300 7 1.196% 1.953% 10,139,177 0.059% 0.023% 0.001%
85 Latvia * 1,071 5 24 760 784 287 13 2.241% 3.061% 1,886,198 0.057% 0.015% 0.001% 0.001%
86 Ukraine * 24,340 340 1.44% 49 328 727 10 1.41% 50 9 10,078 10,805 13,535 17 2.987% 6.728% 43,733,762 0.056% 0.031% 0.002%
87 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%
88 Honduras * 5,362 108 2.12% 34 160 217 11 5.47% 14 5 549 766 4,596 22 4.047% 28.329% 9,904,607 0.054% 0.046% 0.002%
89 Martinique * 200 14 98 112 88 37 7.000% 12.500% 375,265 0.053% 0.023% 0.004% 0.010%
90 Ré... * 477 6 1 411 412 65 1 0.210% 0.243% 895,312 0.053% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
91 Montenegro * 324 9 315 324 14 2.778% 2.778% 628,066 0.052% 0.001% 0.002%
92 Tajikistan * 4,100 83 2.11% 34 87 47 2,217 2,264 1,836 5 1.146% 2.076% 9,537,645 0.043% 0.019%
93 Afghanistan * 16,492 545 3.58% 20 742 270 8 3.11% 23 5 1,450 1,720 14,772 7 1.637% 15.698% 38,928,346 0.042% 0.038% 0.001%
94 El Salvador * 2,653 65 2.58% 28 71 46 1,116 1,162 1,491 7 1.734% 3.959% 6,486,205 0.041% 0.023% 0.001%
95 Hungary * 3,921 16 0.41% 169 29 532 1 0.19% 365 5 2,160 2,692 1,229 55 13.568% 19.762% 9,660,351 0.041% 0.013% 0.006% 0.001%
96 Guadeloupe * 162 14 138 152 10 35 8.642% 9.211% 400,124 0.040% 0.002% 0.003% 0.009%
97 Albania * 1,164 6 0.53% 132 21 33 891 924 240 11 2.835% 3.571% 2,877,797 0.040% 0.008% 0.001%
98 Argentina * 17,415 637 3.93% 18 564 560 11 2.08% 34 19 5,709 6,269 11,146 12 3.216% 8.933% 45,195,774 0.039% 0.025% 0.001%
99 Bulgaria * 2,538 6 0.24% 291 19 144 4 1,123 1,267 1,271 21 5.674% 11.365% 6,948,445 0.037% 0.018% 0.002%
100 Pakistan * 76,398 2,964 4.26% 17 3,938 1,621 60 4.05% 18 78 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
101 Brunei * 141 2 138 140 1 5 1.418% 1.429% 437,479 0.032% 0.001%
102 Barbados * 92 7 76 83 9 24 7.609% 8.434% 287,375 0.032% 0.003% 0.002% 0.008%
103 Bangladesh * 52,445 2,381 5.05% 15 2,911 709 22 3.38% 21 37 11,120 11,829 40,616 4 1.352% 5.994% 164,689,383 0.032% 0.025%
104 New Zealand * 1,504 22 1,481 1,503 1 4 1.463% 1.464% 4,822,233 0.031%
105 Turks and... * 12 1 11 12 26 8.333% 8.333% 38,717 0.031% 0.003% 0.067%
106 Guatemala * 5,336 348 7.34% 10 249 116 6 5.88% 13 8 795 911 4,425 6 2.174% 12.733% 17,915,568 0.030% 0.025% 0.001%
107 Guinea * 3,844 138 3.72% 19 23 2,135 2,158 1,686 2 0.598% 1.066% 13,132,795 0.029% 0.013%
108 Australia * 7,221 9 0.13% 555 17 102 -1 6,626 6,728 493 4 1.413% 1.516% 25,499,884 0.028% 0.002%
109 Kyrgyzstan * 1,845 69 3.95% 18 28 17 1 1,219 1,236 609 3 0.921% 1.375% 6,524,195 0.028% 0.009%
110 Saint... * 15 15 15 53,199 0.028%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
111 Greece * 2,937 1 0.03% 2,023 19 179 4 2.29% 31 1,374 1,553 1,384 17 6.095% 11.526% 10,423,054 0.028% 0.013% 0.002%
112 Slovakia * 1,522 1 0.07% 1,055 28 1,372 1,400 122 5 1.840% 2.000% 5,459,642 0.028% 0.002% 0.001%
113 Egypt * 27,536 1,399 5.60% 13 1,152 1,052 46 4.80% 15 47 6,827 7,879 19,657 10 3.820% 13.352% 102,334,404 0.027% 0.019% 0.001%
114 Ghana * 8,297 189 2.40% 30 227 38 2 2,986 3,024 5,273 1 0.458% 1.257% 31,072,940 0.027% 0.017%
115 Caribbean... * 7 1 16.67% 5 7 7 26,223 0.027%
116 Antigua... * 26 3 19 22 4 31 11.538% 13.636% 97,929 0.027% 0.004% 0.003% 0.032%
117 British... * 8 1 7 8 33 12.500% 12.500% 30,231 0.026% 0.003% 0.109%
118 Mauritius * 335 10 322 332 3 8 2.985% 3.012% 1,271,768 0.026% 0.001% 0.001%
119 Bahamas * 102 11 49 60 42 28 10.784% 18.333% 393,244 0.026% 0.011% 0.003% 0.007%
120 Eswatini * 294 8 2.81% 26 1 3 1 50.00% 2 198 201 93 3 1.020% 1.493% 1,160,164 0.025% 0.008%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
121 Dominica * 18 2 16 16 2 71,986 0.025% 0.003%
122 Malaysia * 7,877 38 0.49% 143 20 115 6,470 6,585 1,292 4 1.460% 1.746% 32,365,999 0.024% 0.004%
123 Cameroon * 6,397 493 8.35% 9 199 8 4.19% 17 3,629 3,828 2,569 8 3.111% 5.199% 26,545,863 0.024% 0.010% 0.001%
124 Uruguay * 825 2 0.24% 285 2 23 1 689 712 113 7 2.788% 3.230% 3,473,730 0.024% 0.003% 0.001%
125 St.... * 26 15 15 11 110,940 0.023% 0.010%
126 Senegal * 3,836 94 2.58% 28 97 43 1 1,954 1,997 1,839 3 1.121% 2.153% 16,743,927 0.023% 0.011%
127 Greenland * 13 11 11 2 56,770 0.023% 0.004%
128 S. Korea * 11,541 35 0.31% 228 38 272 1 0.37% 188 1 10,446 10,718 823 5 2.357% 2.538% 51,269,185 0.023% 0.002% 0.001%
129 CAR * 1,069 58 5.74% 13 4 2 100.00% 1 23 27 1,042 1 0.374% 14.815% 4,829,767 0.022% 0.022%
130 Algeria * 9,626 119 1.27% 56 113 667 8 1.23% 57 6 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
131 Costa Rica * 1,105 28 2.65% 27 21 10 682 692 413 2 0.905% 1.445% 5,094,118 0.022% 0.008%
132 French... * 60 60 60 280,908 0.021%
133 Morocco * 7,866 26 0.33% 209 33 206 1 6,410 6,616 1,250 6 2.619% 3.114% 36,910,560 0.021% 0.003% 0.001%
134 Grenada * 23 18 18 5 112,523 0.020% 0.004%
135 Anguilla * 3 3 3 15,003 0.020%
136 Georgia * 796 11 1.40% 50 2 12 634 646 150 3 1.508% 1.858% 3,989,167 0.020% 0.004%
137 Jamaica * 588 5 0.86% 81 2 9 322 331 257 3 1.531% 2.719% 2,961,167 0.020% 0.009%
138 Haiti * 2,226 259 13.89% 6 102 45 3 7.32% 10 1 24 69 2,157 4 2.022% 65.217% 11,402,528 0.020% 0.019%
139 Guyana * 153 1 0.66% 106 12 70 82 71 15 7.843% 14.634% 786,552 0.019% 0.009% 0.002% 0.002%
140 Cuba * 2,092 38 1.86% 38 9 83 1,827 1,910 182 7 3.967% 4.346% 11,326,616 0.018% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
141 Iraq * 7,387 429 6.66% 11 519 235 10 4.88% 15 20 3,508 3,743 3,644 6 3.181% 6.278% 40,222,493 0.018% 0.009% 0.001%
142 Lebanon * 1,242 13 1.07% 66 9 27 719 746 496 4 2.174% 3.619% 6,825,445 0.018% 0.007%
143 Philippines 18,997 552 3.05% 24 359 966 3 0.31% 222 6 4,063 5,029 13,968 9 5.085% 19.209% 109,581,078 0.017% 0.013% 0.001%
144 Saint... * 1 1 1 5,794 0.017%
145 Comoros * 132 26 2 27 29 103 2 1.515% 6.897% 869,601 0.015% 0.012%
146 India * 207,135 7,761 4.07% 18 8,765 5,829 200 3.70% 20 221 100,205 106,034 101,101 4 2.814% 5.497% 1,380,004,385 0.015% 0.007%
147 Hong Kong * 1,094 3 0.28% 252 6 4 1,038 1,042 52 1 0.366% 0.384% 7,496,981 0.015% 0.001%
148 Mauritania * 668 58 10.94% 7 80 31 8 55 86 582 7 4.641% 36.047% 4,649,658 0.014% 0.013% 0.001%
149 Paraguay * 1,013 9 0.91% 77 18 11 498 509 504 2 1.086% 2.161% 7,132,538 0.014% 0.007%
150 Japan * 16,884 47 0.28% 249 33 892 5 0.56% 124 1 14,502 15,394 1,490 7 5.283% 5.794% 126,476,461 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
151 Somalia * 2,089 47 2.38% 30 66 79 1 1.28% 55 361 440 1,649 5 3.782% 17.955% 15,893,222 0.013% 0.010%
152 Cura&cced... * 20 1 1 15 16 4 6 5.000% 6.250% 164,093 0.012% 0.002% 0.001% 0.004%
153 Sudan * 5,173 147 298 12 1,522 1,820 3,353 7 5.761% 16.374% 43,849,260 0.012% 0.008% 0.001%
154 Nicaragua * 759 35 370 405 354 5 4.611% 8.642% 6,624,554 0.011% 0.005% 0.001%
155 Uzbekistan * 3,760 79 2.18% 33 58 15 2,908 2,923 837 0.399% 0.513% 33,469,203 0.011% 0.003%
156 Sierra Leone * 896 4 0.46% 150 31 46 480 526 370 6 5.134% 8.745% 7,976,983 0.011% 0.005% 0.001%
157 Ivory Coast * 2,951 118 4.17% 17 33 1,467 1,500 1,451 1 1.118% 2.200% 26,378,274 0.011% 0.006%
158 Seychelles * 11 11 11 98,347 0.011%
159 Congo * 611 20 179 199 412 4 3.273% 10.050% 5,518,087 0.011% 0.007%
160 Indonesia * 27,549 467 1.76% 40 609 1,663 28 1.74% 41 22 7,935 9,598 17,951 6 6.037% 17.327% 273,523,615 0.010% 0.007% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
161 Saint Lucia * 18 18 18 183,627 0.010%
162 Tunisia * 1,086 7 0.65% 107 2 48 965 1,013 73 4 4.420% 4.738% 11,818,619 0.009% 0.001%
163 South Sudan * 994 10 6 16 978 1 1.006% 62.500% 11,193,725 0.009% 0.009%
164 Palestine * 451 1 0.22% 311 2 3 372 375 76 1 0.665% 0.800% 5,101,414 0.009% 0.001%
165 Trinidad... * 117 8 108 116 1 6 6.838% 6.897% 1,399,488 0.008% 0.001%
166 Sri Lanka * 1,683 10 0.61% 114 40 11 1 10.00% 8 823 834 849 1 0.654% 1.319% 21,413,249 0.008% 0.004%
167 Suriname * 44 13 86.67% 2 16 1 9 10 34 2 2.273% 10.000% 586,632 0.008% 0.006%
168 Jordan * 755 7 0.95% 74 9 9 549 558 197 1 1.192% 1.613% 10,203,134 0.007% 0.002%
169 Nepal * 2,099 239 15.20% 5 288 8 266 274 1,825 0.381% 2.920% 29,136,808 0.007% 0.006%
170 New... * 20 1 5.26% 14 18 18 2 285,498 0.007% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
171 Macao * 45 45 45 649,335 0.007%
172 Mali * 1,351 50 3.95% 18 36 78 1 1.30% 54 769 847 504 4 5.774% 9.209% 20,250,833 0.007% 0.002%
173 Liberia * 311 8 2.78% 26 15 28 1 167 195 116 6 9.003% 14.359% 5,057,681 0.006% 0.002% 0.001%
174 Bhutan * 47 4 9 9 38 771,608 0.006% 0.005%
175 Zambia * 1,089 32 3.03% 24 7 912 919 170 0.643% 0.762% 18,383,955 0.006% 0.001%
176 Venezuela * 1,662 51 3.50% 21 152 17 3 302 319 1,343 1 1.023% 5.329% 28,435,940 0.006% 0.005%
177 China * 83,022 16 0.02% 3,597 5 4,634 78,315 82,949 73 3 5.582% 5.587% 1,439,323,776 0.006%
178 Mongolia * 185 6 3.35% 22 44 44 141 3,278,290 0.006% 0.004%
179 Togo * 445 1 0.23% 307 2 13 230 243 202 2 2.921% 5.350% 8,278,724 0.005% 0.002%
180 Nigeria * 10,578 307 3.12% 23 416 299 14 5.13% 14 12 3,122 3,421 7,157 1 2.827% 8.740% 206,139,589 0.005% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
181 Chad * 803 12 1.54% 46 13 66 1 1.54% 46 562 628 175 4 8.219% 10.510% 16,425,864 0.005% 0.001%
182 Belize * 18 2 16 18 5 11.111% 11.111% 397,628 0.005% 0.001% 0.001%
183 Thailand * 3,083 1 0.03% 2,136 1 58 1 2,966 3,024 59 1 1.881% 1.918% 69,799,978 0.004%
184 Burkina Faso * 881 34 53 720 773 108 3 6.016% 6.856% 20,903,273 0.004% 0.001%
185 Niger * 958 65 1 844 909 49 3 6.785% 7.151% 24,206,644 0.004%
186 Kenya * 2,093 59 3.01% 24 72 71 5 7.81% 10 2 499 570 1,523 1 3.392% 12.456% 53,771,296 0.004% 0.003%
187 DRC * 3,326 125 4.07% 18 131 72 482 554 2,772 1 2.165% 12.996% 89,561,403 0.004% 0.003%
188 Madagascar * 845 55 7.13% 11 19 6 185 191 654 0.710% 3.141% 27,691,018 0.003% 0.002%
189 Rwanda * 377 18 5.01% 15 1 262 263 114 0.265% 0.380% 12,952,218 0.003% 0.001%
190 Libya * 168 26 20.00% 4 12 5 52 57 111 1 2.976% 8.772% 6,871,292 0.002% 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
191 Benin * 244 12 3 148 151 93 1.230% 1.987% 12,123,200 0.002% 0.001%
192 Fiji * 18 15 15 3 896,445 0.002%
193 Malawi * 358 57 20.43% 4 22 4 42 46 312 1.117% 8.696% 19,129,952 0.002% 0.002%
194 Taiwan * 443 1 0.23% 307 7 427 434 9 1.580% 1.613% 23,816,775 0.002%
195 Timor-Leste * 24 24 24 1,318,445 0.002%
196 Botswana * 38 3 8.57% 9 1 21 22 16 2.632% 4.545% 2,351,627 0.002% 0.001%
197 Western... * 9 1 6 7 2 2 11.111% 14.286% 597,339 0.002%
198 Zimbabwe * 206 4 2.30% 31 28 4 29 33 173 1.942% 12.121% 14,862,924 0.001% 0.001%
199 Yemen * 354 31 9.60% 8 84 4 5.00% 15 14 98 256 3 23.729% 85.714% 29,825,964 0.001% 0.001%
200 Ethiopia * 1,344 85 7.25% 10 87 14 1 9.09% 8 2 231 245 1,099 1.042% 5.714% 114,963,588 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
201 Eritrea * 39 39 39 3,546,421 0.001%
202 Uganda * 489 40 9.59% 8 32 82 82 407 45,741,007 0.001% 0.001%
203 Gambia * 25 1 20 21 4 4.000% 4.762% 2,416,668 0.001%
204 Namibia * 25 1 4.17% 17 16 16 9 2,540,905 0.001%
205 Mozambique * 307 53 2 98 100 207 0.651% 2.000% 31,255,435 0.001% 0.001%
206 Tanzania * 509 21 183 204 305 4.126% 10.294% 59,734,218 0.001% 0.001%
207 Cambodia * 125 123 123 2 16,718,965 0.001%
208 Syria * 123 1 0.82% 85 6 1 50 56 67 4.878% 10.714% 17,500,658 0.001%
209 Burundi * 63 1 33 34 29 1.587% 2.941% 11,890,784 0.001%
210 Myanmar * 232 4 1.79% 40 4 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,441,152 105,341 1.69% 42 100,107 380,265 3,044 0.82% 86 4,045 2,740,768 3,121,033 3,320,119 11,652 5.904% 12.184% 7,800,000,000 0.083% 0.043% 0.005%
211 Vietnam * 328 298 298 30 97,338,579
212 Angola * 86 2 2.38% 30 4 18 22 64 4.651% 18.182% 32,866,272
213 Laos * 19 16 16 3 7,275,560
214 Lesotho * 2 1 1 1 2,142,249
215 Papua New... * 8 8 8 8,947,024
Running Time: 192.963 milliseconds.


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