refactoring

This commit is contained in:
Devaev Maxim
2020-09-10 07:30:25 +03:00
parent a6385cd20e
commit 967afb2d9a
5 changed files with 25 additions and 11 deletions

View File

@@ -21,7 +21,6 @@
import asyncio
import operator
from typing import Any
from typing import List
@@ -29,6 +28,8 @@ from typing import List
from aiohttp.web import Request
from aiohttp.web import Response
from .... import tools
from ....plugins.atx import BaseAtx
from ..info import InfoManager
@@ -78,6 +79,6 @@ class ExportApi:
"",
])
elif isinstance(value, dict):
for (sub_key, sub_value) in sorted(value.items(), key=operator.itemgetter(0)):
for (sub_key, sub_value) in tools.sorted_kvs(value):
sub_path = (f"{path}_{sub_key}" if sub_key != "parsed_flags" else path)
self.__append_prometheus_rows(rows, sub_value, sub_path)