File size: 531 Bytes
a34cccb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from pydantic import BaseModel, Field
from datetime import datetime
from typing import Literal, List, Dict, Optional
import uuid

class Repo(BaseModel):
    id: str = Field(default_factory=lambda: str(uuid.uuid4()))
    namespace: str
    repo: str

class MetricPoint(BaseModel):
    timestamp: datetime
    cpu_usage_pct: float
    memory_used_bytes: int
    memory_total_bytes: int

class RepoStatus(BaseModel):
    state: Literal["CONNECTED", "DISCONNECTED", "ERROR"]
    stage: str
    last_updated: datetime