# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
1 USA * 1,972,012 27,444 1.43% 49 25,485 111,529 1,136 1.03% 68 384 738,742 850,271 1,121,741 337 5.656% 13.117% 331,002,651 0.596% 0.339% 0.034%
2 Brazil * 650,504 35,596 5.98% 12 19,796 35,139 1,587 4.80% 15 514 302,084 337,223 313,281 165 5.402% 10.420% 212,559,417 0.306% 0.147% 0.017%
3 Russia * 458,689 8,726 1.98% 36 8,855 5,725 144 2.67% 27 197 221,388 227,113 231,576 39 1.248% 2.521% 145,934,462 0.314% 0.159% 0.004%
4 India * 243,733 9,471 4.18% 17 7,549 6,845 286 4.49% 16 196 117,404 124,249 119,484 5 2.808% 5.509% 1,380,004,385 0.018% 0.009%
5 Chile * 127,745 4,207 3.56% 20 5,246 1,541 92 6.78% 11 93 95,631 97,172 30,573 81 1.206% 1.586% 19,116,201 0.668% 0.160% 0.008%
6 Pakistan * 93,983 3,985 4.67% 16 4,734 1,935 68 3.84% 19 97 32,581 34,516 59,467 9 2.059% 5.606% 220,892,340 0.043% 0.027% 0.001%
7 Mexico * 110,026 4,442 4.39% 17 4,346 13,170 816 6.96% 11 625 78,590 91,760 18,266 102 11.970% 14.353% 128,932,753 0.085% 0.014% 0.010%
8 Saudi Arabia * 98,869 2,591 2.78% 26 3,121 676 31 5.07% 15 34 71,791 72,467 26,402 19 0.684% 0.933% 34,813,871 0.284% 0.076% 0.002%
9 Bangladesh * 63,026 2,828 4.91% 15 2,635 846 30 3.84% 19 35 13,325 14,171 48,855 5 1.342% 5.970% 164,689,383 0.038% 0.030% 0.001%
10 Iran * 169,425 2,886 1.76% 40 2,269 8,209 63 0.78% 90 75 132,038 140,247 29,178 98 4.845% 5.853% 83,992,949 0.202% 0.035% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
11 Qatar * 67,195 1,754 2.75% 26 1,700 51 4 8.89% 9 2 42,527 42,578 24,617 18 0.076% 0.120% 2,881,053 2.332% 0.854% 0.002% 0.001%
12 UK * 284,868 1,650 0.59% 119 1,557 40,465 357 0.89% 78 204 40,465 244,403 596 14.205% 100.000% 67,886,011 0.420% 0.360% 0.060% 0.001%
13 Colombia * 36,635 1,766 5.29% 14 1,515 1,145 42 4.02% 18 58 13,638 14,783 21,852 23 3.125% 7.745% 50,882,891 0.072% 0.043% 0.002%
14 Iraq * 11,098 1,006 11.38% 7 1,252 318 14 5.17% 14 33 4,904 5,222 5,876 8 2.865% 6.090% 40,222,493 0.028% 0.015% 0.001%
15 Indonesia * 30,514 703 2.44% 29 993 1,801 49 2.85% 25 31 9,907 11,708 18,806 7 5.902% 15.383% 273,523,615 0.011% 0.007% 0.001%
16 Sweden * 43,887 1,056 2.52% 28 948 4,656 77 1.69% 42 17 4,656 39,231 461 10.609% 100.000% 10,099,265 0.435% 0.388% 0.046% 0.005%
17 Oman * 16,016 770 5.38% 14 930 72 5 7.46% 10 3,451 3,523 12,493 14 0.450% 2.044% 5,106,626 0.314% 0.245% 0.001%
18 Belarus * 47,751 887 1.93% 37 883 263 6 2.37% 30 4 23,015 23,278 24,473 28 0.551% 1.130% 9,449,323 0.505% 0.259% 0.003%
19 Argentina * 21,037 929 4.82% 15 840 642 27 4.59% 16 27 6,180 6,822 14,215 14 3.052% 9.411% 45,195,774 0.047% 0.031% 0.001%
20 Philippines 21,340 244 1.20% 59 714 994 3 0.30% 228 7 4,441 5,435 15,905 9 4.658% 18.289% 109,581,078 0.019% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
21 Afghanistan * 19,551 915 5.07% 15 582 320 9 3.00% 24 11 1,820 2,140 17,411 8 1.637% 14.953% 38,928,346 0.050% 0.045% 0.001%
22 Poland * 25,986 362 1.45% 49 576 1,153 20 1.79% 40 16 12,641 13,794 12,192 30 4.437% 8.359% 37,846,611 0.069% 0.032% 0.003%
23 Ukraine * 26,514 553 2.18% 33 550 777 15 2.01% 35 15 11,812 12,589 13,925 18 2.931% 6.172% 43,733,762 0.061% 0.032% 0.002%
24 Armenia * 12,364 596 5.31% 14 547 190 7 3.98% 18 7 3,720 3,910 8,454 64 1.537% 4.859% 2,963,243 0.417% 0.285% 0.006% 0.002%
25 Dominican... * 19,195 389 2.12% 33 487 536 5 0.96% 73 11 11,919 12,455 6,740 49 2.792% 4.303% 10,847,910 0.177% 0.062% 0.005%
26 Kuwait * 31,131 723 2.42% 30 487 254 8 3.39% 21 10 19,282 19,536 11,595 60 0.816% 1.300% 4,270,571 0.729% 0.272% 0.006% 0.001%
27 Bolivia * 12,728 607 5.22% 14 483 427 15 3.75% 19 12 1,739 2,166 10,562 37 3.355% 19.714% 11,673,021 0.109% 0.090% 0.004%
28 Canada * 94,790 625 0.67% 105 465 7,738 66 0.86% 81 36 52,932 60,670 34,120 205 8.163% 12.754% 37,742,154 0.251% 0.090% 0.021% 0.001%
29 Panama * 15,463 435 2.98% 24 419 370 6 1.68% 42 7 9,719 10,089 5,374 86 2.393% 3.667% 4,314,767 0.358% 0.125% 0.009% 0.002%
30 Bahrain * 14,224 539 4.05% 18 389 23 1 4.76% 15 1 9,020 9,043 5,181 14 0.162% 0.254% 1,701,575 0.836% 0.304% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
31 Azerbaijan * 7,239 338 5.18% 14 379 84 4 5.13% 14 2 4,024 4,108 3,131 8 1.160% 2.045% 10,139,177 0.071% 0.031% 0.001%
32 Singapore * 37,527 261 0.71% 99 344 25 1 24,559 24,584 12,943 4 0.067% 0.102% 5,850,342 0.641% 0.221%
33 Guatemala * 6,485 394 6.84% 11 331 216 15 10.49% 7 58 1,053 1,269 5,216 12 3.331% 17.021% 17,915,568 0.036% 0.029% 0.001%
34 Nigeria * 11,844 350 3.13% 23 328 333 8 2.54% 28 10 3,696 4,029 7,815 2 2.812% 8.265% 206,139,589 0.006% 0.004%
35 Nepal * 3,235 278 10.55% 7 323 13 1 10.00% 8 2 365 378 2,857 0.402% 3.439% 29,136,808 0.011% 0.010%
36 Ghana * 9,462 283 3.19% 23 294 44 4 10.53% 7 2 3,547 3,591 5,871 1 0.465% 1.225% 31,072,940 0.030% 0.019%
37 Moldova * 9,511 229 2.54% 28 264 331 8 2.54% 28 8 5,450 5,781 3,730 82 3.480% 5.726% 4,033,963 0.236% 0.092% 0.008% 0.002%
38 Cameroon * 7,599 603 8.88% 9 207 212 2 0.99% 71 7 4,587 4,799 2,800 8 2.790% 4.418% 26,545,863 0.029% 0.011% 0.001%
39 Kazakhstan * 12,511 245 2.03% 35 199 53 1 6,903 6,956 5,555 3 0.424% 0.762% 18,776,707 0.067% 0.030%
40 Romania * 20,290 196 0.98% 71 187 1,318 10 0.77% 91 2 14,419 15,737 4,553 68 6.496% 8.375% 19,237,691 0.105% 0.024% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
41 Haiti * 2,924 100 3.79% 19 184 50 24 74 2,850 4 1.710% 67.568% 11,402,528 0.026% 0.025%
42 Netherlands * 47,335 210 0.45% 156 183 6,011 15 0.25% 278 6 6,011 41,324 351 12.699% 100.000% 17,134,872 0.276% 0.241% 0.035% 0.002%
43 Belgium * 59,072 140 0.24% 292 165 9,580 18 0.19% 369 14 16,190 25,770 33,302 827 16.217% 37.175% 11,589,623 0.510% 0.287% 0.083% 0.007%
44 Sudan * 5,865 215 3.91% 19 151 347 19 6.05% 12 14 1,924 2,271 3,594 8 5.916% 15.280% 43,849,260 0.013% 0.008% 0.001%
45 Gabon * 3,101 53 1.83% 39 146 21 1 5.00% 15 833 854 2,247 9 0.677% 2.459% 2,225,734 0.139% 0.101% 0.001%
46 Israel 17,706 67 0.38% 182 144 292 1 15,042 15,334 2,372 32 1.649% 1.904% 8,655,535 0.205% 0.027% 0.003%
47 Ethiopia * 1,934 169 10.33% 8 129 20 1 5.56% 13 1 281 301 1,633 1.034% 6.645% 114,963,588 0.002% 0.001%
48 Kenya * 2,600 134 5.73% 13 126 83 1 1.28% 55 4 643 726 1,874 2 3.192% 11.433% 53,771,296 0.005% 0.003%
49 North... * 2,915 179 6.86% 11 125 151 2 1.36% 52 2 1,640 1,791 1,124 72 5.180% 8.431% 2,083,374 0.140% 0.054% 0.007% 0.003%
50 DRC * 3,878 120 3.29% 22 114 82 3 3.85% 19 1 537 619 3,259 1 2.114% 13.247% 89,561,403 0.004% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
51 Senegal * 4,249 134 3.33% 22 94 47 2 2,512 2,559 1,690 3 1.106% 1.837% 16,743,927 0.025% 0.010%
52 Honduras * 5,971 190 3.34% 22 91 248 9 3.85% 19 5 677 925 5,046 25 4.153% 26.811% 9,904,607 0.060% 0.051% 0.003%
53 El Salvador * 2,934 68 2.45% 29 85 53 2 3.92% 19 1,281 1,334 1,600 8 1.806% 3.973% 6,486,205 0.045% 0.025% 0.001%
54 Somalia * 2,289 85 82 3 431 513 1,776 5 3.582% 15.984% 15,893,222 0.014% 0.011% 0.001%
55 Serbia * 11,741 96 0.83% 84 74 248 1 0.41% 171 1 11,056 11,304 437 28 2.112% 2.194% 8,737,371 0.134% 0.005% 0.003%
56 Morocco * 8,132 68 0.85% 82 61 208 7,278 7,486 646 6 2.558% 2.779% 36,910,560 0.022% 0.002% 0.001%
57 Venezuela * 2,145 135 6.92% 11 58 20 334 354 1,791 1 0.932% 5.650% 28,435,940 0.008% 0.006%
58 Mozambique * 409 2 0.57% 123 55 2 126 128 281 0.489% 1.563% 31,255,435 0.001% 0.001%
59 Austria * 16,898 38 0.23% 307 55 672 2 0.30% 233 15,789 16,461 437 75 3.977% 4.082% 9,006,398 0.188% 0.005% 0.007% 0.001%
60 Madagascar * 1,026 18 1.88% 38 51 8 1 212 220 806 0.780% 3.636% 27,691,018 0.004% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
61 S. Korea * 11,719 39 0.34% 208 51 273 10,531 10,804 915 5 2.330% 2.527% 51,269,185 0.023% 0.002% 0.001%
62 French... * 639 33 5.94% 13 50 1 348 349 290 3 0.156% 0.287% 298,682 0.214% 0.097% 0.001%
63 Denmark * 11,924 64 0.54% 129 49 587 4 0.69% 102 1 10,721 11,308 616 101 4.923% 5.191% 5,792,202 0.206% 0.011% 0.010% 0.002%
64 Japan * 17,064 32 0.19% 369 46 907 3 0.33% 209 4 14,972 15,879 1,185 7 5.315% 5.712% 126,476,461 0.013% 0.001% 0.001%
65 Djibouti * 4,169 69 1.70% 42 46 26 1,815 1,841 2,328 26 0.624% 1.412% 988,000 0.422% 0.236% 0.003% 0.003%
66 Bulgaria * 2,668 42 1.62% 44 41 160 12 8.16% 9 1 1,528 1,688 980 23 5.997% 9.479% 6,948,445 0.038% 0.014% 0.002%
67 Cuba * 2,173 14 0.66% 106 40 83 1,855 1,938 235 7 3.820% 4.283% 11,326,616 0.019% 0.002% 0.001%
68 Mali * 1,523 24 1.64% 43 38 90 2 2.35% 30 3 845 935 588 4 5.909% 9.626% 20,250,833 0.008% 0.003%
69 Kyrgyzstan * 1,974 37 1.95% 36 38 22 2 10.00% 8 1,360 1,382 592 3 1.114% 1.592% 6,524,195 0.030% 0.009%
70 Malaysia * 8,303 19 0.23% 302 37 117 1 0.87% 81 1 6,635 6,752 1,551 4 1.409% 1.733% 32,365,999 0.026% 0.005%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
71 Libya * 239 13 6.63% 11 30 5 52 57 182 1 2.092% 8.772% 6,871,292 0.003% 0.003%
72 Guinea-Bi... * 1,368 29 12 4 153 165 1,203 6 0.877% 7.273% 1,968,001 0.070% 0.061% 0.001%
73 Zimbabwe * 265 15 6.76% 11 28 4 33 37 228 1.509% 10.811% 14,862,924 0.002% 0.002%
74 Finland * 6,964 30 0.43% 161 23 322 5,800 6,122 842 58 4.624% 5.260% 5,540,720 0.126% 0.015% 0.006% 0.001%
75 Estonia * 1,931 20 1.06% 66 21 69 1,675 1,744 187 52 3.573% 3.956% 1,326,535 0.146% 0.014% 0.005% 0.004%
76 Norway * 8,531 22 0.26% 268 21 238 8,138 8,376 155 44 2.790% 2.841% 5,421,241 0.157% 0.003% 0.004% 0.001%
77 Albania * 1,232 15 1.25% 56 20 34 1 925 959 273 12 2.760% 3.545% 2,877,797 0.043% 0.009% 0.001%
78 Switzerland * 30,956 23 0.07% 932 20 1,921 28,600 30,521 435 222 6.206% 6.294% 8,654,622 0.358% 0.005% 0.022% 0.003%
79 Hungary * 3,990 16 0.40% 172 20 545 3 0.56% 125 3 2,279 2,824 1,166 56 13.659% 19.299% 9,660,351 0.041% 0.012% 0.006% 0.001%
80 Sierra Leone * 946 15 1.64% 43 17 48 1 600 648 298 6 5.074% 7.407% 7,976,983 0.012% 0.004% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
81 Uzbekistan * 4,022 68 1.73% 41 15 16 3,247 3,263 759 1 0.398% 0.490% 33,469,203 0.012% 0.002%
82 Greece * 2,980 15 0.51% 137 13 180 1,374 1,554 1,426 17 6.040% 11.583% 10,423,054 0.029% 0.014% 0.002%
83 Lithuania * 1,705 7 0.41% 168 11 71 1,321 1,392 313 26 4.164% 5.101% 2,722,289 0.063% 0.011% 0.003% 0.001%
84 Jordan * 795 19 2.48% 29 11 9 586 595 200 1 1.132% 1.513% 10,203,134 0.008% 0.002%
85 Czechia * 9,530 42 0.44% 157 10 327 2 0.62% 113 6,881 7,208 2,322 31 3.431% 4.537% 10,708,981 0.089% 0.022% 0.003%
86 Sri Lanka * 1,810 4 0.22% 312 9 11 891 902 908 1 0.608% 1.220% 21,413,249 0.008% 0.004%
87 Lebanon * 1,320 6 0.46% 152 8 29 1 768 797 523 4 2.197% 3.639% 6,825,445 0.019% 0.008%
88 Cabo Verde * 542 34 6.77% 11 6 5 240 245 297 9 0.923% 2.041% 555,987 0.097% 0.053% 0.001% 0.002%
89 Slovenia * 1,484 2 0.14% 513 5 109 1,359 1,468 16 52 7.345% 7.425% 2,078,938 0.071% 0.001% 0.005% 0.003%
90 Australia * 7,255 11 0.15% 457 4 102 6,690 6,792 463 4 1.406% 1.502% 25,499,884 0.028% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
91 Myanmar * 240 4 6 156 162 78 2.500% 3.704% 54,409,800
92 Jamaica * 595 4 10 385 395 200 3 1.681% 2.532% 2,961,167 0.020% 0.007%
93 Namibia * 29 4 16 16 13 2,540,905 0.001% 0.001%
94 Luxembourg * 4,035 5 0.12% 559 3 110 3,888 3,998 37 176 2.726% 2.751% 625,978 0.645% 0.006% 0.018% 0.028%
95 Hong Kong * 1,106 4 0.36% 191 3 4 1,048 1,052 54 1 0.362% 0.380% 7,496,981 0.015% 0.001%
96 Georgia * 808 4 0.50% 140 3 13 663 676 132 3 1.609% 1.923% 3,989,167 0.020% 0.003%
97 China * 83,030 5 0.01% 11,510 3 4,634 78,329 82,963 67 3 5.581% 5.586% 1,439,323,776 0.006%
98 Mongolia * 193 5 2.69% 27 2 71 71 122 3,278,290 0.006% 0.004%
99 Slovakia * 1,528 2 28 1,379 1,407 121 5 1.832% 1.990% 5,459,642 0.028% 0.002% 0.001%
100 Channel... * 563 2 46 512 558 5 265 8.171% 8.244% 173,863 0.324% 0.003% 0.026% 0.152%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
101 Malta * 627 3 0.48% 145 2 9 596 605 22 20 1.435% 1.488% 441,543 0.142% 0.005% 0.002% 0.005%
102 Thailand * 3,104 1 0.03% 2,150 2 58 2,971 3,029 75 1 1.869% 1.915% 69,799,978 0.004%
103 Martinique * 202 2 14 98 112 90 37 6.931% 12.500% 375,265 0.054% 0.024% 0.004% 0.010%
104 Uruguay * 834 4 0.48% 144 2 23 721 744 90 7 2.758% 3.091% 3,473,730 0.024% 0.003% 0.001%
105 Suriname * 91 8 9.76% 8 1 1 9 10 81 2 1.099% 10.000% 586,632 0.016% 0.014%
106 Latvia * 1,086 3 0.28% 251 1 25 781 806 280 13 2.302% 3.102% 1,886,198 0.058% 0.015% 0.001% 0.001%
107 Gibraltar * 175 1 0.58% 121 1 155 155 20 33,691 0.519% 0.059%
108 Germany * 185,414 490 0.26% 262 1 8,763 27 0.31% 225 168,900 177,663 7,751 105 4.726% 4.932% 83,783,942 0.221% 0.009% 0.010%
109 Belize * 19 1 2 16 18 1 5 10.526% 11.111% 397,628 0.005% 0.001% 0.001%
110 Vietnam * 329 1 307 307 22 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
111 Seychelles * 11 11 11 98,347 0.011%
112 San Marino * 680 2 0.29% 236 42 428 470 210 1,238 6.176% 8.936% 33,931 2.004% 0.619% 0.124% 3.649%
113 Bermuda * 141 9 114 123 18 144 6.383% 7.317% 62,278 0.226% 0.029% 0.014% 0.231%
114 Rwanda * 420 10 2.44% 29 2 282 284 136 0.476% 0.704% 12,952,218 0.003% 0.001%
115 Bhutan * 48 1 2.13% 33 11 11 37 771,608 0.006% 0.005%
116 Ré... * 480 1 0.21% 333 1 411 412 68 1 0.208% 0.243% 895,312 0.054% 0.008%
117 Portugal * 33,969 377 1.12% 63 1,465 10 0.69% 102 20,526 21,991 11,978 144 4.313% 6.662% 10,196,709 0.333% 0.117% 0.014% 0.001%
118 Bosnia... * 2,606 12 0.46% 151 159 1,968 2,127 479 48 6.101% 7.475% 3,280,819 0.079% 0.015% 0.005% 0.001%
119 Benin * 261 3 151 154 107 1.149% 1.948% 12,123,200 0.002% 0.001%
120 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
121 Sao Tome... * 499 14 2.89% 25 12 68 80 419 55 2.405% 15.000% 219,159 0.228% 0.191% 0.005% 0.025%
122 Barbados * 92 7 81 88 4 24 7.609% 7.955% 287,375 0.032% 0.001% 0.002% 0.008%
123 Sint Maarten * 77 15 61 76 1 350 19.481% 19.737% 42,876 0.180% 0.002% 0.035% 0.816%
124 Saint... * 1 1 1 5,794 0.017%
125 Saint Lucia * 19 1 5.56% 13 18 18 1 183,627 0.010% 0.001%
126 Saint Martin * 41 3 33 36 5 78 7.317% 8.333% 38,666 0.106% 0.013% 0.008% 0.202%
127 Bahamas * 102 11 55 66 36 28 10.784% 16.667% 393,244 0.026% 0.009% 0.003% 0.007%
128 Antigua... * 26 3 20 23 3 31 11.538% 13.043% 97,929 0.027% 0.003% 0.003% 0.032%
129 UAE * 37,642 624 1.69% 42 274 1 0.37% 190 20,337 20,611 17,031 28 0.728% 1.329% 9,890,402 0.381% 0.172% 0.003%
130 Uganda * 557 35 6.70% 11 82 82 475 45,741,007 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
131 Turks and... * 12 1 11 12 26 8.333% 8.333% 38,717 0.031% 0.003% 0.067%
132 Turkey * 168,340 930 0.56% 126 4,648 18 0.39% 179 133,400 138,048 30,292 55 2.761% 3.367% 84,339,067 0.200% 0.036% 0.006%
133 Tunisia * 1,087 49 977 1,026 61 4 4.508% 4.776% 11,818,619 0.009% 0.001%
134 Angola * 86 4 21 25 61 4.651% 16.000% 32,866,272
135 Andorra * 852 51 741 792 60 660 5.986% 6.439% 77,265 1.103% 0.078% 0.066% 0.854%
136 Yemen * 469 16 3.53% 20 111 8 7.77% 10 23 134 335 4 23.667% 82.836% 29,825,964 0.002% 0.001%
137 Zambia * 1,089 7 912 919 170 0.643% 0.762% 18,383,955 0.006% 0.001%
138 Western... * 9 1 6 7 2 2 11.111% 14.286% 597,339 0.002%
139 Vatican City * 12 2 2 10 825 1.455% 1.212%
140 Algeria * 9,935 104 1.06% 66 690 9 1.32% 53 6,453 7,143 2,792 16 6.945% 9.660% 43,851,044 0.023% 0.006% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
141 Trinidad... * 117 8 108 116 1 6 6.838% 6.897% 1,399,488 0.008% 0.001%
142 Togo * 485 20 4.30% 17 13 240 253 232 2 2.680% 5.138% 8,278,724 0.006% 0.003%
143 St. Barth * 6 6 6 9,877 0.061%
144 St.... * 26 15 15 11 110,940 0.023% 0.010%
145 Spain * 288,058 318 0.11% 628 27,134 1 18,808 27,134 260,924 580 9.420% 100.000% 46,754,778 0.616% 0.558% 0.058% 0.001%
146 South Sudan * 994 10 6 16 978 1 1.006% 62.500% 11,193,725 0.009% 0.009%
147 South Africa * 43,434 2,642 6.48% 12 908 60 7.08% 11 23,088 23,996 19,438 15 2.091% 3.784% 59,308,690 0.073% 0.033% 0.002%
148 Botswana * 40 1 23 24 16 2.500% 4.167% 2,351,627 0.002% 0.001%
149 Anguilla * 3 3 3 15,003 0.020%
150 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 6,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
151 Timor-Leste * 24 24 24 1,318,445 0.002%
152 Tajikistan * 4,370 81 1.89% 38 48 2,491 2,539 1,831 5 1.098% 1.891% 9,537,645 0.046% 0.019% 0.001%
153 Taiwan * 443 7 429 436 7 1.580% 1.606% 23,816,775 0.002%
154 Syria * 124 6 53 59 65 4.839% 10.169% 17,500,658 0.001%
155 Aruba * 101 3 98 101 28 2.970% 2.970% 106,766 0.095% 0.003% 0.026%
156 New... * 20 18 18 2 285,498 0.007% 0.001%
157 Isle of Man * 336 24 312 336 282 7.143% 7.143% 85,033 0.395% 0.028% 0.332%
158 Diamond... * 712 13 651 664 48 1.826% 1.958% 3,711 19.186% 1.293% 0.350%
159 Ireland * 25,163 21 0.08% 831 1,670 6 0.36% 193 22,698 24,368 795 338 6.637% 6.853% 4,937,786 0.510% 0.016% 0.034% 0.007%
160 Dominica * 18 16 16 2 71,986 0.025% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
161 Egypt * 31,115 1,348 4.53% 16 1,166 40 3.55% 20 8,158 9,324 21,791 11 3.747% 12.505% 102,334,404 0.030% 0.021% 0.001%
162 Ecuador * 41,575 609 1.49% 47 3,534 48 1.38% 51 20,568 24,102 17,473 201 8.500% 14.663% 17,643,054 0.236% 0.099% 0.020% 0.001%
163 Italy * 234,531 518 0.22% 314 33,774 85 0.25% 276 163,781 197,555 36,976 559 14.401% 17.096% 60,461,826 0.388% 0.061% 0.056% 0.001%
164 Ivory Coast * 3,431 169 5.18% 14 36 1 2.86% 25 1,604 1,640 1,791 1 1.049% 2.195% 26,378,274 0.013% 0.007%
165 Costa Rica * 1,228 34 2.85% 25 10 695 705 523 2 0.814% 1.418% 5,094,118 0.024% 0.010%
166 Laos * 19 18 18 1 7,275,560
167 Croatia * 2,247 104 1 2,121 2,225 22 25 4.628% 4.674% 4,105,267 0.055% 0.001% 0.003% 0.001%
168 Cura&cced... * 21 1 15 16 5 6 4.762% 6.250% 164,093 0.013% 0.003% 0.001% 0.004%
169 Cyprus * 960 2 0.21% 333 17 807 824 136 14 1.771% 2.063% 1,207,359 0.080% 0.011% 0.001% 0.001%
170 Equatoria... * 1,306 12 200 212 1,094 9 0.919% 5.660% 1,402,985 0.093% 0.078% 0.001% 0.001%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
171 Iceland * 1,806 10 1,794 1,804 2 29 0.554% 0.554% 341,243 0.529% 0.001% 0.003% 0.008%
172 Gambia * 26 1 21 22 4 3.846% 4.545% 2,416,668 0.001%
173 Faeroe... * 187 187 187 48,863 0.383%
174 Falkland... * 13 13 13 3,480 0.374%
175 French... * 60 60 60 280,908 0.021%
176 France * 153,055 611 0.40% 174 29,111 46 0.16% 439 70,504 99,615 53,440 446 19.020% 29.224% 65,273,511 0.234% 0.082% 0.045% 0.001%
177 Fiji * 18 18 18 896,445 0.002%
178 Greenland * 13 13 13 56,770 0.023%
179 Grenada * 23 22 22 1 112,523 0.020% 0.001%
180 Guyana * 153 12 77 89 64 15 7.843% 13.483% 786,552 0.019% 0.008% 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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
181 Eritrea * 39 39 39 3,546,421 0.001%
182 Guinea * 4,060 127 3.23% 22 23 2,667 2,690 1,370 2 0.567% 0.855% 13,132,795 0.031% 0.010%
183 Eswatini * 305 5 1.67% 42 3 221 224 81 3 0.984% 1.339% 1,160,164 0.026% 0.007%
184 Guadeloupe * 164 2 1.23% 57 14 144 158 6 35 8.537% 8.861% 400,124 0.041% 0.001% 0.003% 0.009%
185 Lesotho * 4 2 2 2 2,142,249
186 Liberia * 334 13 4.05% 18 30 2 7.14% 11 176 206 128 6 8.982% 14.563% 5,057,681 0.007% 0.003% 0.001%
187 Niger * 966 5 0.52% 134 65 863 928 38 3 6.729% 7.004% 24,206,644 0.004%
188 Cambodia * 125 123 123 2 16,718,965 0.001%
189 Nicaragua * 1,118 46 370 416 702 7 4.114% 11.058% 6,624,554 0.017% 0.011% 0.001%
190 New Zealand * 1,504 22 1,481 1,503 1 4 1.463% 1.464% 4,822,233 0.031%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
191 Caribbean... * 7 7 7 26,223 0.027%
192 CAR * 1,451 163 12.66% 6 4 29 33 1,418 1 0.276% 12.121% 4,829,767 0.030% 0.029%
193 Burundi * 63 1 33 34 29 1.587% 2.941% 11,890,784 0.001%
194 Burkina Faso * 888 3 0.34% 205 53 760 813 75 3 5.968% 6.519% 20,903,273 0.004%
195 Paraguay * 1,087 1 0.09% 754 11 516 527 560 2 1.012% 2.087% 7,132,538 0.015% 0.008%
196 Peru * 187,400 4,202 2.29% 31 5,162 131 2.60% 27 79,214 84,376 103,024 157 2.755% 6.118% 32,971,854 0.568% 0.312% 0.016%
197 Papua New... * 8 8 8 8,947,024
198 Brunei * 141 2 138 140 1 5 1.418% 1.429% 437,479 0.032% 0.001%
199 Palestine * 464 3 400 403 61 1 0.647% 0.744% 5,101,414 0.009% 0.001%
200 MS Zaandam * 9 2 2 7 22.222% 100.000% 1,243 0.724% 0.563% 0.161%
# Legend cases yesterday growth dt today deaths yesterday growth ddt today recovered closed active tests death% Cdeath% population casesRate activeRate Pdeath% testRate
* World 6,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
201 Cayman... * 164 4 2.50% 29 1 93 94 70 15 0.610% 1.064% 65,722 0.250% 0.107% 0.002% 0.023%
202 Maldives * 1,883 11 0.59% 119 8 1 717 725 1,158 15 0.425% 1.103% 540,544 0.348% 0.214% 0.001% 0.003%
203 Comoros * 132 2 55 57 75 2 1.515% 3.509% 869,601 0.015% 0.009%
204 Malawi * 409 16 4.07% 18 4 55 59 350 0.978% 6.780% 19,129,952 0.002% 0.002%
205 Congo * 635 24 3.93% 18 20 182 202 433 4 3.150% 9.901% 5,518,087 0.012% 0.008%
206 Liechtens... * 82 1 55 56 26 26 1.220% 1.786% 38,128 0.215% 0.068% 0.003% 0.068%
207 Macao * 45 45 45 649,335 0.007%
208 Mauritania * 883 99 12.63% 6 43 4 10.26% 8 69 112 771 9 4.870% 38.393% 4,649,658 0.019% 0.017% 0.001%
209 Mauritius * 337 2 0.60% 117 10 324 334 3 8 2.967% 2.994% 1,271,768 0.026% 0.001% 0.001%
210 Montserrat * 11 1 10 11 200 9.091% 9.091% 4,992 0.220% 0.020% 4.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,907,567 138,487 2.08% 34 106,186 399,593 5,643 1.44% 49 2,929 3,174,625 3,574,218 3,333,349 11,950 5.785% 11.180% 7,800,000,000 0.089% 0.043% 0.005%
211 Chad * 836 8 0.97% 73 68 2 3.03% 24 657 725 111 4 8.134% 9.379% 16,425,864 0.005% 0.001%
212 Montenegro * 324 9 315 324 14 2.778% 2.778% 628,066 0.052% 0.001% 0.002%
213 Monaco * 99 4 93 97 2 102 4.040% 4.124% 39,242 0.252% 0.005% 0.010% 0.260%
214 Mayotte * 2,079 21 1.02% 69 25 1,523 1,548 531 92 1.203% 1.615% 272,815 0.762% 0.195% 0.009% 0.034%
215 British... * 8 1 7 8 33 12.500% 12.500% 30,231 0.026% 0.003% 0.109%
Running Time: 198.777 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