@go-avro/avro-js 1.6.6-rc3 → 1.6.6-rc4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -88,11 +88,55 @@ export interface PerformanceSample {
88
88
  memory_percent: number;
89
89
  }[];
90
90
  }
91
+ /** A live scheduler process (`avro scheduler-worker`). */
92
+ export interface SchedulerWorker {
93
+ /** `<hostname>:<pid>` of the scheduler process. */
94
+ worker: string;
95
+ /** Unix seconds of the last heartbeat. */
96
+ time: number;
97
+ /** Unix seconds when the process started its scheduler. */
98
+ started_at: number;
99
+ }
100
+ /**
101
+ * Latest run state of a scheduled job. `pending` until its first run since
102
+ * the worker started; `locked` when the last run skipped because another
103
+ * process held the job's Redis lock. A run skipped because the previous one
104
+ * is still going leaves it `running` and sets `last_skipped`.
105
+ */
106
+ export type SchedulerJobStatus = 'pending' | 'running' | 'ok' | 'error' | 'missed' | 'locked';
107
+ /** A scheduled job and its latest run (times are Unix seconds). */
108
+ export interface SchedulerJob {
109
+ /** The job's function name, e.g. `update_routes`. */
110
+ id: string;
111
+ /** E.g. `cron[hour='1', minute='0', second='0']`. */
112
+ trigger: string | null;
113
+ status: SchedulerJobStatus | null;
114
+ next_run_time: number | null;
115
+ last_started: number | null;
116
+ last_finished: number | null;
117
+ last_success: number | null;
118
+ last_skipped: number | null;
119
+ /** Last run skipped because another process held the job's lock. */
120
+ last_locked: number | null;
121
+ /** The Redis lock that was held on the last `locked` run. */
122
+ lock_name: string | null;
123
+ /** Of the last finished run. */
124
+ duration_seconds: number | null;
125
+ last_error: string | null;
126
+ last_error_time: number | null;
127
+ }
128
+ /** Scheduler health: live processes and every job's latest run. */
129
+ export interface PerformanceScheduler {
130
+ /** Empty when no scheduler process is alive. */
131
+ workers: SchedulerWorker[];
132
+ jobs: SchedulerJob[];
133
+ }
91
134
  /** Response of GET /avro/performance (root only). */
92
135
  export interface PerformanceMetrics {
93
136
  current: {
94
137
  database: PerformanceDatabase;
95
138
  fleet: PerformanceFleet;
139
+ scheduler: PerformanceScheduler;
96
140
  };
97
141
  /** Oldest first. */
98
142
  samples: PerformanceSample[];
@@ -108,11 +152,15 @@ export interface ClientErrorReport {
108
152
  route?: string;
109
153
  extra?: Record<string, unknown>;
110
154
  }
111
- /** One entry in the admin error log (backend errors and client crashes). */
155
+ /**
156
+ * One entry in the admin error log (backend errors, client crashes and
157
+ * scheduler job failures). Scheduler entries carry no request context:
158
+ * `endpoint` is the job id and the request fields are absent.
159
+ */
112
160
  export interface ErrorLogEntry {
113
161
  id: string;
114
162
  time: number;
115
- source: 'backend' | 'app' | 'web';
163
+ source: 'backend' | 'app' | 'web' | 'scheduler';
116
164
  /** HTTP status; absent from client reports. */
117
165
  status?: number | null;
118
166
  message: string | null;
@@ -123,22 +171,20 @@ export interface ErrorLogEntry {
123
171
  app_version?: string | null;
124
172
  update_id?: string | null;
125
173
  route?: string | null;
126
- method: string;
127
- path: string;
128
- endpoint: string | null;
129
- client_id: string | null;
130
- client_version: string | null;
131
- js_version: string | null;
132
- user_agent: string | null;
133
- remote_addr: string | null;
134
- forwarded_for: string | null;
135
- source_ip: string | null;
136
- /** A string when the stored value was too long and was truncated to its JSON text. */
137
- user: {
174
+ method?: string | null;
175
+ path?: string | null;
176
+ endpoint?: string | null;
177
+ client_id?: string | null;
178
+ client_version?: string | null;
179
+ js_version?: string | null;
180
+ user_agent?: string | null;
181
+ remote_addr?: string | null;
182
+ forwarded_for?: string | null;
183
+ source_ip?: string | null;
184
+ user?: {
138
185
  id: string;
139
186
  username: string;
140
187
  is_paying?: boolean | null;
141
188
  } | string | null;
142
- /** A string when the stored value was too long and was truncated to its JSON text. */
143
189
  extra?: Record<string, unknown> | string | null;
144
190
  }
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const AVRO_JS_VERSION = "1.6.6-rc3";
1
+ export declare const AVRO_JS_VERSION = "1.6.6-rc4";
package/dist/version.js CHANGED
@@ -1,3 +1,3 @@
1
1
  // AUTO-GENERATED by scripts/gen-version.js — do not edit by hand.
2
2
  // Regenerated from package.json by the `prebuild` npm hook.
3
- export const AVRO_JS_VERSION = '1.6.6-rc3';
3
+ export const AVRO_JS_VERSION = '1.6.6-rc4';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@go-avro/avro-js",
3
- "version": "1.6.6-rc3",
3
+ "version": "1.6.6-rc4",
4
4
  "description": "JS client for Avro backend integration.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",