Skip to content

Commit d061596

Browse files
author
Rustam Sadykov
committed
formatting changes
1 parent 00a84b8 commit d061596

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

docs/NightStatisticsMonitoring.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ Example output:
9999
"test_classes_failed_to_compile": 0.33333333333333337,
100100
"avg_coverage": 61.49729464685574,
101101
"total_coverage": 53.47106015409328,
102-
"timestamp": 1659715928.5049753
102+
"timestamp": 1659715928504
103103
}
104104
]
105-
```
105+
```
106+
107+
### Grafana
108+
Also, we can use [Grafana](https://monitoring.utbot.org) for more dynamic and detailed statistics visualization.
109+
Grafana pulls data from our repository automatically by GitHub API.

monitoring/draw_stats_graphs.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
import matplotlib.pyplot as plt
99
from matplotlib.dates import DayLocator, ConciseDateFormatter
1010

11-
DPI = 128
12-
WIDTH = 20
13-
HEIGHT = 10
11+
DPI = 108
12+
WIDTH = 10
13+
HEIGHT = 5
14+
MILLIS_IN_SEC = 1000
1415

1516

1617
def load(json_file):
@@ -39,7 +40,8 @@ def transform_and_combine_stats(stats_list):
3940
for key in transformed:
4041
new_stats[key] = new_stats[key] + (transformed[key] - new_stats[key]) / n
4142

42-
new_stats["timestamp"] = time()
43+
# need milliseconds
44+
new_stats["timestamp"] = round(time() * MILLIS_IN_SEC)
4345

4446
return new_stats
4547

@@ -56,7 +58,7 @@ def update_stats_history(history_file, new_stats_file):
5658

5759

5860
def get_history_x(history):
59-
return list(map(lambda x: datetime.fromtimestamp(x["timestamp"]), history))
61+
return list(map(lambda x: datetime.fromtimestamp(x["timestamp"] / MILLIS_IN_SEC), history))
6062

6163

6264
def get_history_y_seq(history):
@@ -86,7 +88,7 @@ def get_subplot(title):
8688

8789

8890
def postprocess_plot(ax):
89-
ax.legend(loc="upper left")
91+
ax.legend(bbox_to_anchor=(1.04, 1), loc="upper left")
9092

9193

9294
def render_history(history, coverage_graph_file, quantitative_graph_file):

0 commit comments

Comments
 (0)