-
-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathapi.ts
More file actions
150 lines (130 loc) · 2.97 KB
/
Copy pathapi.ts
File metadata and controls
150 lines (130 loc) · 2.97 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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
// API Response Types
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[];
}
// Additional API Parameter Types
export interface BenchmarkNamesQueryParams {
environment_id: string;
binary_id: string;
python_major: number;
python_minor: number;
}
export interface DiffQueryParams {
commit_sha: string;
binary_id: string;
environment_id: string;
metric_key: string;
}
export interface TrendRequest {
benchmark_name: string;
binary_id: string;
environment_id: string;
python_major: number;
python_minor: number;
limit?: number;
}
// Keep TrendQueryParams as alias for backward compatibility
export type TrendQueryParams = TrendRequest;
export interface UploadRequestData {
commit_sha: string;
binary_id: string;
environment_id: string;
python_version: {
major: number;
minor: number;
patch: number;
};
benchmark_results: import('../lib/types').BenchmarkResultJson[];
}
// 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;
}
// Binary/Environment API Response Types
export interface EnvironmentSummary {
id: string;
name: string;
description?: string;
run_count: number;
commit_count: number;
}
export interface CommitSummary {
sha: string;
timestamp: string;
message: string;
author: string;
python_version: { major: number; minor: number; patch: number };
run_timestamp: string;
}
// Batch Trends Request/Response Types
export interface BatchTrendRequest {
trend_queries: TrendRequest[];
}
export interface BatchTrendsResponse {
results: Record<string, TrendDataPoint[]>;
}
// Upload Response Types
export interface UploadResponse {
success: boolean;
}
// 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;
}