Skip to content

Commit

Permalink
Merge pull request #41 from george0st/changes
Browse files Browse the repository at this point in the history
Shorter human format
  • Loading branch information
george0st authored Sep 24, 2024
2 parents 73fd8af + 99d0c15 commit 85c6fe4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
15 changes: 8 additions & 7 deletions qgate_perf/file_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ class FileFormat:
PRF_DETAIL_TIME_START = "startexec"
PRF_DETAIL_TIME_END = "endexec"
# detail for HUMAN
HR_PRF_DETAIL_STDEV = "stdev"
HR_PRF_DETAIL_CALLS = "call"
HR_PRF_DETAIL_AVRG = "avr"
HR_PRF_DETAIL_STDEV = "std"

# core output
PRF_CORE_TYPE = "core"
Expand All @@ -46,11 +48,10 @@ class FileFormat:
PRF_CORE_TOTAL_CALL_PER_SEC = "total_call_per_sec"
PRF_CORE_TIME_END = "endexec"
# core output for HUMAN
HM_PRF_CORE_PLAN_EXECUTOR_ALL = "plan_exec"
HM_PRF_CORE_PLAN_EXECUTOR = "plan_detail"
HM_PRF_CORE_PLAN_EXECUTOR_ALL = "plan"
HM_PRF_CORE_REAL_EXECUTOR = "exec"
HM_PRF_CORE_GROUP = "grp"
HM_PRF_CORE_TOTAL_CALL = "calls"
HM_PRF_CORE_AVRG_TIME = "avrg"
HM_PRF_CORE_STD_DEVIATION = "st-dev"
HM_PRF_CORE_TOTAL_CALL_PER_SEC = "call_sec"
HM_PRF_CORE_TOTAL_CALL = "call"
HM_PRF_CORE_TOTAL_CALL_PER_SEC = "callsec"
HM_PRF_CORE_AVRG_TIME = "avr"
HM_PRF_CORE_STD_DEVIATION = "std"
2 changes: 1 addition & 1 deletion qgate_perf/parallel_executor.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ def _print_detail(self, file, run_setup: RunSetup, return_dict, processes, threa
FileFormat.PRF_CORE_TIME_END: datetime.datetime.utcnow().isoformat(' ')
}
readable_out = {
FileFormat.HM_PRF_CORE_PLAN_EXECUTOR_ALL: f"{processes * threads} [{processes}, {threads}]",
FileFormat.HM_PRF_CORE_PLAN_EXECUTOR_ALL: f"{processes * threads} [{processes},{threads}]",
FileFormat.HM_PRF_CORE_REAL_EXECUTOR: count,
FileFormat.HM_PRF_CORE_GROUP: group,
FileFormat.HM_PRF_CORE_TOTAL_CALL: sum_call,
Expand Down
6 changes: 3 additions & 3 deletions qgate_perf/parallel_probe.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

class ParallelProbe:
""" Provider probe for parallel test tuning """
HUMAN_PRECISION = 5
HUMAN_PRECISION = 4

def __init__(self, run_setup: RunSetup, exception=None):
"""
Expand Down Expand Up @@ -120,8 +120,8 @@ def readable_str(self):

if self.exception is None:
return json.dumps({
FileFormat.PRF_DETAIL_CALLS: self.counter,
FileFormat.PRF_DETAIL_AVRG: nan if self.counter == 0 else round(self.total_duration / self.counter, ParallelProbe.HUMAN_PRECISION),
FileFormat.HR_PRF_DETAIL_CALLS: self.counter,
FileFormat.HR_PRF_DETAIL_AVRG: nan if self.counter == 0 else round(self.total_duration / self.counter, ParallelProbe.HUMAN_PRECISION),
FileFormat.PRF_DETAIL_MIN: round(self.min_duration, ParallelProbe.HUMAN_PRECISION),
FileFormat.PRF_DETAIL_MAX: round(self.max_duration, ParallelProbe.HUMAN_PRECISION),
FileFormat.HR_PRF_DETAIL_STDEV: round(self.standard_deviation, ParallelProbe.HUMAN_PRECISION)
Expand Down

0 comments on commit 85c6fe4

Please sign in to comment.