1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: branches chart (resolve #322)

This commit is contained in:
Ferdinand Mütsch
2022-02-22 08:19:51 +01:00
parent 784adec3c1
commit 302eb33b1b
3 changed files with 7 additions and 4 deletions

View File

@ -21,6 +21,7 @@ LANGUAGES = {
'PHP': 'php',
'Blade': 'blade.php'
}
BRANCHES = ['master', 'feature-1', 'feature-2']
class Heartbeat:
@ -65,6 +66,7 @@ def generate_data(n: int, n_projects: int = 5, n_past_hours: int = 24) -> List[H
p: str = random.choice(projects)
l: str = random.choice(languages)
f: str = randomword(random.randint(2, 8))
b: str = random.choice(BRANCHES)
delta: timedelta = timedelta(
hours=random.randint(0, n_past_hours - 1),
minutes=random.randint(0, 59),
@ -77,6 +79,7 @@ def generate_data(n: int, n_projects: int = 5, n_past_hours: int = 24) -> List[H
entity=f'/home/me/dev/{p}/{f}.{LANGUAGES[l]}',
project=p,
language=l,
branch=b,
time=(now - delta).timestamp()
))