I have a dictionary something looks like this
{
'Host-A': {'requests':
{'GET /index.php/dashboard HTTP/1.0': {'code': '200', 'hit_count': 3},
'GET /index.php/cronjob HTTP/1.0': {'code': '200', 'hit_count': 4},
'GET /index.php/setup HTTP/1.0': {'code': '200', 'hit_count': 2}},
'total_hit_count': 9},
}
as you can see for 'Host-A'
the value is a dict contains requests received and hits count on each page.. the question is how to sort the 'requests'
in descending order. so then I can get the top requests .
example of correct solution output would be like:
{
'Host-A': {'requests':
{'GET /index.php/cronjob HTTP/1.0': {'code': '200', 'hit_count': 4},
'GET /index.php/dashboard HTTP/1.0': {'code': '200', 'hit_count': 3},
'GET /index.php/setup HTTP/1.0': {'code': '200', 'hit_count': 2}},
'total_hit_count': 9},
}
I appreciate your help