Repository navigation
Expand file tree
/
Copy pathapi.ts
More file actions
113 lines (98 loc) · 2.1 KB
/
Copy pathapi.ts
File metadata and controls
113 lines (98 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
// API Response Types
export interface ApiResponse<T> {
data: T;
message?: string;
status: number;
}
export interface PaginatedResponse<T> {
items: T[];
total: number;
page: number;
per_page: number;
pages: number;
}
export interface ErrorResponse {
detail:
| string
| {
message: string;
details?: Record<string, any>;
type?: string;
};
status_code: number;
}
// Query Types
export interface BaseQueryParams {
skip?: number;
limit?: number;
}
export interface BenchmarkTrendQuery {
benchmark_name: string;
binary_id: string;
environment_id: string;
limit: number;
}
export interface BatchBenchmarkQuery {
queries: BenchmarkTrendQuery[];
}
// Chart Data Types
export interface ChartDataPoint {
date: string;
timestamp: string;
sha: string;
python_version: string;
[benchmarkName: string]: string | number;
}
export interface TrendDataPoint {
sha: string;
timestamp: string;
python_version: string;
high_watermark_bytes: number;
total_allocated_bytes: number;
}
export interface ComparisonDataPoint {
binary: string;
points: TrendDataPoint[];
geometricMean: number;
}
export interface BenchmarkComparisonData {
benchmark: string;
data: ComparisonDataPoint[];
}
// Filter Types
export interface FilterState {
selectedBinaryId: string | null;
selectedEnvironmentId: string | null;
selectedPythonVersion: string | null;
selectedBenchmarks: string[];
benchmarkSearch: string;
maxDataPoints: number;
}
export interface DiffFilterState extends FilterState {
filterBenchmarkName: string;
filterThreshold: number;
sortField: string;
sortDirection: 'asc' | 'desc';
}
// UI State Types
export interface LoadingState {
[key: string]: boolean;
}
export interface ErrorState {
[key: string]: string | null;
}
// Hook Return Types
export interface UseApiResult<T> {
data: T | undefined;
error: Error | null;
isLoading: boolean;
isError: boolean;
refetch: () => void;
}
export interface UseBatchResult<T> {
data: T[];
errors: (Error | null)[];
isLoading: boolean;
isError: boolean;
refetch: () => void;
}